Index: gm/xfermodes.cpp |
diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp |
index c1095747adb042ae1f4d0f291894ecfe608fcdd4..fdaeec7e65ba27b3654d92c0a879de19205f0327 100644 |
--- a/gm/xfermodes.cpp |
+++ b/gm/xfermodes.cpp |
@@ -291,90 +291,3 @@ private: |
typedef GM INHERITED; |
}; |
DEF_GM( return new XfermodesGM; ) |
- |
-/////////////////////////////////////////////////////////////////////////////////////////////////// |
- |
-void draw_mode(const SkBitmap& srcB, const SkBitmap& dstB, |
- SkCanvas* canvas, SkXfermode* mode, SkScalar x, SkScalar y, float src_alpha) { |
- canvas->saveLayer(SkRect::MakeXYWH(x, y, 64, 64), nullptr); |
- canvas->drawBitmap(srcB, x, y, nullptr); |
- |
- SkPaint paint; |
- paint.setXfermode(mode); |
- canvas->drawBitmap(dstB, x, y, &paint); |
- |
- canvas->restore(); |
-} |
- |
-DEF_SIMPLE_GM(xfermodes_proc4f, canvas, 1000, 1000) { |
- SkBitmap bg, srcB, dstB, transparent; |
- |
- bg.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, kOpaque_SkAlphaType), |
- gData, 4); |
- make_bitmaps(64, 64, &dstB, &srcB, &transparent); |
- |
- canvas->translate(10, 20); |
- |
- const SkScalar w = 64; |
- const SkScalar h = 64; |
- SkMatrix m = SkMatrix::MakeScale(6, 6); |
- SkShader* s = SkShader::CreateBitmapShader(bg, |
- SkShader::kRepeat_TileMode, |
- SkShader::kRepeat_TileMode, |
- &m); |
- |
- SkPaint labelP; |
- labelP.setAntiAlias(true); |
- sk_tool_utils::set_portable_typeface(&labelP); |
- labelP.setTextAlign(SkPaint::kCenter_Align); |
- |
- const int W = 5; |
- |
- const float alphas[] = { 1.0f, 0.5f }; |
- |
- for (auto alpha : alphas) { |
- SkScalar x0 = 0; |
- SkScalar y0 = 0; |
- SkScalar x = x0, y = y0; |
- for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) { |
- SkXfermode* mode = SkXfermode::Create(gModes[i].fMode); |
- SkAutoUnref aur(mode); |
- SkRect r; |
- r.set(x, y, x+w, y+h); |
- |
- SkPaint p; |
- p.setStyle(SkPaint::kFill_Style); |
- p.setShader(s); |
- canvas->drawRect(r, p); |
- |
- draw_mode(srcB, dstB, canvas, mode, r.fLeft, r.fTop, alpha); |
- |
- r.inset(-SK_ScalarHalf, -SK_ScalarHalf); |
- p.setStyle(SkPaint::kStroke_Style); |
- p.setShader(nullptr); |
- canvas->drawRect(r, p); |
- |
- #if 1 |
- canvas->drawText(gModes[i].fLabel, strlen(gModes[i].fLabel), |
- x + w/2, y - labelP.getTextSize()/2, labelP); |
- #endif |
- x += w + SkIntToScalar(10); |
- if ((i % W) == W - 1) { |
- x = x0; |
- y += h + SkIntToScalar(30); |
- } |
- } |
- if (y < 320) { |
- if (x > x0) { |
- y += h + SkIntToScalar(30); |
- } |
- y0 = y; |
- } else { |
- x0 += SkIntToScalar(400); |
- y0 = 0; |
- } |
- |
- canvas->translate(400, 0); |
- } |
- s->unref(); |
-} |