Add SkTileImageFilter sample to filterfastbounds GM.
authorsenorblanco <senorblanco@chromium.org>
Mon, 7 Dec 2015 18:36:30 +0000 (10:36 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 7 Dec 2015 18:36:30 +0000 (10:36 -0800)
NOTE: will affect pixel results for filterfastbounds GM.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1500373004

gm/filterfastbounds.cpp

index d484c4211ce8030fefa846a85dbb5071acc00c1c..453dded8cc3e0d3328121d42bf58e2a5283ea4e1 100644 (file)
@@ -14,6 +14,7 @@
 #include "SkPictureRecorder.h"
 #include "SkRandom.h"
 #include "SkSurface.h"
+#include "SkTileImageFilter.h"
 
 namespace skiagm {
 
@@ -109,6 +110,15 @@ static void create_paints(SkImageFilter* source, SkTArray<SkPaint>* paints) {
         add_paint(rotMIF, paints);
     }
 
+    {
+        SkRect src = SkRect::MakeXYWH(20, 20, 10, 10);
+        SkRect dst = SkRect::MakeXYWH(30, 30, 30, 30);
+        SkAutoTUnref<SkImageFilter> tileIF(
+            SkTileImageFilter::Create(src, dst, nullptr));
+
+        add_paint(tileIF, paints);
+    }
+
     {
         static const SkDropShadowImageFilter::ShadowMode kBoth =
                     SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode;
@@ -157,7 +167,7 @@ public:
 protected:
     static const int kTileWidth = 100;
     static const int kTileHeight = 100;
-    static const int kNumVertTiles = 6;
+    static const int kNumVertTiles = 7;
     static const int kNumXtraCols = 2;
 
     SkString onShortName() override{ return SkString("filterfastbounds"); }