aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-10-28 15:42:34 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-28 20:06:17 +0000
commit7d954ad797176afedb9262fdea4507d0fc60eb9d (patch)
tree27c6dc324f83877371d91a58beb21e4b00176a94 /samplecode
parent99e3f7d6fcb7b3b4340286455733a7de9eb4ef81 (diff)
remove xfermode from public api
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4020 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac Reviewed-on: https://skia-review.googlesource.com/4020 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/PerlinPatch.cpp6
-rw-r--r--samplecode/SampleAll.cpp2
-rw-r--r--samplecode/SampleAtlas.cpp2
-rw-r--r--samplecode/SampleColorFilter.cpp30
-rw-r--r--samplecode/SampleFilterFuzz.cpp2
-rw-r--r--samplecode/SamplePatch.cpp3
-rw-r--r--samplecode/SampleShaders.cpp5
-rw-r--r--samplecode/SampleShip.cpp2
-rw-r--r--samplecode/SampleSlides.cpp6
-rw-r--r--samplecode/SampleVertices.cpp6
10 files changed, 30 insertions, 34 deletions
diff --git a/samplecode/PerlinPatch.cpp b/samplecode/PerlinPatch.cpp
index a2033c35ff..9adb08afea 100644
--- a/samplecode/PerlinPatch.cpp
+++ b/samplecode/PerlinPatch.cpp
@@ -148,12 +148,10 @@ protected:
{ fTexX - texWidth, fTexY + texHeight}}
;
- sk_sp<SkXfermode> xfer(SkXfermode::Make(SkXfermode::kSrc_Mode));
-
SkScalar scaleFreq = 2.0;
fShader1 = SkPerlinNoiseShader2::MakeImprovedNoise(fXFreq/scaleFreq, fYFreq/scaleFreq, 4,
fSeed);
- fShaderCompose = SkShader::MakeComposeShader(fShader0, fShader1, nullptr);
+ fShaderCompose = SkShader::MakeComposeShader(fShader0, fShader1, SkBlendMode::kSrcOver);
paint.setShader(fShaderCompose);
@@ -161,7 +159,7 @@ protected:
if (fShowGrid) {
tex = nullptr;
}
- canvas->drawPatch(fPts, nullptr, tex, xfer, paint);
+ canvas->drawPatch(fPts, nullptr, tex, SkBlendMode::kSrc, paint);
draw_control_points(canvas, fPts);
}
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 8c1ace564a..94c12cd727 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -504,7 +504,7 @@ protected:
auto shaderB = SkGradientShader::MakeLinear(pts, colors2, nullptr,
2, SkShader::kClamp_TileMode);
return SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB),
- SkXfermode::Make(SkXfermode::kDstIn_Mode));
+ SkBlendMode::kDstIn);
}
virtual void startTest() {
diff --git a/samplecode/SampleAtlas.cpp b/samplecode/SampleAtlas.cpp
index 3daf312f6a..f89b37da75 100644
--- a/samplecode/SampleAtlas.cpp
+++ b/samplecode/SampleAtlas.cpp
@@ -21,7 +21,7 @@ typedef void (*DrawAtlasProc)(SkCanvas*, SkImage*, const SkRSXform[], const SkRe
static void draw_atlas(SkCanvas* canvas, SkImage* atlas, const SkRSXform xform[],
const SkRect tex[], const SkColor colors[], int count, const SkRect* cull,
const SkPaint* paint) {
- canvas->drawAtlas(atlas, xform, tex, colors, count, SkXfermode::kModulate_Mode, cull, paint);
+ canvas->drawAtlas(atlas, xform, tex, colors, count, SkBlendMode::kModulate, cull, paint);
}
static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xform[],
diff --git a/samplecode/SampleColorFilter.cpp b/samplecode/SampleColorFilter.cpp
index 67c7b2e13d..60ab0134ef 100644
--- a/samplecode/SampleColorFilter.cpp
+++ b/samplecode/SampleColorFilter.cpp
@@ -151,21 +151,21 @@ protected:
return;
}
- static const SkXfermode::Mode gModes[] = {
- SkXfermode::kClear_Mode,
- SkXfermode::kSrc_Mode,
- SkXfermode::kDst_Mode,
- SkXfermode::kSrcOver_Mode,
- SkXfermode::kDstOver_Mode,
- SkXfermode::kSrcIn_Mode,
- SkXfermode::kDstIn_Mode,
- SkXfermode::kSrcOut_Mode,
- SkXfermode::kDstOut_Mode,
- SkXfermode::kSrcATop_Mode,
- SkXfermode::kDstATop_Mode,
- SkXfermode::kXor_Mode,
- SkXfermode::kPlus_Mode,
- SkXfermode::kModulate_Mode,
+ static const SkBlendMode gModes[] = {
+ SkBlendMode::kClear,
+ SkBlendMode::kSrc,
+ SkBlendMode::kDst,
+ SkBlendMode::kSrcOver,
+ SkBlendMode::kDstOver,
+ SkBlendMode::kSrcIn,
+ SkBlendMode::kDstIn,
+ SkBlendMode::kSrcOut,
+ SkBlendMode::kDstOut,
+ SkBlendMode::kSrcATop,
+ SkBlendMode::kDstATop,
+ SkBlendMode::kXor,
+ SkBlendMode::kPlus,
+ SkBlendMode::kModulate,
};
static const SkColor gColors[] = {
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index 28aa5f4caf..139166fe2d 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -558,7 +558,7 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
case MERGE:
filter = SkMergeImageFilter::Make(make_image_filter(),
make_image_filter(),
- (SkXfermode::Mode)make_xfermode());
+ make_xfermode());
break;
case COLOR: {
sk_sp<SkColorFilter> cf(make_color_filter());
diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp
index 641e1e98f3..243d106784 100644
--- a/samplecode/SamplePatch.cpp
+++ b/samplecode/SamplePatch.cpp
@@ -188,8 +188,7 @@ void Patch::draw(SkCanvas* canvas, const SkPaint& paint, int nu, int nv,
t += dt;
canvas->drawVertices(SkCanvas::kTriangleStrip_VertexMode, stripCount,
strip, doTextures ? tex : nullptr,
- doColors ? colors : nullptr, nullptr,
- nullptr, 0, paint);
+ doColors ? colors : nullptr, nullptr, 0, paint);
}
}
diff --git a/samplecode/SampleShaders.cpp b/samplecode/SampleShaders.cpp
index 608199da44..ba3b80d7f8 100644
--- a/samplecode/SampleShaders.cpp
+++ b/samplecode/SampleShaders.cpp
@@ -34,8 +34,7 @@ static sk_sp<SkShader> make_bitmapfade(const SkBitmap& bm) {
auto shaderB = SkShader::MakeBitmapShader(bm,
SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
- return SkShader::MakeComposeShader(std::move(shaderB), std::move(shaderA),
- SkXfermode::Make(SkXfermode::kDstIn_Mode));
+ return SkShader::MakeComposeShader(std::move(shaderB), std::move(shaderA), SkBlendMode::kDstIn);
}
class ShaderView : public SampleView {
@@ -62,7 +61,7 @@ public:
auto shaderB = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
fShader = SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB),
- SkXfermode::Make(SkXfermode::kDstIn_Mode));
+ SkBlendMode::kDstIn);
}
protected:
diff --git a/samplecode/SampleShip.cpp b/samplecode/SampleShip.cpp
index 1335c31076..9d65b6f690 100644
--- a/samplecode/SampleShip.cpp
+++ b/samplecode/SampleShip.cpp
@@ -26,7 +26,7 @@ const SkColor[], int, const SkRect*, const SkPaint*);
static void draw_atlas(SkCanvas* canvas, SkImage* atlas, const SkRSXform xform[],
const SkRect tex[], const SkColor colors[], int count, const SkRect* cull,
const SkPaint* paint) {
- canvas->drawAtlas(atlas, xform, tex, colors, count, SkXfermode::kModulate_Mode, cull, paint);
+ canvas->drawAtlas(atlas, xform, tex, colors, count, SkBlendMode::kModulate, cull, paint);
}
static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xform[],
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp
index 521e9f6ead..43221d41a7 100644
--- a/samplecode/SampleSlides.cpp
+++ b/samplecode/SampleSlides.cpp
@@ -436,21 +436,21 @@ static void mesh_slide(SkCanvas* canvas) {
paint.setShader(nullptr);
canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount,
fRecs[i].fVerts, fRecs[i].fTexs,
- nullptr, nullptr, nullptr, 0, paint);
+ nullptr, nullptr, 0, paint);
canvas->translate(SkIntToScalar(210), 0);
paint.setShader(fShader0);
canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount,
fRecs[i].fVerts, fRecs[i].fTexs,
- nullptr, nullptr, nullptr, 0, paint);
+ nullptr, nullptr, 0, paint);
canvas->translate(SkIntToScalar(210), 0);
paint.setShader(fShader1);
canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount,
fRecs[i].fVerts, fRecs[i].fTexs,
- nullptr, nullptr, nullptr, 0, paint);
+ nullptr, nullptr, 0, paint);
canvas->restore();
canvas->translate(0, SkIntToScalar(250));
diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp
index 0d43962986..3ba98bb919 100644
--- a/samplecode/SampleVertices.cpp
+++ b/samplecode/SampleVertices.cpp
@@ -90,21 +90,21 @@ protected:
paint.setShader(nullptr);
canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount,
fRecs[i].fVerts, fRecs[i].fTexs,
- nullptr, nullptr, nullptr, 0, paint);
+ nullptr, nullptr, 0, paint);
canvas->translate(SkIntToScalar(250), 0);
paint.setShader(fShader0);
canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount,
fRecs[i].fVerts, fRecs[i].fTexs,
- nullptr, nullptr, nullptr, 0, paint);
+ nullptr, nullptr, 0, paint);
canvas->translate(SkIntToScalar(250), 0);
paint.setShader(fShader1);
canvas->drawVertices(fRecs[i].fMode, fRecs[i].fCount,
fRecs[i].fVerts, fRecs[i].fTexs,
- nullptr, nullptr, nullptr, 0, paint);
+ nullptr, nullptr, 0, paint);
canvas->restore();
canvas->translate(0, SkIntToScalar(250));