OLD | NEW |
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 Loading... |
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 Loading... |
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); |
OLD | NEW |