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

Unified Diff: gm/xfermodeimagefilter.cpp

Issue 1588633002: Fix SkXfermodeImageFilter GPU fast path for differing sizes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix formatting Created 4 years, 11 months 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 | « no previous file | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodeimagefilter.cpp
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp
index bb86ceffa80a13e79341151e6b9b56ee0615c261..85bbf44765f080eb1cb97b2e2baacef7707f1215 100644
--- a/gm/xfermodeimagefilter.cpp
+++ b/gm/xfermodeimagefilter.cpp
@@ -14,7 +14,7 @@
#include "SkXfermodeImageFilter.h"
#define WIDTH 600
-#define HEIGHT 600
+#define HEIGHT 700
#define MARGIN 12
namespace skiagm {
@@ -169,6 +169,28 @@ protected:
y += fBitmap.height() + MARGIN;
}
}
+ // Test small bg, large fg with Screen (uses shader blend)
+ mode.reset(SkXfermode::Create(SkXfermode::kScreen_Mode));
+ SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(10, 10, 60, 60));
+ SkAutoTUnref<SkImageFilter> cropped(
+ SkOffsetImageFilter::Create(0, 0, foreground, &cropRect));
+ filter.reset(SkXfermodeImageFilter::Create(mode, cropped, background));
+ paint.setImageFilter(filter);
+ DrawClippedPaint(canvas, clipRect, paint, x, y);
+ x += fBitmap.width() + MARGIN;
+ if (x + fBitmap.width() > WIDTH) {
+ x = 0;
+ y += fBitmap.height() + MARGIN;
+ }
+ // Test small fg, large bg with Screen (uses shader blend)
+ filter.reset(SkXfermodeImageFilter::Create(mode, background, cropped));
+ paint.setImageFilter(filter);
+ DrawClippedPaint(canvas, clipRect, paint, x, y);
+ x += fBitmap.width() + MARGIN;
+ if (x + fBitmap.width() > WIDTH) {
+ x = 0;
+ y += fBitmap.height() + MARGIN;
+ }
}
private:
« no previous file with comments | « no previous file | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698