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

Unified Diff: gm/ninepatchstretch.cpp

Issue 1454933002: Initial implementation of GPU no filter NinePatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 1 month 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 | gyp/gpu.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/ninepatchstretch.cpp
diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp
index 4074add1bbec475e2070a4aad1b16973e67f49a5..218b4528626e683716e577354ecba28311bfd532 100644
--- a/gm/ninepatchstretch.cpp
+++ b/gm/ninepatchstretch.cpp
@@ -66,7 +66,7 @@ protected:
}
SkISize onISize() override {
- return SkISize::Make(760, 400);
+ return SkISize::Make(760, 800);
}
void onDraw(SkCanvas* canvas) override {
@@ -91,16 +91,17 @@ protected:
SkScalar y = SkIntToScalar(100);
SkPaint paint;
- paint.setFilterQuality(kLow_SkFilterQuality);
-
- for (int iy = 0; iy < 2; ++iy) {
- for (int ix = 0; ix < 2; ++ix) {
- int i = ix * 2 + iy;
- SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed,
- size[i].width(), size[i].height());
- canvas->drawBitmapNine(fBitmap, fCenter, r, &paint);
- canvas->drawImageNine(fImage, fCenter, r.makeOffset(360, 0), &paint);
-
+ for (int filter = 0; filter < 2; filter++) {
+ paint.setFilterQuality(filter == 0 ? kLow_SkFilterQuality : kNone_SkFilterQuality);
+ canvas->translate(0, filter * SkIntToScalar(400));
+ for (int iy = 0; iy < 2; ++iy) {
+ for (int ix = 0; ix < 2; ++ix) {
+ int i = ix * 2 + iy;
+ SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed,
+ size[i].width(), size[i].height());
+ canvas->drawBitmapNine(fBitmap, fCenter, r, &paint);
+ canvas->drawImageNine(fImage, fCenter, r.makeOffset(360, 0), &paint);
+ }
}
}
}
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698