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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 1238083004: make imagefilters* imagemagnifier imageresizetiled portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/imagefiltersbase.cpp ('k') | gm/imagemagnifier.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 2012 Google Inc. 2 * Copyright 2012 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 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 virtual SkString onShortName() { 106 virtual SkString onShortName() {
107 return SkString("imagefiltersgraph"); 107 return SkString("imagefiltersgraph");
108 } 108 }
109 109
110 void make_bitmap() { 110 void make_bitmap() {
111 fBitmap.allocN32Pixels(100, 100); 111 fBitmap.allocN32Pixels(100, 100);
112 SkCanvas canvas(fBitmap); 112 SkCanvas canvas(fBitmap);
113 canvas.clear(SK_ColorTRANSPARENT); 113 canvas.clear(SK_ColorTRANSPARENT);
114 SkPaint paint; 114 SkPaint paint;
115 paint.setAntiAlias(true); 115 paint.setAntiAlias(true);
116 sk_tool_utils::set_portable_typeface(&paint); 116 sk_tool_utils::set_portable_typeface_always(&paint);
117 paint.setColor(SK_ColorWHITE); 117 paint.setColor(SK_ColorWHITE);
118 paint.setTextSize(SkIntToScalar(96)); 118 paint.setTextSize(SkIntToScalar(96));
119 const char* str = "e"; 119 const char* str = "e";
120 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 120 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
121 } 121 }
122 122
123 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint) { 123 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint) {
124 canvas->save(); 124 canvas->save();
125 canvas->clipRect(SkRect::MakeXYWH(0, 0, 125 canvas->clipRect(SkRect::MakeXYWH(0, 0,
126 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); 126 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height())));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 private: 225 private:
226 typedef GM INHERITED; 226 typedef GM INHERITED;
227 SkBitmap fBitmap; 227 SkBitmap fBitmap;
228 }; 228 };
229 229
230 /////////////////////////////////////////////////////////////////////////////// 230 ///////////////////////////////////////////////////////////////////////////////
231 231
232 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 232 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
233 static skiagm::GMRegistry reg(MyFactory); 233 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imagefiltersbase.cpp ('k') | gm/imagemagnifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698