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 |