Bug 1004374 - Removed Moz2D usage of deprecated skia api: SK_SUPPORT_LEGACY_LAYERRASTERIZER_API. r=gw280
authorWalter Litwinczyk <wlitwinczyk@mozilla.com>
Fri, 20 Jun 2014 11:47:27 -0700
changeset 211431 b4991c65b2a4355eae4cd635052b79195755bca2
parent 211430 6aa2fa82aa1464a9cd8bcbc7bf2fb7af19c60428
child 211432 4bbc2846101f160ab883437b76405723e9b0d6e5
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
bugs1004374
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 1004374 - Removed Moz2D usage of deprecated skia api: SK_SUPPORT_LEGACY_LAYERRASTERIZER_API. r=gw280
gfx/2d/DrawTargetSkia.cpp
gfx/skia/trunk/include/config/SkUserConfig.h
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -531,19 +531,20 @@ DrawTargetSkia::Mask(const Pattern &aSou
 {
   MarkChanged();
   AutoPaintSetup paint(mCanvas.get(), aOptions, aSource);
 
   SkPaint maskPaint;
   TempBitmap tmpBitmap;
   SetPaintPattern(maskPaint, aMask, tmpBitmap);
   
-  SkLayerRasterizer *raster = new SkLayerRasterizer();
-  raster->addLayer(maskPaint);
-  SkSafeUnref(paint.mPaint.setRasterizer(raster));
+  SkLayerRasterizer::Builder builder;
+  builder.addLayer(maskPaint);
+  SkAutoTUnref<SkRasterizer> raster(builder.detachRasterizer());
+  paint.mPaint.setRasterizer(raster.get());
 
   mCanvas->drawRect(SkRectCoveringWholeSurface(), paint.mPaint);
 }
 
 void
 DrawTargetSkia::MaskSurface(const Pattern &aSource,
                             SourceSurface *aMask,
                             Point aOffset,
@@ -559,19 +560,20 @@ DrawTargetSkia::MaskSurface(const Patter
     SkPaint maskPaint;
     TempBitmap tmpBitmap;
     SetPaintPattern(maskPaint, SurfacePattern(aMask, ExtendMode::CLAMP), tmpBitmap);
 
     SkMatrix transform = maskPaint.getShader()->getLocalMatrix();
     transform.postTranslate(SkFloatToScalar(aOffset.x), SkFloatToScalar(aOffset.y));
     maskPaint.getShader()->setLocalMatrix(transform);
 
-    SkLayerRasterizer *raster = new SkLayerRasterizer();
-    raster->addLayer(maskPaint);
-    SkSafeUnref(paint.mPaint.setRasterizer(raster));
+    SkLayerRasterizer::Builder builder;
+    builder.addLayer(maskPaint);
+    SkAutoTUnref<SkRasterizer> raster(builder.detachRasterizer());
+    paint.mPaint.setRasterizer(raster.get());
 
     IntSize size = aMask->GetSize();
     Rect rect = Rect(aOffset.x, aOffset.y, size.width, size.height);
     mCanvas->drawRect(RectToSkRect(rect), paint.mPaint);
   }
 }
 
 TemporaryRef<SourceSurface>
--- a/gfx/skia/trunk/include/config/SkUserConfig.h
+++ b/gfx/skia/trunk/include/config/SkUserConfig.h
@@ -199,11 +199,9 @@
 #  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_LAYERRASTERIZER_API 1
 #define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 1