Backed out changeset 08c58214f01f (bug 987010) for xpcshell crashes; CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Wed, 26 Mar 2014 15:15:18 +0000
changeset 175525 b9f2eb47b6f55d90ab4c5be749c9eaaa540e3781
parent 175524 1df1b74d9636d27c5912c8efbae34f975ed8ce2a
child 175526 7f9cea6dec5b4a090493ce85a8dac334f3d73dad
push id26492
push userryanvm@gmail.com
push dateThu, 27 Mar 2014 00:57:51 +0000
treeherdermozilla-central@441f5fd256e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs987010
milestone31.0a1
backs out08c58214f01f409d1136d85cf37a778fc5a89f28
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 08c58214f01f (bug 987010) for xpcshell crashes; CLOSED TREE
gfx/2d/DrawTargetSkia.cpp
gfx/2d/SourceSurfaceSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -691,17 +691,19 @@ DrawTargetSkia::InitWithGrContext(GrCont
 
 #endif
 
 void
 DrawTargetSkia::Init(unsigned char* aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat)
 {
   SkAlphaType alphaType = kPremul_SkAlphaType;
   if (aFormat == SurfaceFormat::B8G8R8X8) {
-    alphaType = kIgnore_SkAlphaType;
+    // We have to manually set the A channel to be 255 as Skia doesn't understand BGRX
+    ConvertBGRXToBGRA(aData, aSize, aStride);
+    alphaType = kOpaque_SkAlphaType;
   }
 
   SkBitmap bitmap;
   bitmap.setConfig(GfxFormatToSkiaConfig(aFormat), aSize.width, aSize.height, aStride, alphaType);
   bitmap.setPixels(aData);
   SkAutoTUnref<SkCanvas> canvas(new SkCanvas(new SkBitmapDevice(bitmap)));
 
   mSize = aSize;
--- a/gfx/2d/SourceSurfaceSkia.cpp
+++ b/gfx/2d/SourceSurfaceSkia.cpp
@@ -68,17 +68,22 @@ 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.setAlphaType(kIgnore_SkAlphaType);
+    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);
   }
 
   mSize = aSize;
   mFormat = aFormat;
   mStride = mBitmap.rowBytes();
   return true;
 }