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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 class FilterView : public SampleView { | 86 class FilterView : public SampleView { |
87 public: | 87 public: |
88 SkBitmap fBM8, fBM4444, fBM16, fBM32; | 88 SkBitmap fBM8, fBM4444, fBM16, fBM32; |
89 | 89 |
90 FilterView() { | 90 FilterView() { |
91 make_bm(&fBM8); | 91 make_bm(&fBM8); |
92 fBM8.copyTo(&fBM4444, kARGB_4444_SkColorType); | 92 fBM8.copyTo(&fBM4444, kARGB_4444_SkColorType); |
93 fBM8.copyTo(&fBM16, kRGB_565_SkColorType); | 93 fBM8.copyTo(&fBM16, kRGB_565_SkColorType); |
94 fBM8.copyTo(&fBM32, kPMColor_SkColorType); | 94 fBM8.copyTo(&fBM32, kN32_SkColorType); |
95 | 95 |
96 this->setBGColor(0xFFDDDDDD); | 96 this->setBGColor(0xFFDDDDDD); |
97 } | 97 } |
98 | 98 |
99 protected: | 99 protected: |
100 // overrides from SkEventSink | 100 // overrides from SkEventSink |
101 virtual bool onQuery(SkEvent* evt) { | 101 virtual bool onQuery(SkEvent* evt) { |
102 if (SampleCode::TitleQ(*evt)) { | 102 if (SampleCode::TitleQ(*evt)) { |
103 SampleCode::TitleR(evt, "Filter"); | 103 SampleCode::TitleR(evt, "Filter"); |
104 return true; | 104 return true; |
(...skipping 16 matching lines...) Expand all Loading... |
121 } | 121 } |
122 | 122 |
123 private: | 123 private: |
124 typedef SampleView INHERITED; | 124 typedef SampleView INHERITED; |
125 }; | 125 }; |
126 | 126 |
127 ////////////////////////////////////////////////////////////////////////////// | 127 ////////////////////////////////////////////////////////////////////////////// |
128 | 128 |
129 static SkView* MyFactory() { return new FilterView; } | 129 static SkView* MyFactory() { return new FilterView; } |
130 static SkViewRegister reg(MyFactory); | 130 static SkViewRegister reg(MyFactory); |
OLD | NEW |