| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 virtual SkString onShortName() { | 92 virtual SkString onShortName() { |
| 93 return SkString("imagefiltersgraph"); | 93 return SkString("imagefiltersgraph"); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void make_bitmap() { | 96 void make_bitmap() { |
| 97 fBitmap.allocN32Pixels(100, 100); | 97 fBitmap.allocN32Pixels(100, 100); |
| 98 SkCanvas canvas(fBitmap); | 98 SkCanvas canvas(fBitmap); |
| 99 canvas.clear(0x00000000); | 99 canvas.clear(0x00000000); |
| 100 SkPaint paint; | 100 SkPaint paint; |
| 101 paint.setAntiAlias(true); | 101 paint.setAntiAlias(true); |
| 102 sk_tool_utils::set_portable_typeface(&paint); |
| 102 paint.setColor(0xFFFFFFFF); | 103 paint.setColor(0xFFFFFFFF); |
| 103 paint.setTextSize(SkIntToScalar(96)); | 104 paint.setTextSize(SkIntToScalar(96)); |
| 104 const char* str = "e"; | 105 const char* str = "e"; |
| 105 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); | 106 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); |
| 106 } | 107 } |
| 107 | 108 |
| 108 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai
nt& paint) { | 109 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai
nt& paint) { |
| 109 canvas->save(); | 110 canvas->save(); |
| 110 canvas->clipRect(SkRect::MakeXYWH(0, 0, | 111 canvas->clipRect(SkRect::MakeXYWH(0, 0, |
| 111 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); | 112 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 210 |
| 210 private: | 211 private: |
| 211 typedef GM INHERITED; | 212 typedef GM INHERITED; |
| 212 SkBitmap fBitmap; | 213 SkBitmap fBitmap; |
| 213 }; | 214 }; |
| 214 | 215 |
| 215 /////////////////////////////////////////////////////////////////////////////// | 216 /////////////////////////////////////////////////////////////////////////////// |
| 216 | 217 |
| 217 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } | 218 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } |
| 218 static skiagm::GMRegistry reg(MyFactory); | 219 static skiagm::GMRegistry reg(MyFactory); |
| OLD | NEW |