Bug 1004375 - Removed use of legacy skia compatible device API - r=gw280
authorWalter Litwinczyk <wlitwinczyk@mozilla.com>
Tue, 24 Jun 2014 15:35:07 -0700
changeset 212823 0f7f4d5f5e452c6a87151cb1e0219f77ab17633b
parent 212822 c3d527cb59cbe1727f1eab58365f72f475a6c0fb
child 212824 88419653aac6fff6b0dc56735acac88f6ee2d55e
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw280
bugs1004375
milestone33.0a1
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
Bug 1004375 - Removed use of legacy skia compatible device API - r=gw280
gfx/2d/DrawTargetSkia.cpp
gfx/skia/trunk/include/config/SkUserConfig.h
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -716,19 +716,28 @@ DrawTargetSkia::CopySurface(SourceSurfac
   }
   mCanvas->drawBitmapRect(bitmap.mBitmap, &source, dest, &paint);
   mCanvas->restore();
 }
 
 bool
 DrawTargetSkia::Init(const IntSize &aSize, SurfaceFormat aFormat)
 {
-  SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(GfxFormatToSkiaConfig(aFormat),
-                                                       aSize.width, aSize.height,
-                                                       aFormat == SurfaceFormat::B8G8R8X8));
+  SkAlphaType alphaType = (aFormat == SurfaceFormat::B8G8R8X8) ?
+    kOpaque_SkAlphaType : kPremul_SkAlphaType;
+
+  SkImageInfo skiInfo = SkImageInfo::Make(
+        aSize.width, aSize.height,
+        GfxFormatToSkiaColorType(aFormat),
+        alphaType);
+
+  SkAutoTUnref<SkBaseDevice> device(SkBitmapDevice::Create(skiInfo));
+  if (!device) {
+      return false;
+  }
 
   SkBitmap bitmap = device->accessBitmap(true);
   if (!bitmap.allocPixels()) {
     return false;
   }
 
   bitmap.eraseARGB(0, 0, 0, 0);
 
--- a/gfx/skia/trunk/include/config/SkUserConfig.h
+++ b/gfx/skia/trunk/include/config/SkUserConfig.h
@@ -199,9 +199,8 @@
 #  if defined(SK_BUILD_FOR_WIN32)
 #    define SK_MUTEX_PLATFORM_H "skia/SkMutex_win.h"
 #  else
 #    define SK_MUTEX_PLATFORM_H "skia/SkMutex_pthread.h"
 #  endif
 #endif
 
 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
-#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 1