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

Side by Side Diff: gm/ninepatchstretch.cpp

Issue 1014533004: SkPaint::FilterLevel -> SkFilterQuality (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « gm/mipmap.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 static void make_bitmap(SkBitmap* bitmap, SkIRect* center) { 10 static void make_bitmap(SkBitmap* bitmap, SkIRect* center) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { fixed * 4, fixed * 4 / 5 }, // shrink in Y 66 { fixed * 4, fixed * 4 / 5 }, // shrink in Y
67 { fixed * 4, fixed * 4 } 67 { fixed * 4, fixed * 4 }
68 }; 68 };
69 69
70 canvas->drawBitmap(bm, SkIntToScalar(10), SkIntToScalar(10), NULL); 70 canvas->drawBitmap(bm, SkIntToScalar(10), SkIntToScalar(10), NULL);
71 71
72 SkScalar x = SkIntToScalar(100); 72 SkScalar x = SkIntToScalar(100);
73 SkScalar y = SkIntToScalar(100); 73 SkScalar y = SkIntToScalar(100);
74 74
75 SkPaint paint; 75 SkPaint paint;
76 paint.setFilterLevel(SkPaint::kLow_FilterLevel); 76 paint.setFilterQuality(kLow_SkFilterQuality);
77 77
78 for (int iy = 0; iy < 2; ++iy) { 78 for (int iy = 0; iy < 2; ++iy) {
79 for (int ix = 0; ix < 2; ++ix) { 79 for (int ix = 0; ix < 2; ++ix) {
80 int i = ix * 2 + iy; 80 int i = ix * 2 + iy;
81 SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed, 81 SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed,
82 size[i].width(), size[i].height()); 82 size[i].width(), size[i].height());
83 canvas->drawBitmapNine(bm, center, r, &paint); 83 canvas->drawBitmapNine(bm, center, r, &paint);
84 } 84 }
85 } 85 }
86 } 86 }
87 87
88 private: 88 private:
89 typedef GM INHERITED; 89 typedef GM INHERITED;
90 }; 90 };
91 91
92 ////////////////////////////////////////////////////////////////////////////// 92 //////////////////////////////////////////////////////////////////////////////
93 93
94 static GM* MyFactory(void*) { return new NinePatchStretchGM; } 94 static GM* MyFactory(void*) { return new NinePatchStretchGM; }
95 static GMRegistry reg(MyFactory); 95 static GMRegistry reg(MyFactory);
96 96
97 } 97 }
OLDNEW
« no previous file with comments | « gm/mipmap.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698