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" |
11 #include "SkDevice.h" | |
12 #include "SkBitmapSource.h" | 11 #include "SkBitmapSource.h" |
13 #include "SkBlurImageFilter.h" | 12 #include "SkBlurImageFilter.h" |
14 #include "SkColorFilter.h" | 13 #include "SkColorFilter.h" |
15 #include "SkColorFilterImageFilter.h" | 14 #include "SkColorFilterImageFilter.h" |
16 #include "SkColorMatrixFilter.h" | 15 #include "SkColorMatrixFilter.h" |
17 #include "SkReadBuffer.h" | 16 #include "SkReadBuffer.h" |
18 #include "SkWriteBuffer.h" | 17 #include "SkWriteBuffer.h" |
19 #include "SkMergeImageFilter.h" | 18 #include "SkMergeImageFilter.h" |
20 #include "SkMorphologyImageFilter.h" | 19 #include "SkMorphologyImageFilter.h" |
21 #include "SkOnce.h" | 20 #include "SkOnce.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 SkOnce(&once, init_flattenable, &dummy); | 86 SkOnce(&once, init_flattenable, &dummy); |
88 } | 87 } |
89 | 88 |
90 protected: | 89 protected: |
91 virtual SkString onShortName() { | 90 virtual SkString onShortName() { |
92 return SkString("imagefiltersgraph"); | 91 return SkString("imagefiltersgraph"); |
93 } | 92 } |
94 | 93 |
95 void make_bitmap() { | 94 void make_bitmap() { |
96 fBitmap.allocN32Pixels(100, 100); | 95 fBitmap.allocN32Pixels(100, 100); |
97 SkCanvas canvas(fBitmap); | 96 SkBitmapDevice device(fBitmap); |
| 97 SkCanvas canvas(&device); |
98 canvas.clear(0x00000000); | 98 canvas.clear(0x00000000); |
99 SkPaint paint; | 99 SkPaint paint; |
100 paint.setAntiAlias(true); | 100 paint.setAntiAlias(true); |
101 paint.setColor(0xFFFFFFFF); | 101 paint.setColor(0xFFFFFFFF); |
102 paint.setTextSize(SkIntToScalar(96)); | 102 paint.setTextSize(SkIntToScalar(96)); |
103 const char* str = "e"; | 103 const char* str = "e"; |
104 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); | 104 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); |
105 } | 105 } |
106 | 106 |
107 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai
nt& paint) { | 107 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai
nt& paint) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 private: | 206 private: |
207 typedef GM INHERITED; | 207 typedef GM INHERITED; |
208 SkBitmap fBitmap; | 208 SkBitmap fBitmap; |
209 bool fInitialized; | 209 bool fInitialized; |
210 }; | 210 }; |
211 | 211 |
212 /////////////////////////////////////////////////////////////////////////////// | 212 /////////////////////////////////////////////////////////////////////////////// |
213 | 213 |
214 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } | 214 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } |
215 static skiagm::GMRegistry reg(MyFactory); | 215 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |