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

Unified Diff: gm/spritebitmap.cpp

Issue 1401053003: change SkImage_Gpu to handle all filters (w/ and w/o gpu support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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/image/SkImage_Gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/spritebitmap.cpp
diff --git a/gm/spritebitmap.cpp b/gm/spritebitmap.cpp
index 5cf0ece2417f375183d5a227cd99e130eec29c24..6aac09fbce76d0e2e0ab4677349bf181fee7f846 100644
--- a/gm/spritebitmap.cpp
+++ b/gm/spritebitmap.cpp
@@ -141,6 +141,11 @@ typedef SkImageFilter* (*ImageFilterFactory)();
// hence this cast function
template <typename T> ImageFilterFactory IFCCast(T arg) { return arg; }
+// We expect that applying the filter will keep us in the same domain (raster or gpu)
+static void check_same_domain(SkImage* a, SkImage* b) {
+ SkASSERT(a->isTextureBacked() == b->isTextureBacked());
+}
+
/**
* Compare output of drawSprite and drawBitmap (esp. clipping and imagefilters)
*/
@@ -180,6 +185,9 @@ protected:
SkAutoTUnref<SkImage> image1(image0->applyFilter(filter, &offset1, true));
SkAutoTUnref<SkImage> image2(image0->applyFilter(filter, &offset2, false));
+ check_same_domain(image0, image1);
+ check_same_domain(image0, image2);
+
canvas->save();
canvas->translate(30, 30);
show_image(canvas, image0, SkIPoint::Make(0, 0)); // original
« no previous file with comments | « no previous file | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698