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

Unified Diff: gm/tileimagefilter.cpp

Issue 1853803003: Fix padding bug in SkTileImageFilter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix overlength lines. Created 4 years, 9 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/SkTileImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tileimagefilter.cpp
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp
index f75e7f97221553f2cd31b6cab14a46d0fd14d201..e067d3ee04a1d66ab70e921318c4e3b6008dc17f 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -14,7 +14,7 @@
#include "gm.h"
#define WIDTH 400
-#define HEIGHT 100
+#define HEIGHT 200
#define MARGIN 12
namespace skiagm {
@@ -107,6 +107,20 @@ protected:
canvas->drawRect(srcRect, red);
canvas->drawRect(dstRect, blue);
canvas->restore();
+
+ canvas->translate(0, SkIntToScalar(100));
+
+ srcRect = SkRect::MakeXYWH(0, 0, 50, 50);
+ dstRect = SkRect::MakeXYWH(0, 0, 100, 100);
+ SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(5, 5, 40, 40));
+ sk_sp<SkColorFilter> greenCF = SkColorFilter::MakeModeFilter(SK_ColorGREEN,
+ SkXfermode::kSrc_Mode);
+ SkAutoTUnref<SkImageFilter> green(SkColorFilterImageFilter::Create(greenCF.get(), nullptr,
+ &cropRect));
+ tile.reset(SkTileImageFilter::Create(srcRect, dstRect, green));
+ paint.setColor(SK_ColorRED);
+ paint.setImageFilter(tile);
+ canvas->drawRect(dstRect, paint);
}
private:
sk_sp<SkImage> fBitmap, fCheckerboard;
« no previous file with comments | « no previous file | src/effects/SkTileImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698