Add SK_SUPPORT_LEGACY_PORTER_DUFF macro.
authortfarina <tfarina@chromium.org>
Wed, 3 Dec 2014 21:13:02 +0000 (13:13 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Dec 2014 21:13:02 +0000 (13:13 -0800)
This trick will be used to remove deprecated SkPorterDuff API. But first
we need to add it so Android can be updated later.

BUG=skia:3178
R=scroggo@google.com

Review URL: https://codereview.chromium.org/758133004

gyp/skia_for_android_framework_defines.gypi
include/effects/SkPorterDuff.h
src/effects/SkPorterDuff.cpp

index f10f3e6..ee0e1f3 100644 (file)
@@ -20,6 +20,8 @@
       'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
       'SK_LEGACY_PICTURE_SIZE_API',
       'SK_LEGACY_PICTURE_DRAW_API',
+      # TODO(tfarina): Remove this when Android is fixed. skbug.com/3178
+      'SK_SUPPORT_LEGACY_PORTER_DUFF',
     ],
   },
 }
index e984e8e..7a62e47 100644 (file)
 #include "SkColor.h"
 #include "SkXfermode.h"
 
+//#define SK_SUPPORT_LEGACY_PORTER_DUFF
+
+// Temporary guard until we can remove the dependencies in android. Then we
+// plan to remove this entirely.
+#ifdef SK_SUPPORT_LEGACY_PORTER_DUFF
+
 class SkXfermode;
 
 class SK_API SkPorterDuff {
@@ -77,3 +83,5 @@ public:
 } SK_ATTR_DEPRECATED("use SkXfermode::Mode");
 
 #endif
+
+#endif
index 4cdcf79..5564ca7 100644 (file)
@@ -10,6 +10,8 @@
 #include "SkPorterDuff.h"
 #include "SkXfermode.h"
 
+#ifdef SK_SUPPORT_LEGACY_PORTER_DUFF
+
 /*  This file just exists as a compatibility layer, gluing the PorterDuff API
     into the (extended) SkXfermode API
  */
@@ -85,3 +87,5 @@ SkXfermodeProc SkPorterDuff::GetXfermodeProc(Mode mode) {
 SkXfermodeProc16 SkPorterDuff::GetXfermodeProc16(Mode mode, SkColor srcColor) {
     return SkXfermode::GetProc16(gPairs[mode].fXF, srcColor);
 }
+
+#endif