remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAM
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4384
Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0
Reviewed-on: https://skia-review.googlesource.com/4384
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/bench/BlurRoundRectBench.cpp b/bench/BlurRoundRectBench.cpp
index 123e889..6aaa11f 100644
--- a/bench/BlurRoundRectBench.cpp
+++ b/bench/BlurRoundRectBench.cpp
@@ -45,7 +45,7 @@
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = SkLayerDrawLooper::kMaskFilter_Bit
| SkLayerDrawLooper::kColorFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0));
info.fPostTranslate = false;
SkPaint* paint = looperBuilder.addLayerOnTop(info);
diff --git a/bench/RectoriBench.cpp b/bench/RectoriBench.cpp
index 86304ae..416f9ea 100644
--- a/bench/RectoriBench.cpp
+++ b/bench/RectoriBench.cpp
@@ -80,7 +80,7 @@
// TODO: add a color filter to better match what is seen in the wild
info.fPaintBits = /* SkLayerDrawLooper::kColorFilter_Bit |*/
SkLayerDrawLooper::kMaskFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kDst;
+ info.fColorMode = SkBlendMode::kDst;
info.fOffset.set(xOff, 0);
info.fPostTranslate = false;
diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp
index 8e5b89d..80bf6cc 100644
--- a/gm/blurroundrect.cpp
+++ b/gm/blurroundrect.cpp
@@ -51,7 +51,7 @@
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = SkLayerDrawLooper::kMaskFilter_Bit
| SkLayerDrawLooper::kColorFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0));
info.fPostTranslate = false;
SkPaint* paint = looperBuilder.addLayerOnTop(info);
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp
index 8275939..676e01a 100644
--- a/gm/drawlooper.cpp
+++ b/gm/drawlooper.cpp
@@ -73,7 +73,7 @@
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = SkLayerDrawLooper::kStyle_Bit | SkLayerDrawLooper::kMaskFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
for (size_t i = 0; i < SK_ARRAY_COUNT(gParams); i++) {
info.fOffset.set(gParams[i].fOffset, gParams[i].fOffset);
diff --git a/gm/megalooper.cpp b/gm/megalooper.cpp
index fd8757b..f5077c0 100644
--- a/gm/megalooper.cpp
+++ b/gm/megalooper.cpp
@@ -167,7 +167,7 @@
info.fPaintBits = SkLayerDrawLooper::kColorFilter_Bit |
SkLayerDrawLooper::kMaskFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
info.fOffset.set(xOff, yOff);
info.fPostTranslate = false;
@@ -210,7 +210,7 @@
info.fPaintBits = SkLayerDrawLooper::kColorFilter_Bit |
SkLayerDrawLooper::kMaskFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
info.fPostTranslate = false;
SkPaint* paint;
diff --git a/gm/textbloblooper.cpp b/gm/textbloblooper.cpp
index 29f9756..d0e5508 100644
--- a/gm/textbloblooper.cpp
+++ b/gm/textbloblooper.cpp
@@ -115,7 +115,7 @@
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = bits;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
for (size_t i = 0; i < size; i++) {
info.fOffset.set(settings[i].fOffset, settings[i].fOffset);
diff --git a/gn/android_framework_defines.gni b/gn/android_framework_defines.gni
index 1200058..c192867 100644
--- a/gn/android_framework_defines.gni
+++ b/gn/android_framework_defines.gni
@@ -7,6 +7,7 @@
"SK_SUPPORT_LEGACY_UNBALANCED_PIXELREF_LOCKCOUNT",
# Needed until we fix https://bug.skia.org/2440 .
+ "SK_SUPPORT_LEGACY_XFERMODE_PARAM_TYPES",
"SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG",
"SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS",
"SK_SUPPORT_LEGACY_GRADIENT_DITHERING",
@@ -14,6 +15,4 @@
"SK_IGNORE_GPU_DITHER",
"SK_SUPPORT_LEGACY_CLIP_REGIONOPS",
"SK_SUPPORT_LEGACY_SHADER_ISABITMAP",
- "SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES",
- "SK_SUPPORT_LEGACY_SETIMAGEFILTER_PTR",
]
diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h
index 24a9992..46269c3 100644
--- a/include/core/SkBitmapDevice.h
+++ b/include/core/SkBitmapDevice.h
@@ -114,7 +114,7 @@
const SkPoint& offset, const SkPaint& paint) override;
virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) override;
virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, const SkPaint&) override;
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 1dcf193..ab47edd 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1200,26 +1200,6 @@
indices, indexCount, paint);
}
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- void drawVertices(VertexMode vmode, int vertexCount,
- const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SkXfermode* xmode,
- const uint16_t indices[], int indexCount,
- const SkPaint& paint) {
- this->drawVertices(vmode, vertexCount, vertices, texs, colors,
- xmode ? xmode->blend() : SkBlendMode::kModulate,
- indices, indexCount, paint);
- }
- void drawVertices(VertexMode vmode, int vertexCount,
- const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], const sk_sp<SkXfermode>& xmode,
- const uint16_t indices[], int indexCount,
- const SkPaint& paint) {
- this->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode.get(),
- indices, indexCount, paint);
- }
-#endif
-
/**
Draw a cubic coons patch
@@ -1240,18 +1220,6 @@
this->drawPatch(cubics, colors, texCoords, SkBlendMode::kModulate, paint);
}
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- void drawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
- this->drawPatch(cubics, colors, texCoords, xmode ? xmode->blend() : SkBlendMode::kModulate,
- paint);
- }
- void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4],
- const sk_sp<SkXfermode>& xmode, const SkPaint& paint) {
- this->drawPatch(cubics, colors, texCoords, xmode.get(), paint);
- }
-#endif
-
/**
* Draw a set of sprites from the atlas. Each is specified by a tex rectangle in the
* coordinate space of the atlas, and a corresponding xform which transforms the tex rectangle
@@ -1287,20 +1255,6 @@
cullRect, paint);
}
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
- const SkColor colors[], int count, SkXfermode::Mode mode, const SkRect* cullRect,
- const SkPaint* paint) {
- this->drawAtlas(atlas, xform, tex, colors, count, (SkBlendMode)mode, cullRect, paint);
- }
-
- void drawAtlas(const sk_sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[],
- const SkColor colors[], int count, SkXfermode::Mode mode, const SkRect* cull,
- const SkPaint* paint) {
- this->drawAtlas(atlas.get(), xform, tex, colors, count, (SkBlendMode)mode, cull, paint);
- }
-#endif
-
/**
* Draw the contents of this drawable into the canvas. If the canvas is async
* (e.g. it is recording into a picture) then the drawable will be referenced instead,
@@ -1485,7 +1439,7 @@
const SkPaint& paint);
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM, const SkPaint& paint);
+ const SkPoint texCoords[4], SkBlendMode, const SkPaint& paint);
virtual void onDrawDrawable(SkDrawable*, const SkMatrix*);
@@ -1498,11 +1452,11 @@
virtual void onDrawRRect(const SkRRect&, const SkPaint&);
virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&);
virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint vertices[],
- const SkPoint texs[], const SkColor colors[], SK_XFERMODE_PARAM,
+ const SkPoint texs[], const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount, const SkPaint&);
virtual void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
- int count, SK_XFERMODE_MODE_PARAM, const SkRect* cull, const SkPaint*);
+ int count, SkBlendMode, const SkRect* cull, const SkPaint*);
virtual void onDrawPath(const SkPath&, const SkPaint&);
virtual void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*);
virtual void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index fa6c9db..346e721 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -34,7 +34,7 @@
* returns true, and sets (if not NULL) the color and mode appropriately.
* If not, this returns false and ignores the parameters.
*/
- virtual bool asColorMode(SkColor* color, SK_XFERMODE_MODE_PARAM* mode) const;
+ virtual bool asColorMode(SkColor* color, SkBlendMode* bmode) const;
/**
* If the filter can be represented by a 5x4 matrix, this
@@ -116,11 +116,6 @@
or NULL if the mode will have no effect.
*/
static sk_sp<SkColorFilter> MakeModeFilter(SkColor c, SkBlendMode mode);
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- static sk_sp<SkColorFilter> MakeModeFilter(SkColor c, SkXfermode::Mode mode) {
- return MakeModeFilter(c, (SkBlendMode)mode);
- }
-#endif
/** Construct a colorfilter whose effect is to first apply the inner filter and then apply
* the outer filter to the result of the inner's.
diff --git a/include/core/SkColorSpace.h b/include/core/SkColorSpace.h
index 1ea43e4..2139cf8 100644
--- a/include/core/SkColorSpace.h
+++ b/include/core/SkColorSpace.h
@@ -107,18 +107,6 @@
*/
static sk_sp<SkColorSpace> MakeICC(const void*, size_t);
-#ifdef SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES
- static sk_sp<SkColorSpace> NewRGB(RenderTargetGamma gamma, const SkMatrix44& toXYZD50) {
- return MakeRGB(gamma, toXYZD50);
- }
- static sk_sp<SkColorSpace> NewRGB(const SkColorSpaceTransferFn& coeffs,
- const SkMatrix44& toXYZD50) {
- return MakeRGB(coeffs, toXYZD50);
- }
- static sk_sp<SkColorSpace> NewNamed(Named named) { return MakeNamed(named); }
- static sk_sp<SkColorSpace> NewICC(const void* input, size_t len) { return MakeICC(input, len); }
-#endif
-
/**
* Returns true if the color space gamma is near enough to be approximated as sRGB.
*/
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index d8fa2f2..d521fec 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -206,7 +206,7 @@
const SkPoint& offset, const SkPaint& paint) = 0;
virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) = 0;
// default implementation unrolls the blob runs.
@@ -214,11 +214,11 @@
const SkPaint& paint, SkDrawFilter* drawFilter);
// default implementation calls drawVertices
virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM, const SkPaint& paint);
+ const SkPoint texCoords[4], SkBlendMode, const SkPaint& paint);
// default implementation calls drawPath
virtual void drawAtlas(const SkDraw&, const SkImage* atlas, const SkRSXform[], const SkRect[],
- const SkColor[], int count, SK_XFERMODE_MODE_PARAM, const SkPaint&);
+ const SkColor[], int count, SkBlendMode, const SkPaint&);
virtual void drawAnnotation(const SkDraw&, const SkRect&, const char[], SkData*) {}
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index d9518b1..2f83694 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -320,9 +320,6 @@
struct ComposeRec {
const SkShader* fShaderA;
const SkShader* fShaderB;
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- const SkXfermode* fMode;
-#endif
SkBlendMode fBlendMode;
};
@@ -425,25 +422,6 @@
static sk_sp<SkShader> MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader> src, SkBlendMode);
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- static sk_sp<SkShader> MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader> src,
- SkXfermode::Mode mode) {
- return MakeComposeShader(dst, src, (SkBlendMode)mode);
- }
-
- /**
- * Create a new compose shader, given shaders dst, src, and a combining xfermode mode.
- * The xfermode is called with the output of the two shaders, and its output is returned.
- * If xfer is null, SkXfermode::kSrcOver_Mode is assumed.
- *
- * The caller is responsible for managing its reference-count for the xfer (if not null).
- */
- static sk_sp<SkShader> MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader> src,
- sk_sp<SkXfermode> xfer) {
- return MakeComposeShader(dst, src, xfer ? xfer->blend() : SkBlendMode::kSrcOver);
- }
-#endif
-
/** Call this to create a new shader that will draw with the specified bitmap.
*
* If the bitmap cannot be used (e.g. has no pixels, or its dimensions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 9eacfcc..d9dd448 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -35,10 +35,7 @@
#include <string.h>
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- #define SK_XFERMODE_PARAM SkXfermode*
- #define SK_XFERMODE_MODE_PARAM SkXfermode::Mode
-#else
+#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM_TYPES
#define SK_XFERMODE_PARAM SkBlendMode
#define SK_XFERMODE_MODE_PARAM SkBlendMode
#endif
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h
index fd693f7..2c0b68d 100644
--- a/include/effects/SkLayerDrawLooper.h
+++ b/include/effects/SkLayerDrawLooper.h
@@ -56,10 +56,10 @@
* kDst_Mode: to just keep the draw's color, ignoring the layer's
*/
struct SK_API LayerInfo {
- BitFlags fPaintBits;
- SK_XFERMODE_MODE_PARAM fColorMode;
- SkVector fOffset;
- bool fPostTranslate; //!< applies to fOffset
+ BitFlags fPaintBits;
+ SkBlendMode fColorMode;
+ SkVector fOffset;
+ bool fPostTranslate; //!< applies to fOffset
/**
* Initial the LayerInfo. Defaults to settings that will draw the
diff --git a/include/effects/SkMergeImageFilter.h b/include/effects/SkMergeImageFilter.h
index 3245016..a89e690 100644
--- a/include/effects/SkMergeImageFilter.h
+++ b/include/effects/SkMergeImageFilter.h
@@ -21,21 +21,6 @@
static sk_sp<SkImageFilter> MakeN(sk_sp<SkImageFilter>[], int count, const SkBlendMode[],
const CropRect* cropRect = nullptr);
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> first, sk_sp<SkImageFilter> second,
- SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode,
- const CropRect* cropRect = nullptr) {
- return Make(first, second, (SkBlendMode)mode, cropRect);
- }
- static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> filters[],
- int count,
- const SkXfermode::Mode modes[] = nullptr,
- const CropRect* cropRect = nullptr) {
- static_assert(sizeof(SkXfermode::Mode) == sizeof(SkBlendMode), "size mismatch");
- return MakeN(filters, count, (const SkBlendMode*)modes, cropRect);
- }
-#endif
-
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter)
diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h
index a25f2b8..c2152f2 100644
--- a/include/utils/SkDumpCanvas.h
+++ b/include/utils/SkDumpCanvas.h
@@ -93,7 +93,7 @@
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;
void onDrawPaint(const SkPaint&) override;
@@ -113,7 +113,7 @@
const SkPaint*) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
diff --git a/include/utils/SkLuaCanvas.h b/include/utils/SkLuaCanvas.h
index 6342fba..c03a1f0 100644
--- a/include/utils/SkLuaCanvas.h
+++ b/include/utils/SkLuaCanvas.h
@@ -59,7 +59,7 @@
const SkPaint*) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
diff --git a/include/utils/SkNWayCanvas.h b/include/utils/SkNWayCanvas.h
index 6a3728b..e8b88ab 100644
--- a/include/utils/SkNWayCanvas.h
+++ b/include/utils/SkNWayCanvas.h
@@ -52,7 +52,7 @@
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) override;
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;
void onDrawPaint(const SkPaint&) override;
@@ -72,7 +72,7 @@
const SkPaint*) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
diff --git a/include/utils/SkPaintFilterCanvas.h b/include/utils/SkPaintFilterCanvas.h
index 69cdff4..7dc7969 100644
--- a/include/utils/SkPaintFilterCanvas.h
+++ b/include/utils/SkPaintFilterCanvas.h
@@ -76,11 +76,11 @@
const SkPaint*) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;
void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
diff --git a/public.bzl b/public.bzl
index 3cbba38..f2ed85e 100644
--- a/public.bzl
+++ b/public.bzl
@@ -599,6 +599,7 @@
# Turn on a few Google3-specific build fixes.
"GOOGLE3",
# Staging flags for API changes
+ "SK_SUPPORT_LEGACY_XFERMODE_PARAM_TYPES",
"SK_SUPPORT_LEGACY_ACCESSBITMAP",
"SK_SUPPORT_LEGACY_CLIP_REGIONOPS",
"SK_SUPPORT_LEGACY_SETIMAGEFILTER_PTR",
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index cb177e0..78dff36 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -367,15 +367,9 @@
void SkBitmapDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
int vertexCount,
const SkPoint verts[], const SkPoint textures[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
- SkBlendMode bmode;
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- bmode = xmode;
-#endif
draw.drawVertices(vmode, vertexCount, verts, textures, colors, bmode,
indices, indexCount, paint);
}
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index d3876b1..f4896cb 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1865,12 +1865,7 @@
void SkCanvas::drawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount, const SkPaint& paint) {
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkXfermode* xmode = SkXfermode::Peek(bmode);
-#else
- SkBlendMode xmode = bmode;
-#endif
- this->onDrawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
+ this->onDrawVertices(vmode, vertexCount, vertices, texs, colors, bmode,
indices, indexCount, paint);
}
@@ -2006,7 +2001,7 @@
}
SkASSERT(atlas);
SkASSERT(tex);
- this->onDrawAtlas(atlas, xform, tex, colors, count, (SK_XFERMODE_MODE_PARAM)mode, cull, paint);
+ this->onDrawAtlas(atlas, xform, tex, colors, count, mode, cull, paint);
}
void SkCanvas::drawAnnotation(const SkRect& rect, const char key[], SkData* value) {
@@ -2815,7 +2810,7 @@
void SkCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawVertices()");
@@ -2823,7 +2818,7 @@
while (iter.next()) {
iter.fDevice->drawVertices(iter, vmode, vertexCount, verts, texs,
- colors, xmode, indices, indexCount,
+ colors, bmode, indices, indexCount,
looper.paint());
}
@@ -2838,16 +2833,11 @@
return;
}
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkXfermode* xmode = SkXfermode::Peek(bmode);
-#else
- SkBlendMode xmode = bmode;
-#endif
- this->onDrawPatch(cubics, colors, texCoords, xmode, paint);
+ this->onDrawPatch(cubics, colors, texCoords, bmode, paint);
}
void SkCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
// Since a patch is always within the convex hull of the control points, we discard it when its
// bounding rectangle is completely outside the current clip.
@@ -2860,7 +2850,7 @@
LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, nullptr)
while (iter.next()) {
- iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint);
+ iter.fDevice->drawPatch(iter, cubics, colors, texCoords, bmode, paint);
}
LOOPER_END
@@ -2891,7 +2881,7 @@
}
void SkCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
- const SkColor colors[], int count, SK_XFERMODE_MODE_PARAM mode,
+ const SkColor colors[], int count, SkBlendMode bmode,
const SkRect* cull, const SkPaint* paint) {
if (cull && this->quickReject(*cull)) {
return;
@@ -2904,7 +2894,7 @@
LOOPER_BEGIN(pnt, SkDrawFilter::kPath_Type, nullptr)
while (iter.next()) {
- iter.fDevice->drawAtlas(iter, atlas, xform, tex, colors, count, mode, pnt);
+ iter.fDevice->drawAtlas(iter, atlas, xform, tex, colors, count, bmode, pnt);
}
LOOPER_END
}
diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp
index 5050d00..6e21beb 100644
--- a/src/core/SkColorFilter.cpp
+++ b/src/core/SkColorFilter.cpp
@@ -19,7 +19,7 @@
#include "GrFragmentProcessor.h"
#endif
-bool SkColorFilter::asColorMode(SkColor* color, SK_XFERMODE_MODE_PARAM* mode) const {
+bool SkColorFilter::asColorMode(SkColor*, SkBlendMode*) const {
return false;
}
diff --git a/src/core/SkColorSpace_Base.h b/src/core/SkColorSpace_Base.h
index 76595e9..a3cf6e0 100644
--- a/src/core/SkColorSpace_Base.h
+++ b/src/core/SkColorSpace_Base.h
@@ -215,11 +215,6 @@
sk_sp<SkData> writeToICC() const;
static sk_sp<SkColorSpace> MakeRGB(SkGammaNamed gammaNamed, const SkMatrix44& toXYZD50);
-#ifdef SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES
- static sk_sp<SkColorSpace> NewRGB(SkGammaNamed gammaNamed, const SkMatrix44& toXYZD50) {
- return MakeRGB(gammaNamed, toXYZD50);
- }
-#endif
SkColorSpace_Base(SkGammaNamed gammaNamed, const SkMatrix44& toXYZ);
diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp
index 8c21453..f04527b 100644
--- a/src/core/SkComposeShader.cpp
+++ b/src/core/SkComposeShader.cpp
@@ -125,11 +125,8 @@
bool SkComposeShader::asACompose(ComposeRec* rec) const {
if (rec) {
- rec->fShaderA = fShaderA.get();
- rec->fShaderB = fShaderB.get();
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- rec->fMode = SkXfermode::Peek(fMode);
-#endif
+ rec->fShaderA = fShaderA.get();
+ rec->fShaderB = fShaderB.get();
rec->fBlendMode = fMode;
}
return true;
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 30da202..b2ff242 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -119,7 +119,7 @@
}
void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode, const SkPaint& paint) {
+ const SkPoint texCoords[4], SkBlendMode bmode, const SkPaint& paint) {
SkPatchUtils::VertexData data;
SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, draw.fMatrix);
@@ -128,7 +128,7 @@
// If it fails to generate the vertices, then we do not draw.
if (SkPatchUtils::getVertexData(&data, cubics, colors, texCoords, lod.width(), lod.height())) {
this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints,
- data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount,
+ data.fTexCoords, data.fColors, bmode, data.fIndices, data.fIndexCount,
paint);
}
}
@@ -240,7 +240,7 @@
void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkRSXform xform[],
const SkRect tex[], const SkColor colors[], int count,
- SK_XFERMODE_MODE_PARAM mode, const SkPaint& paint) {
+ SkBlendMode mode, const SkPaint& paint) {
SkPath path;
path.setIsVolatile(true);
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp
index fd20885..3f6e54e 100644
--- a/src/core/SkLiteDL.cpp
+++ b/src/core/SkLiteDL.cpp
@@ -454,12 +454,8 @@
struct DrawPatch final : Op {
static const auto kType = Type::DrawPatch;
DrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texs[4],
- SK_XFERMODE_PARAM xfermode, const SkPaint& paint)
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- : xfermode(sk_ref_sp(xfermode)), paint(paint)
-#else
- : xfermode(xfermode), paint(paint)
-#endif
+ SkBlendMode bmode, const SkPaint& paint)
+ : xfermode(bmode), paint(paint)
{
copy_v(this->cubics, cubics, 12);
if (colors) { copy_v(this->colors, colors, 4); has_colors = true; }
@@ -468,11 +464,7 @@
SkPoint cubics[12];
SkColor colors[4];
SkPoint texs[4];
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- sk_sp<SkXfermode> xfermode;
-#else
SkBlendMode xfermode;
-#endif
SkPaint paint;
bool has_colors = false;
bool has_texs = false;
@@ -494,21 +486,13 @@
};
struct DrawVertices final : Op {
static const auto kType = Type::DrawVertices;
- DrawVertices(SkCanvas::VertexMode mode, int count, SK_XFERMODE_PARAM xfermode, int nindices,
+ DrawVertices(SkCanvas::VertexMode mode, int count, SkBlendMode bmode, int nindices,
const SkPaint& paint, bool has_texs, bool has_colors, bool has_indices)
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- : mode(mode), count(count), xfermode(sk_ref_sp(xfermode)), nindices(nindices)
-#else
- : mode(mode), count(count), xfermode(xfermode), nindices(nindices)
-#endif
+ : mode(mode), count(count), xfermode(bmode), nindices(nindices)
, paint(paint), has_texs(has_texs), has_colors(has_colors), has_indices(has_indices) {}
SkCanvas::VertexMode mode;
int count;
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- sk_sp<SkXfermode> xfermode;
-#else
SkBlendMode xfermode;
-#endif
int nindices;
SkPaint paint;
bool has_texs;
@@ -540,7 +524,7 @@
};
struct DrawAtlas final : Op {
static const auto kType = Type::DrawAtlas;
- DrawAtlas(const SkImage* atlas, int count, SK_XFERMODE_MODE_PARAM xfermode,
+ DrawAtlas(const SkImage* atlas, int count, SkBlendMode xfermode,
const SkRect* cull, const SkPaint* paint, bool has_colors)
: atlas(sk_ref_sp(atlas)), count(count), xfermode(xfermode), has_colors(has_colors) {
if (cull) { this->cull = *cull; }
@@ -548,7 +532,7 @@
}
sk_sp<const SkImage> atlas;
int count;
- SK_XFERMODE_MODE_PARAM xfermode;
+ SkBlendMode xfermode;
SkRect cull = kUnset;
SkPaint paint;
bool has_colors;
@@ -728,8 +712,8 @@
}
void SkLiteDL::drawPatch(const SkPoint points[12], const SkColor colors[4], const SkPoint texs[4],
- SK_XFERMODE_PARAM xfermode, const SkPaint& paint) {
- this->push<DrawPatch>(0, points, colors, texs, xfermode, paint);
+ SkBlendMode bmode, const SkPaint& paint) {
+ this->push<DrawPatch>(0, points, colors, texs, bmode, paint);
}
void SkLiteDL::drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint points[],
const SkPaint& paint) {
@@ -737,7 +721,7 @@
copy_v(pod, points,count);
}
void SkLiteDL::drawVertices(SkCanvas::VertexMode mode, int count, const SkPoint vertices[],
- const SkPoint texs[], const SkColor colors[], SK_XFERMODE_PARAM xfermode,
+ const SkPoint texs[], const SkColor colors[], SkBlendMode xfermode,
const uint16_t indices[], int nindices, const SkPaint& paint) {
size_t bytes = count * sizeof(SkPoint);
if (texs ) { bytes += count * sizeof(SkPoint); }
@@ -751,7 +735,7 @@
indices, indices ? nindices : 0);
}
void SkLiteDL::drawAtlas(const SkImage* atlas, const SkRSXform xforms[], const SkRect texs[],
- const SkColor colors[], int count, SK_XFERMODE_MODE_PARAM xfermode,
+ const SkColor colors[], int count, SkBlendMode xfermode,
const SkRect* cull, const SkPaint* paint) {
size_t bytes = count*(sizeof(SkRSXform) + sizeof(SkRect));
if (colors) {
diff --git a/src/core/SkLiteDL.h b/src/core/SkLiteDL.h
index 30211a6..43988c0 100644
--- a/src/core/SkLiteDL.h
+++ b/src/core/SkLiteDL.h
@@ -78,12 +78,12 @@
const SkRect&, const SkPaint*);
void drawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4],
- SK_XFERMODE_PARAM, const SkPaint&);
+ SkBlendMode, const SkPaint&);
void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint&);
void drawVertices(SkCanvas::VertexMode, int, const SkPoint[], const SkPoint[], const SkColor[],
- SK_XFERMODE_PARAM, const uint16_t[], int, const SkPaint&);
+ SkBlendMode, const uint16_t[], int, const SkPaint&);
void drawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
- SK_XFERMODE_MODE_PARAM, const SkRect*, const SkPaint*);
+ SkBlendMode, const SkRect*, const SkPaint*);
void setBounds(const SkRect& bounds);
diff --git a/src/core/SkLiteRecorder.cpp b/src/core/SkLiteRecorder.cpp
index 4c3de18..866ebd0 100644
--- a/src/core/SkLiteRecorder.cpp
+++ b/src/core/SkLiteRecorder.cpp
@@ -171,8 +171,8 @@
void SkLiteRecorder::onDrawPatch(const SkPoint cubics[12],
const SkColor colors[4], const SkPoint texCoords[4],
- SK_XFERMODE_PARAM xfermode, const SkPaint& paint) {
- fDL->drawPatch(cubics, colors, texCoords, xfermode, paint);
+ SkBlendMode bmode, const SkPaint& paint) {
+ fDL->drawPatch(cubics, colors, texCoords, bmode, paint);
}
void SkLiteRecorder::onDrawPoints(SkCanvas::PointMode mode,
size_t count, const SkPoint pts[],
@@ -182,20 +182,20 @@
void SkLiteRecorder::onDrawVertices(SkCanvas::VertexMode mode,
int count, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xfermode,
+ SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
- fDL->drawVertices(mode, count, vertices, texs, colors, xfermode, indices, indexCount, paint);
+ fDL->drawVertices(mode, count, vertices, texs, colors, bmode, indices, indexCount, paint);
}
void SkLiteRecorder::onDrawAtlas(const SkImage* atlas,
const SkRSXform xforms[],
const SkRect texs[],
const SkColor colors[],
int count,
- SK_XFERMODE_MODE_PARAM xfermode,
+ SkBlendMode bmode,
const SkRect* cull,
const SkPaint* paint) {
- fDL->drawAtlas(atlas, xforms, texs, colors, count, xfermode, cull, paint);
+ fDL->drawAtlas(atlas, xforms, texs, colors, count, bmode, cull, paint);
}
void SkLiteRecorder::didTranslateZ(SkScalar dz) {
diff --git a/src/core/SkLiteRecorder.h b/src/core/SkLiteRecorder.h
index 9010a42..4ae2456 100644
--- a/src/core/SkLiteRecorder.h
+++ b/src/core/SkLiteRecorder.h
@@ -72,12 +72,12 @@
SrcRectConstraint) override;
void onDrawPatch(const SkPoint[12], const SkColor[4],
- const SkPoint[4], SK_XFERMODE_PARAM, const SkPaint&) override;
+ const SkPoint[4], SkBlendMode, const SkPaint&) override;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
void onDrawVertices(VertexMode, int, const SkPoint[], const SkPoint[], const SkColor[],
- SK_XFERMODE_PARAM, const uint16_t[], int, const SkPaint&) override;
+ SkBlendMode, const uint16_t[], int, const SkPaint&) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
- int, SK_XFERMODE_MODE_PARAM, const SkRect*, const SkPaint*) override;
+ int, SkBlendMode, const SkRect*, const SkPaint*) override;
#ifdef SK_EXPERIMENTAL_SHADOWING
void didTranslateZ(SkScalar) override;
diff --git a/src/core/SkModeColorFilter.cpp b/src/core/SkModeColorFilter.cpp
index 1982604..176c92b 100644
--- a/src/core/SkModeColorFilter.cpp
+++ b/src/core/SkModeColorFilter.cpp
@@ -29,12 +29,12 @@
}
#endif
-bool SkModeColorFilter::asColorMode(SkColor* color, SK_XFERMODE_MODE_PARAM* mode) const {
+bool SkModeColorFilter::asColorMode(SkColor* color, SkBlendMode* mode) const {
if (color) {
*color = fColor;
}
if (mode) {
- *mode = (SK_XFERMODE_MODE_PARAM)fMode;
+ *mode = fMode;
}
return true;
}
diff --git a/src/core/SkModeColorFilter.h b/src/core/SkModeColorFilter.h
index 2b9d637..2c3d4dc 100644
--- a/src/core/SkModeColorFilter.h
+++ b/src/core/SkModeColorFilter.h
@@ -22,7 +22,7 @@
SkBlendMode getMode() const { return fMode; }
SkPMColor getPMColor() const { return fPMColor; }
- bool asColorMode(SkColor*, SK_XFERMODE_MODE_PARAM*) const override;
+ bool asColorMode(SkColor*, SkBlendMode*) const override;
uint32_t getFlags() const override;
void filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) const override;
void filterSpan4f(const SkPM4f shader[], int count, SkPM4f result[]) const override;
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 2a11a32..086eb8d 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -722,7 +722,7 @@
void SkPictureRecord::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
uint32_t flags = 0;
@@ -735,14 +735,6 @@
if (indexCount > 0) {
flags |= DRAW_VERTICES_HAS_INDICES;
}
- SkBlendMode bmode = SkBlendMode::kModulate;
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- if (xmode) {
- bmode = xmode->blend();
- }
-#else
- bmode = xmode;
-#endif
if (SkBlendMode::kModulate != bmode) {
flags |= DRAW_VERTICES_HAS_XFER;
}
@@ -786,7 +778,7 @@
}
void SkPictureRecord::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
// op + paint index + patch 12 control points + flag + patch 4 colors + 4 texture coordinates
size_t size = 2 * kUInt32Size + SkPatchUtils::kNumCtrlPts * sizeof(SkPoint) + kUInt32Size;
@@ -799,14 +791,6 @@
flag |= DRAW_VERTICES_HAS_TEXS;
size += SkPatchUtils::kNumCorners * sizeof(SkPoint);
}
- SkBlendMode bmode = SkBlendMode::kModulate;
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- if (xmode) {
- bmode = xmode->blend();
- }
-#else
- bmode = xmode;
-#endif
if (SkBlendMode::kModulate != bmode) {
flag |= DRAW_VERTICES_HAS_XFER;
size += kUInt32Size;
@@ -831,7 +815,7 @@
}
void SkPictureRecord::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
- const SkColor colors[], int count, SK_XFERMODE_MODE_PARAM mode,
+ const SkColor colors[], int count, SkBlendMode mode,
const SkRect* cull, const SkPaint* paint) {
// [op + paint-index + atlas-index + flags + count] + [xform] + [tex] + [*colors + mode] + cull
size_t size = 5 * kUInt32Size + count * sizeof(SkRSXform) + count * sizeof(SkRect);
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index 0db9b8b..ca858a6 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -178,10 +178,9 @@
const SkPaint& paint) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
- const SkPaint& paint) override;
+ const SkPoint texCoords[4], SkBlendMode, const SkPaint& paint) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
- SK_XFERMODE_MODE_PARAM, const SkRect*, const SkPaint*) override;
+ SkBlendMode, const SkRect*, const SkPaint*) override;
void onDrawPaint(const SkPaint&) override;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
@@ -201,7 +200,7 @@
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 5720186..91236c6 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -330,13 +330,8 @@
void SkRecorder::onDrawVertices(VertexMode vmode,
int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xmode,
+ SkBlendMode bmode,
const uint16_t indices[], int indexCount, const SkPaint& paint) {
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode bmode = xmode;
-#endif
APPEND(DrawVertices, paint,
vmode,
vertexCount,
@@ -349,13 +344,8 @@
}
void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode bmode = xmode;
-#endif
APPEND(DrawPatch, paint,
cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : nullptr,
colors ? this->copy(colors, SkPatchUtils::kNumCorners) : nullptr,
@@ -364,7 +354,7 @@
}
void SkRecorder::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
- const SkColor colors[], int count, SK_XFERMODE_MODE_PARAM mode,
+ const SkColor colors[], int count, SkBlendMode mode,
const SkRect* cull, const SkPaint* paint) {
APPEND(DrawAtlas, this->copy(paint),
sk_ref_sp(atlas),
@@ -372,7 +362,7 @@
this->copy(tex, count),
this->copy(colors, count),
count,
- (SkBlendMode)mode,
+ mode,
this->copy(cull));
}
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h
index 7015167..0f157b5 100644
--- a/src/core/SkRecorder.h
+++ b/src/core/SkRecorder.h
@@ -99,7 +99,7 @@
SkScalar y,
const SkPaint& paint) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;
void onDrawPaint(const SkPaint&) override;
@@ -126,11 +126,11 @@
const SkPaint*) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
- int count, SK_XFERMODE_MODE_PARAM, const SkRect* cull, const SkPaint*) override;
+ int count, SkBlendMode, const SkRect* cull, const SkPaint*) override;
void onClipRect(const SkRect& rect, ClipOp, ClipEdgeStyle) override;
void onClipRRect(const SkRRect& rrect, ClipOp, ClipEdgeStyle) override;
diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp
index 51a3f77..9337198 100644
--- a/src/effects/SkLayerDrawLooper.cpp
+++ b/src/effects/SkLayerDrawLooper.cpp
@@ -15,7 +15,7 @@
SkLayerDrawLooper::LayerInfo::LayerInfo() {
fPaintBits = 0; // ignore our paint fields
- fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kDst; // ignore our color
+ fColorMode = SkBlendMode::kDst; // ignore our color
fOffset.set(0, 0);
fPostTranslate = false;
}
@@ -224,7 +224,7 @@
(void)buffer.readInt();
info.fPaintBits = buffer.readInt();
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)buffer.readInt();
+ info.fColorMode = (SkBlendMode)buffer.readInt();
buffer.readPoint(&info.fOffset);
info.fPostTranslate = buffer.readBool();
buffer.readPaint(builder.addLayerOnTop(info));
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a65d6e8..b8a520f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1564,7 +1564,7 @@
void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xmode,
+ SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
@@ -1644,15 +1644,9 @@
GrPaint grPaint;
if (texs && paint.getShader()) {
if (colors) {
- // When there are texs and colors the shader and colors are combined using xmode. A null
- // xmode is defined to mean modulate.
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode colorMode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode colorMode = xmode;
-#endif
+ // When there are texs and colors the shader and colors are combined using bmode.
if (!SkPaintToGrPaintWithXfermode(this->context(), fRenderTargetContext.get(), paint,
- *draw.fMatrix, colorMode, false, &grPaint)) {
+ *draw.fMatrix, bmode, false, &grPaint)) {
return;
}
} else {
@@ -1695,7 +1689,7 @@
void SkGpuDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkRSXform xform[],
const SkRect texRect[], const SkColor colors[], int count,
- SK_XFERMODE_MODE_PARAM mode, const SkPaint& paint) {
+ SkBlendMode mode, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
if (paint.isAntiAlias()) {
this->INHERITED::drawAtlas(draw, atlas, xform, texRect, colors, count, mode, paint);
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 77afda7..bed8d89 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -92,10 +92,10 @@
void drawTextBlob(const SkDraw&, const SkTextBlob*, SkScalar x, SkScalar y,
const SkPaint& paint, SkDrawFilter* drawFilter) override;
void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, const SkPoint verts[],
- const SkPoint texs[], const SkColor colors[], SK_XFERMODE_PARAM,
+ const SkPoint texs[], const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount, const SkPaint&) override;
void drawAtlas(const SkDraw&, const SkImage* atlas, const SkRSXform[], const SkRect[],
- const SkColor[], int count, SK_XFERMODE_MODE_PARAM, const SkPaint&) override;
+ const SkColor[], int count, SkBlendMode, const SkPaint&) override;
void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, const SkPaint&) override;
void drawImage(const SkDraw&, const SkImage*, SkScalar x, SkScalar y, const SkPaint&) override;
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index d2089ce..88bcc84 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1432,7 +1432,7 @@
void SkPDFDevice::drawVertices(const SkDraw& d, SkCanvas::VertexMode,
int vertexCount, const SkPoint verts[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xmode, const uint16_t indices[],
+ SkBlendMode, const uint16_t indices[],
int indexCount, const SkPaint& paint) {
if (d.fRC->isEmpty()) {
return;
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index 4bf4a58..d8e26c5 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -116,7 +116,7 @@
void drawVertices(const SkDraw&, SkCanvas::VertexMode,
int vertexCount, const SkPoint verts[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM, const uint16_t indices[],
+ SkBlendMode, const uint16_t indices[],
int indexCount, const SkPaint& paint) override;
void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
const SkPaint&) override;
diff --git a/src/pipe/SkPipeCanvas.cpp b/src/pipe/SkPipeCanvas.cpp
index e7b04ce..43235c3 100644
--- a/src/pipe/SkPipeCanvas.cpp
+++ b/src/pipe/SkPipeCanvas.cpp
@@ -352,7 +352,7 @@
}
void SkPipeCanvas::onDrawAtlas(const SkImage* image, const SkRSXform xform[], const SkRect rect[],
- const SkColor colors[], int count, SK_XFERMODE_MODE_PARAM mode,
+ const SkColor colors[], int count, SkBlendMode mode,
const SkRect* cull, const SkPaint* paint) {
unsigned extra = (unsigned)mode;
SkASSERT(0 == (extra & ~kMode_DrawAtlasMask));
@@ -732,7 +732,7 @@
void SkPipeCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
SkASSERT(vertexCount > 0);
@@ -742,12 +742,6 @@
extra |= vertexCount;
}
extra |= (unsigned)vmode << kVMode_DrawVerticesShift;
-
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode bmode = xmode;
-#endif
extra |= (unsigned)bmode << kXMode_DrawVerticesShift;
if (texs) {
@@ -781,15 +775,10 @@
}
void SkPipeCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
SkPipeWriter writer(this);
unsigned extra = 0;
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode bmode = xmode;
-#endif
SkASSERT(0 == ((int)bmode & ~kModeEnum_DrawPatchExtraMask));
extra = (unsigned)bmode;
if (colors) {
diff --git a/src/pipe/SkPipeCanvas.h b/src/pipe/SkPipeCanvas.h
index 87a906f..508c2a1 100644
--- a/src/pipe/SkPipeCanvas.h
+++ b/src/pipe/SkPipeCanvas.h
@@ -105,7 +105,7 @@
void onDrawArc(const SkRect&, SkScalar startAngle, SkScalar sweepAngle, bool useCenter,
const SkPaint&) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
- int count, SK_XFERMODE_MODE_PARAM, const SkRect* cull, const SkPaint*) override;
+ int count, SkBlendMode, const SkRect* cull, const SkPaint*) override;
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
const SkPaint&) override;
@@ -119,7 +119,7 @@
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4],
- SK_XFERMODE_PARAM, const SkPaint&) override;
+ SkBlendMode, const SkPaint&) override;
void onDrawPaint(const SkPaint&) override;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
@@ -138,7 +138,7 @@
const SkPaint*) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
diff --git a/src/svg/SkSVGDevice.cpp b/src/svg/SkSVGDevice.cpp
index 4496c0a..203be3a 100644
--- a/src/svg/SkSVGDevice.cpp
+++ b/src/svg/SkSVGDevice.cpp
@@ -799,7 +799,7 @@
void SkSVGDevice::drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
// todo
diff --git a/src/svg/SkSVGDevice.h b/src/svg/SkSVGDevice.h
index ccd18c4..5de7735 100644
--- a/src/svg/SkSVGDevice.h
+++ b/src/svg/SkSVGDevice.h
@@ -47,7 +47,7 @@
const SkPaint& paint) override;
void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) override;
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 6a6af0f..19cfc97 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -513,27 +513,27 @@
void SkDeferredCanvas::onDrawAtlas(const SkImage* image, const SkRSXform xform[],
const SkRect rects[], const SkColor colors[],
- int count, SK_XFERMODE_MODE_PARAM mode,
+ int count, SkBlendMode bmode,
const SkRect* cull, const SkPaint* paint) {
this->flush_before_saves();
- fCanvas->drawAtlas(image, xform, rects, colors, count, mode, cull, paint);
+ fCanvas->drawAtlas(image, xform, rects, colors, count, bmode, cull, paint);
}
void SkDeferredCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
this->flush_before_saves();
- fCanvas->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
+ fCanvas->drawVertices(vmode, vertexCount, vertices, texs, colors, bmode,
indices, indexCount, paint);
}
void SkDeferredCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
this->flush_before_saves();
- fCanvas->drawPatch(cubics, colors, texCoords, xmode, paint);
+ fCanvas->drawPatch(cubics, colors, texCoords, bmode, paint);
}
void SkDeferredCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* data) {
diff --git a/src/utils/SkDeferredCanvas.h b/src/utils/SkDeferredCanvas.h
index b48b9b6..38ee0cb 100644
--- a/src/utils/SkDeferredCanvas.h
+++ b/src/utils/SkDeferredCanvas.h
@@ -57,7 +57,7 @@
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;
void onDrawPaint(const SkPaint&) override;
@@ -87,13 +87,12 @@
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
void onDrawAtlas(const SkImage* image, const SkRSXform xform[],
const SkRect rects[], const SkColor colors[],
- int count, SK_XFERMODE_MODE_PARAM mode,
- const SkRect* cull, const SkPaint* paint) override;
+ int count, SkBlendMode, const SkRect* cull, const SkPaint* paint) override;
void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index 8b71975..efaca33 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -468,7 +468,7 @@
void SkDumpCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)",
@@ -477,7 +477,7 @@
}
void SkDumpCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) {
//dumps corner points and colors in clockwise order starting on upper-left corner
this->dump(kDrawPatch_Verb, &paint, "drawPatch(Vertices{[%f, %f], [%f, %f], [%f, %f], [%f, %f]}\
diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp
index 10fc3b4..3949df5 100644
--- a/src/utils/SkLuaCanvas.cpp
+++ b/src/utils/SkLuaCanvas.cpp
@@ -309,7 +309,7 @@
void SkLuaCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
AUTO_LUA("drawVertices");
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index aa9f767..b2d71d2 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -288,22 +288,22 @@
void SkNWayCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
- iter->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
+ iter->drawVertices(vmode, vertexCount, vertices, texs, colors, bmode,
indices, indexCount, paint);
}
}
void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
- iter->drawPatch(cubics, colors, texCoords, xmode, paint);
+ iter->drawPatch(cubics, colors, texCoords, bmode, paint);
}
}
diff --git a/src/utils/SkPaintFilterCanvas.cpp b/src/utils/SkPaintFilterCanvas.cpp
index d3cc4c7..7bf8a5f 100644
--- a/src/utils/SkPaintFilterCanvas.cpp
+++ b/src/utils/SkPaintFilterCanvas.cpp
@@ -151,22 +151,22 @@
void SkPaintFilterCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM xmode,
+ const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
AutoPaintFilter apf(this, kVertices_Type, paint);
if (apf.shouldDraw()) {
- this->INHERITED::onDrawVertices(vmode, vertexCount, vertices, texs, colors, xmode, indices,
+ this->INHERITED::onDrawVertices(vmode, vertexCount, vertices, texs, colors, bmode, indices,
indexCount, *apf.paint());
}
}
void SkPaintFilterCanvas::onDrawPatch(const SkPoint cubics[], const SkColor colors[],
- const SkPoint texCoords[], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[], SkBlendMode bmode,
const SkPaint& paint) {
AutoPaintFilter apf(this, kPatch_Type, paint);
if (apf.shouldDraw()) {
- this->INHERITED::onDrawPatch(cubics, colors, texCoords, xmode, *apf.paint());
+ this->INHERITED::onDrawPatch(cubics, colors, texCoords, bmode, *apf.paint());
}
}
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
index 07dcd45..22c7b24 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -1181,7 +1181,7 @@
void SkXPSDevice::drawVertices(const SkDraw&, SkCanvas::VertexMode,
int vertexCount, const SkPoint verts[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xmode, const uint16_t indices[],
+ SkBlendMode, const uint16_t indices[],
int indexCount, const SkPaint& paint) {
//TODO: override this for XPS
SkDEBUGF(("XPS drawVertices not yet implemented."));
diff --git a/src/xps/SkXPSDevice.h b/src/xps/SkXPSDevice.h
index 1f66186..bbb0716 100644
--- a/src/xps/SkXPSDevice.h
+++ b/src/xps/SkXPSDevice.h
@@ -127,7 +127,7 @@
SkCanvas::VertexMode,
int vertexCount, const SkPoint verts[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xmode,
+ SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) override;
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index 4e9a246..4ecc934 100644
--- a/tests/BlurTest.cpp
+++ b/tests/BlurTest.cpp
@@ -454,7 +454,7 @@
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = 0;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kDst;
+ info.fColorMode = SkBlendMode::kDst;
builder->addLayer(info);
}
@@ -462,7 +462,7 @@
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = SkLayerDrawLooper::kMaskFilter_Bit;
- info.fColorMode = (SK_XFERMODE_MODE_PARAM)SkBlendMode::kSrc;
+ info.fColorMode = SkBlendMode::kSrc;
SkPaint* paint = builder->addLayer(info);
paint->setMaskFilter(std::move(mf));
}
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 5d4ef86..ec34a15 100644
--- a/tests/ColorFilterTest.cpp
+++ b/tests/ColorFilterTest.cpp
@@ -79,7 +79,7 @@
// SkDebugf("--- mc [%d %x] ", mode, color);
- REPORTER_ASSERT(reporter, cf->asColorMode(&c, (SK_XFERMODE_MODE_PARAM*)&m));
+ REPORTER_ASSERT(reporter, cf->asColorMode(&c, (SkBlendMode*)&m));
// handle special-case folding by the factory
if (SkBlendMode::kClear == (SkBlendMode)mode) {
if (c != expectedColor) {
@@ -101,7 +101,7 @@
SkColor c2 = ~color;
SkBlendMode m2 = ILLEGAL_MODE;
- REPORTER_ASSERT(reporter, cf2->asColorMode(&c2, (SK_XFERMODE_MODE_PARAM*)&m2));
+ REPORTER_ASSERT(reporter, cf2->asColorMode(&c2, (SkBlendMode*)&m2));
REPORTER_ASSERT(reporter, c2 == expectedColor);
REPORTER_ASSERT(reporter, m2 == expectedMode);
}
diff --git a/tools/android/SkAndroidSDKCanvas.cpp b/tools/android/SkAndroidSDKCanvas.cpp
index 887d416..85a3e98 100644
--- a/tools/android/SkAndroidSDKCanvas.cpp
+++ b/tools/android/SkAndroidSDKCanvas.cpp
@@ -64,7 +64,7 @@
SkColorFilter* cf = paint->getColorFilter();
if (cf) {
SkColor color;
- SK_XFERMODE_MODE_PARAM mode;
+ SkBlendMode mode;
SkScalar srcColorMatrix[20];
bool isMode = cf->asColorMode(&color, &mode);
if (isMode && (int)mode > (int)SkBlendMode::kLighten) {
@@ -165,12 +165,12 @@
void SkAndroidSDKCanvas::onDrawVertices(VertexMode vMode,
int vertexCount,
const SkPoint vertices[],
- const SkPoint texs[], const SkColor colors[], SK_XFERMODE_PARAM xMode,
+ const SkPoint texs[], const SkColor colors[], SkBlendMode bmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
FILTER(paint);
fProxyTarget->drawVertices(vMode, vertexCount, vertices, texs, colors,
- xMode, indices, indexCount, filteredPaint);
+ bmode, indices, indexCount, filteredPaint);
}
void SkAndroidSDKCanvas::onDrawDRRect(const SkRRect& outer,
@@ -228,10 +228,10 @@
void SkAndroidSDKCanvas::onDrawPatch(const SkPoint cubics[12],
const SkColor colors[4],
const SkPoint texCoords[4],
- SK_XFERMODE_PARAM xmode,
+ SkBlendMode bmode,
const SkPaint& paint) {
FILTER(paint);
- fProxyTarget->drawPatch(cubics, colors, texCoords, xmode, filteredPaint);
+ fProxyTarget->drawPatch(cubics, colors, texCoords, bmode, filteredPaint);
}
@@ -264,12 +264,11 @@
const SkRect tex[],
const SkColor colors[],
int count,
- SK_XFERMODE_MODE_PARAM mode,
+ SkBlendMode mode,
const SkRect* cullRect,
const SkPaint* paint) {
FILTER_PTR(paint);
- fProxyTarget->drawAtlas(atlas, xform, tex, colors, count, mode, cullRect,
- filteredPaint);
+ fProxyTarget->drawAtlas(atlas, xform, tex, colors, count, mode, cullRect, filteredPaint);
}
void SkAndroidSDKCanvas::onDrawImageNine(const SkImage* image,
diff --git a/tools/android/SkAndroidSDKCanvas.h b/tools/android/SkAndroidSDKCanvas.h
index de22dbd..ca92ea4 100644
--- a/tools/android/SkAndroidSDKCanvas.h
+++ b/tools/android/SkAndroidSDKCanvas.h
@@ -49,7 +49,7 @@
void onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) override;
void onDrawVertices(VertexMode vMode, int vertexCount, const SkPoint vertices[],
- const SkPoint texs[], const SkColor colors[], SK_XFERMODE_PARAM xMode,
+ const SkPoint texs[], const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) override;
@@ -70,7 +70,7 @@
const SkPaint& paint) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;
void onDrawImage(const SkImage*, SkScalar, SkScalar, const SkPaint*) override;
@@ -78,7 +78,7 @@
SrcRectConstraint) override;
void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[],
- const SkColor[], int count, SK_XFERMODE_MODE_PARAM,
+ const SkColor[], int count, SkBlendMode,
const SkRect* cull, const SkPaint*) override;
void onDrawImageNine(const SkImage*, const SkIRect& center,
const SkRect& dst, const SkPaint*) override;
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index 8bdaca1..bc699fc 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -654,25 +654,15 @@
}
void SkDebugCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM xmode,
+ const SkPoint texCoords[4], SkBlendMode bmode,
const SkPaint& paint) {
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode bmode = xmode;
-#endif
this->addDrawCommand(new SkDrawPatchCommand(cubics, colors, texCoords, bmode, paint));
}
void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
- SK_XFERMODE_PARAM xmode, const uint16_t indices[], int indexCount,
+ SkBlendMode bmode, const uint16_t indices[], int indexCount,
const SkPaint& paint) {
-#ifdef SK_SUPPORT_LEGACY_XFERMODE_PARAM
- SkBlendMode bmode = xmode ? xmode->blend() : SkBlendMode::kModulate;
-#else
- SkBlendMode bmode = xmode;
-#endif
this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices,
texs, colors, bmode, indices, indexCount, paint));
}
diff --git a/tools/debugger/SkDebugCanvas.h b/tools/debugger/SkDebugCanvas.h
index b7d7f79..6e7086e 100644
--- a/tools/debugger/SkDebugCanvas.h
+++ b/tools/debugger/SkDebugCanvas.h
@@ -226,7 +226,7 @@
const SkPaint& paint) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SK_XFERMODE_PARAM, const SkPaint& paint) override;
+ const SkPoint texCoords[4], SkBlendMode, const SkPaint& paint) override;
void onDrawPaint(const SkPaint&) override;
void onDrawRect(const SkRect&, const SkPaint&) override;
@@ -236,7 +236,7 @@
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
- const SkColor colors[], SK_XFERMODE_PARAM,
+ const SkColor colors[], SkBlendMode,
const uint16_t indices[], int indexCount,
const SkPaint&) override;
void onDrawPath(const SkPath&, const SkPaint&) override;