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 "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 ImageFiltersGraphGM() : fInitialized(false) {} | 25 ImageFiltersGraphGM() : fInitialized(false) {} |
26 | 26 |
27 protected: | 27 protected: |
28 virtual SkString onShortName() { | 28 virtual SkString onShortName() { |
29 return SkString("imagefiltersgraph"); | 29 return SkString("imagefiltersgraph"); |
30 } | 30 } |
31 | 31 |
32 void make_bitmap() { | 32 void make_bitmap() { |
33 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); | 33 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); |
34 fBitmap.allocPixels(); | 34 fBitmap.allocPixels(); |
35 SkDevice device(fBitmap); | 35 SkBitmapDevice device(fBitmap); |
36 SkCanvas canvas(&device); | 36 SkCanvas canvas(&device); |
37 canvas.clear(0x00000000); | 37 canvas.clear(0x00000000); |
38 SkPaint paint; | 38 SkPaint paint; |
39 paint.setAntiAlias(true); | 39 paint.setAntiAlias(true); |
40 paint.setColor(0xFFFFFFFF); | 40 paint.setColor(0xFFFFFFFF); |
41 paint.setTextSize(SkIntToScalar(96)); | 41 paint.setTextSize(SkIntToScalar(96)); |
42 const char* str = "e"; | 42 const char* str = "e"; |
43 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); | 43 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); |
44 } | 44 } |
45 | 45 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 private: | 86 private: |
87 typedef GM INHERITED; | 87 typedef GM INHERITED; |
88 SkBitmap fBitmap; | 88 SkBitmap fBitmap; |
89 bool fInitialized; | 89 bool fInitialized; |
90 }; | 90 }; |
91 | 91 |
92 /////////////////////////////////////////////////////////////////////////////// | 92 /////////////////////////////////////////////////////////////////////////////// |
93 | 93 |
94 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } | 94 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } |
95 static skiagm::GMRegistry reg(MyFactory); | 95 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |