OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 class FilterGM : public GM { | 80 class FilterGM : public GM { |
81 bool fOnce; | 81 bool fOnce; |
82 void init() { | 82 void init() { |
83 if (fOnce) { | 83 if (fOnce) { |
84 return; | 84 return; |
85 } | 85 } |
86 fOnce = true; | 86 fOnce = true; |
87 make_bm(&fBM8); | 87 make_bm(&fBM8); |
88 fBM8.copyTo(&fBM4444, kARGB_4444_SkColorType); | 88 fBM8.copyTo(&fBM4444, kARGB_4444_SkColorType); |
89 fBM8.copyTo(&fBM16, kRGB_565_SkColorType); | 89 fBM8.copyTo(&fBM16, kRGB_565_SkColorType); |
90 fBM8.copyTo(&fBM32, kN32_SkColorType); | 90 fBM8.copyTo(&fBM32, kPMColor_SkColorType); |
91 } | 91 } |
92 public: | 92 public: |
93 SkBitmap fBM8, fBM4444, fBM16, fBM32; | 93 SkBitmap fBM8, fBM4444, fBM16, fBM32; |
94 | 94 |
95 FilterGM() : fOnce(false) { | 95 FilterGM() : fOnce(false) { |
96 this->setBGColor(0xFFDDDDDD); | 96 this->setBGColor(0xFFDDDDDD); |
97 } | 97 } |
98 | 98 |
99 protected: | 99 protected: |
100 virtual SkString onShortName() { | 100 virtual SkString onShortName() { |
(...skipping 23 matching lines...) Expand all Loading... |
124 private: | 124 private: |
125 typedef GM INHERITED; | 125 typedef GM INHERITED; |
126 }; | 126 }; |
127 | 127 |
128 ////////////////////////////////////////////////////////////////////////////// | 128 ////////////////////////////////////////////////////////////////////////////// |
129 | 129 |
130 static GM* MyFactory(void*) { return new FilterGM; } | 130 static GM* MyFactory(void*) { return new FilterGM; } |
131 static GMRegistry reg(MyFactory); | 131 static GMRegistry reg(MyFactory); |
132 | 132 |
133 } | 133 } |
OLD | NEW |