Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: gm/xfermodes.cpp

Issue 789033002: Remove SkCanvas::drawBitmapMatrix() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: non-const canvas ptr Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/filterindiabox.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes.cpp
diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp
index 721a76e69544e6f53f709e853f151ac236e697fc..d881ae1e6d48012f37813eb4e5ff714c36e10640 100644
--- a/gm/xfermodes.cpp
+++ b/gm/xfermodes.cpp
@@ -84,13 +84,17 @@ class XfermodesGM : public GM {
bool restoreNeeded = false;
m.setTranslate(x, y);
- canvas->drawBitmapMatrix(fSrcB, m, &p);
+ canvas->drawBitmap(fSrcB, x, y, &p);
p.setXfermode(mode);
switch (srcType) {
- case kSmallTransparentImage_SrcType:
+ case kSmallTransparentImage_SrcType: {
m.postScale(SK_ScalarHalf, SK_ScalarHalf, x, y);
- canvas->drawBitmapMatrix(fTransparent, m, &p);
+
+ SkAutoCanvasRestore acr(canvas, true);
+ canvas->concat(m);
+ canvas->drawBitmap(fTransparent, 0, 0, &p);
break;
+ }
case kQuarterClearInLayer_SrcType: {
SkRect bounds = SkRect::MakeXYWH(x, y, SkIntToScalar(W),
SkIntToScalar(H));
@@ -135,9 +139,12 @@ class XfermodesGM : public GM {
case kRectangleImageWithAlpha_SrcType:
p.setAlpha(0x88);
// Fall through.
- case kRectangleImage_SrcType:
- canvas->drawBitmapMatrix(fDstB, m, &p);
+ case kRectangleImage_SrcType: {
+ SkAutoCanvasRestore acr(canvas, true);
+ canvas->concat(m);
+ canvas->drawBitmap(fDstB, 0, 0, &p);
break;
+ }
default:
break;
}
« no previous file with comments | « gm/filterindiabox.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698