| 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 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkShader.h" | 10 #include "SkShader.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 make_bitmaps(W, H, &fSrcB, &fDstB, &fTransparent); | 162 make_bitmaps(W, H, &fSrcB, &fDstB, &fTransparent); |
| 163 } | 163 } |
| 164 | 164 |
| 165 public: | 165 public: |
| 166 const static int W = 64; | 166 const static int W = 64; |
| 167 const static int H = 64; | 167 const static int H = 64; |
| 168 XfermodesGM() {} | 168 XfermodesGM() {} |
| 169 | 169 |
| 170 protected: | 170 protected: |
| 171 virtual SkString onShortName() { | 171 virtual SkString onShortName() SK_OVERRIDE { |
| 172 return SkString("xfermodes"); | 172 return SkString("xfermodes"); |
| 173 } | 173 } |
| 174 | 174 |
| 175 virtual SkISize onISize() { | 175 virtual SkISize onISize() SK_OVERRIDE { |
| 176 return SkISize::Make(1990, 640); | 176 return SkISize::Make(1990, 640); |
| 177 } | 177 } |
| 178 | 178 |
| 179 virtual void onDraw(SkCanvas* canvas) { | 179 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 180 canvas->translate(SkIntToScalar(10), SkIntToScalar(20)); | 180 canvas->translate(SkIntToScalar(10), SkIntToScalar(20)); |
| 181 | 181 |
| 182 const struct { | 182 const struct { |
| 183 SkXfermode::Mode fMode; | 183 SkXfermode::Mode fMode; |
| 184 const char* fLabel; | 184 const char* fLabel; |
| 185 int fSourceTypeMask; // The source types to use this | 185 int fSourceTypeMask; // The source types to use this |
| 186 // mode with. See draw_mode for | 186 // mode with. See draw_mode for |
| 187 // an explanation of each type. | 187 // an explanation of each type. |
| 188 // PDF has to play some tricks | 188 // PDF has to play some tricks |
| 189 // to support the base modes, | 189 // to support the base modes, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 private: | 291 private: |
| 292 typedef GM INHERITED; | 292 typedef GM INHERITED; |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 ////////////////////////////////////////////////////////////////////////////// | 295 ////////////////////////////////////////////////////////////////////////////// |
| 296 | 296 |
| 297 static GM* MyFactory(void*) { return new XfermodesGM; } | 297 static GM* MyFactory(void*) { return new XfermodesGM; } |
| 298 static GMRegistry reg(MyFactory); | 298 static GMRegistry reg(MyFactory); |
| 299 | 299 |
| 300 } | 300 } |
| OLD | NEW |