Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
This commit is contained in:
@@ -1170,8 +1170,10 @@ RefPtr<gfx::DataSourceSurface> ClientWebGLContext::BackBufferSnapshot() {
|
||||
return surf;
|
||||
}
|
||||
|
||||
UniquePtr<uint8_t[]> ClientWebGLContext::GetImageBuffer(int32_t* out_format) {
|
||||
UniquePtr<uint8_t[]> ClientWebGLContext::GetImageBuffer(
|
||||
int32_t* out_format, gfx::IntSize* out_imageSize) {
|
||||
*out_format = 0;
|
||||
*out_imageSize = {};
|
||||
|
||||
// Use GetSurfaceSnapshot() to make sure that appropriate y-flip gets applied
|
||||
gfxAlphaType any;
|
||||
@@ -1181,6 +1183,7 @@ UniquePtr<uint8_t[]> ClientWebGLContext::GetImageBuffer(int32_t* out_format) {
|
||||
RefPtr<gfx::DataSourceSurface> dataSurface = snapshot->GetDataSurface();
|
||||
|
||||
const auto& premultAlpha = mNotLost->info.options.premultipliedAlpha;
|
||||
*out_imageSize = dataSurface->GetSize();
|
||||
return gfxUtils::GetImageBuffer(dataSurface, premultAlpha, out_format);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user