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

Unified Diff: gm/filterfastbounds.cpp

Issue 1500373004: Add SkTileImageFilter sample to filterfastbounds GM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/filterfastbounds.cpp
diff --git a/gm/filterfastbounds.cpp b/gm/filterfastbounds.cpp
index d484c4211ce8030fefa846a85dbb5071acc00c1c..453dded8cc3e0d3328121d42bf58e2a5283ea4e1 100644
--- a/gm/filterfastbounds.cpp
+++ b/gm/filterfastbounds.cpp
@@ -14,6 +14,7 @@
#include "SkPictureRecorder.h"
#include "SkRandom.h"
#include "SkSurface.h"
+#include "SkTileImageFilter.h"
namespace skiagm {
@@ -110,6 +111,15 @@ static void create_paints(SkImageFilter* source, SkTArray<SkPaint>* 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"); }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698