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

Side by Side Diff: gm/ninepatchstretch.cpp

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/giantbitmap.cpp ('k') | gm/shadertext2.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 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { fixed * 4, fixed * 4 / 5 }, // shrink in Y 86 { fixed * 4, fixed * 4 / 5 }, // shrink in Y
87 { fixed * 4, fixed * 4 } 87 { fixed * 4, fixed * 4 }
88 }; 88 };
89 89
90 canvas->drawBitmap(bm, SkIntToScalar(10), SkIntToScalar(10), NULL); 90 canvas->drawBitmap(bm, SkIntToScalar(10), SkIntToScalar(10), NULL);
91 91
92 SkScalar x = SkIntToScalar(100); 92 SkScalar x = SkIntToScalar(100);
93 SkScalar y = SkIntToScalar(100); 93 SkScalar y = SkIntToScalar(100);
94 94
95 SkPaint paint; 95 SkPaint paint;
96 paint.setFilterBitmap(true); 96 paint.setFilterLevel(SkPaint::kLow_FilterLevel);
97 97
98 for (int iy = 0; iy < 2; ++iy) { 98 for (int iy = 0; iy < 2; ++iy) {
99 for (int ix = 0; ix < 2; ++ix) { 99 for (int ix = 0; ix < 2; ++ix) {
100 int i = ix * 2 + iy; 100 int i = ix * 2 + iy;
101 SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed, 101 SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed,
102 size[i].width(), size[i].height()); 102 size[i].width(), size[i].height());
103 canvas->drawBitmapNine(bm, center, r, &paint); 103 canvas->drawBitmapNine(bm, center, r, &paint);
104 } 104 }
105 } 105 }
106 } 106 }
107 107
108 private: 108 private:
109 typedef GM INHERITED; 109 typedef GM INHERITED;
110 }; 110 };
111 111
112 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////
113 113
114 static GM* MyFactory(void*) { return new NinePatchStretchGM; } 114 static GM* MyFactory(void*) { return new NinePatchStretchGM; }
115 static GMRegistry reg(MyFactory); 115 static GMRegistry reg(MyFactory);
116 116
117 } 117 }
OLDNEW
« no previous file with comments | « gm/giantbitmap.cpp ('k') | gm/shadertext2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698