| 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 "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 class DitherBitmapView : public SampleView { | 79 class DitherBitmapView : public SampleView { |
| 80 SkBitmap fBM8; | 80 SkBitmap fBM8; |
| 81 SkBitmap fBM32; | 81 SkBitmap fBM32; |
| 82 bool fResult; | 82 bool fResult; |
| 83 public: | 83 public: |
| 84 DitherBitmapView() { | 84 DitherBitmapView() { |
| 85 fResult = test_pathregion(); | 85 fResult = test_pathregion(); |
| 86 fBM8 = make_bitmap(); | 86 fBM8 = make_bitmap(); |
| 87 fBM8.copyTo(&fBM32, kN32_SkColorType); | 87 fBM8.copyTo(&fBM32, kPMColor_SkColorType); |
| 88 | 88 |
| 89 this->setBGColor(0xFFDDDDDD); | 89 this->setBGColor(0xFFDDDDDD); |
| 90 } | 90 } |
| 91 | 91 |
| 92 protected: | 92 protected: |
| 93 // overrides from SkEventSink | 93 // overrides from SkEventSink |
| 94 virtual bool onQuery(SkEvent* evt) { | 94 virtual bool onQuery(SkEvent* evt) { |
| 95 if (SampleCode::TitleQ(*evt)) { | 95 if (SampleCode::TitleQ(*evt)) { |
| 96 SampleCode::TitleR(evt, "DitherBitmap"); | 96 SampleCode::TitleR(evt, "DitherBitmap"); |
| 97 return true; | 97 return true; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 typedef SampleView INHERITED; | 145 typedef SampleView INHERITED; |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 ////////////////////////////////////////////////////////////////////////////// | 148 ////////////////////////////////////////////////////////////////////////////// |
| 149 | 149 |
| 150 static SkView* MyFactory() { return new DitherBitmapView; } | 150 static SkView* MyFactory() { return new DitherBitmapView; } |
| 151 static SkViewRegister reg(MyFactory); | 151 static SkViewRegister reg(MyFactory); |
| OLD | NEW |