Bug 951686 - Set the SkBitmapDevice to opaque for BGRX surfaces. r=gwright
authorKevin Simons <kevin@comoyo.com>
Mon, 06 Jan 2014 10:03:55 -0500
changeset 162185 3b57aef6724b42b9859f2d037fbe0cec47ca8a5b
parent 162184 a9d9eb8a7d88d094bc5c4cc837a6f6eac5748c75
child 162186 031f4999c5fe7a8d4235a9862ab9ed0a0a958fe6
push idunknown
push userunknown
push dateunknown
reviewersgwright
bugs951686
milestone29.0a1
Bug 951686 - Set the SkBitmapDevice to opaque for BGRX surfaces. r=gwright
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -746,17 +746,19 @@ DrawTargetSkia::CopySurface(SourceSurfac
 
   mCanvas->drawBitmapRect(bitmap, &source, dest, &paint);
   mCanvas->restore();
 }
 
 bool
 DrawTargetSkia::Init(const IntSize &aSize, SurfaceFormat aFormat)
 {
-  SkAutoTUnref<SkDevice> device(new SkDevice(GfxFormatToSkiaConfig(aFormat), aSize.width, aSize.height));
+  SkAutoTUnref<SkDevice> device(new SkDevice(GfxFormatToSkiaConfig(aFormat),
+                                             aSize.width, aSize.height,
+                                             aFormat == FORMAT_B8G8R8X8));
 
   SkBitmap bitmap = device->accessBitmap(true);
   if (!bitmap.allocPixels()) {
     return false;
   }
 
   bitmap.eraseARGB(0, 0, 0, 0);