Bug 987010 - Ignore alpha in Skia BGRX source surfaces - r=gwright
authorJames Willcox <snorp@snorp.net>
Thu, 17 Apr 2014 17:01:23 -0400
changeset 179506 05d2713df1fdf916082ad6e0ad9a78a68ac81c0d
parent 179505 4ad0b2772d4995dd1b5f5da8089215e1f388a0b3
child 179507 8d25da069190f1fbefac5e1fb26121c40d565938
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersgwright
bugs987010
milestone31.0a1
Bug 987010 - Ignore alpha in Skia BGRX source surfaces - r=gwright
gfx/2d/SourceSurfaceSkia.cpp
--- a/gfx/2d/SourceSurfaceSkia.cpp
+++ b/gfx/2d/SourceSurfaceSkia.cpp
@@ -68,22 +68,17 @@ SourceSurfaceSkia::InitFromData(unsigned
   temp.setConfig(GfxFormatToSkiaConfig(aFormat), aSize.width, aSize.height, aStride);
   temp.setPixels(aData);
 
   if (!temp.copyTo(&mBitmap, GfxFormatToSkiaColorType(aFormat))) {
     return false;
   }
 
   if (aFormat == SurfaceFormat::B8G8R8X8) {
-    mBitmap.lockPixels();
-    // We have to manually set the A channel to be 255 as Skia doesn't understand BGRX
-    ConvertBGRXToBGRA(reinterpret_cast<unsigned char*>(mBitmap.getPixels()), aSize, mBitmap.rowBytes());
-    mBitmap.unlockPixels();
-    mBitmap.notifyPixelsChanged();
-    mBitmap.setAlphaType(kOpaque_SkAlphaType);
+    mBitmap.setAlphaType(kIgnore_SkAlphaType);
   }
 
   mSize = aSize;
   mFormat = aFormat;
   mStride = mBitmap.rowBytes();
   return true;
 }