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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 class DitherView : public SampleView { | 112 class DitherView : public SampleView { |
113 public: | 113 public: |
114 SkBitmap fBM, fBMPreDither, fBM16; | 114 SkBitmap fBM, fBMPreDither, fBM16; |
115 SkScalar fAngle; | 115 SkScalar fAngle; |
116 | 116 |
117 DitherView() { | 117 DitherView() { |
118 make_bm(&fBM); | 118 make_bm(&fBM); |
119 make_bm(&fBMPreDither); | 119 make_bm(&fBMPreDither); |
120 pre_dither(fBMPreDither); | 120 pre_dither(fBMPreDither); |
121 fBM.copyTo(&fBM16, SkBitmap::kARGB_4444_Config); | 121 fBM.copyTo(&fBM16, kARGB_4444_SkColorType); |
122 | 122 |
123 fAngle = 0; | 123 fAngle = 0; |
124 | 124 |
125 this->setBGColor(0xFF181818); | 125 this->setBGColor(0xFF181818); |
126 } | 126 } |
127 | 127 |
128 protected: | 128 protected: |
129 // overrides from SkEventSink | 129 // overrides from SkEventSink |
130 virtual bool onQuery(SkEvent* evt) { | 130 virtual bool onQuery(SkEvent* evt) { |
131 if (SampleCode::TitleQ(*evt)) { | 131 if (SampleCode::TitleQ(*evt)) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 private: | 171 private: |
172 typedef SampleView INHERITED; | 172 typedef SampleView INHERITED; |
173 }; | 173 }; |
174 | 174 |
175 ////////////////////////////////////////////////////////////////////////////// | 175 ////////////////////////////////////////////////////////////////////////////// |
176 | 176 |
177 static SkView* MyFactory() { return new DitherView; } | 177 static SkView* MyFactory() { return new DitherView; } |
178 static SkViewRegister reg(MyFactory); | 178 static SkViewRegister reg(MyFactory); |
OLD | NEW |