| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 | 9 |
| 10 namespace skiagm { | 10 namespace skiagm { |
| 11 | 11 |
| 12 class AndroidFallbackGM : public GM { | 12 class AndroidFallbackGM : public GM { |
| 13 public: | 13 public: |
| 14 AndroidFallbackGM() { | 14 AndroidFallbackGM() { |
| 15 this->setBGColor(0xFFCCCCCC); | 15 this->setBGColor(0xFFCCCCCC); |
| 16 } | 16 } |
| 17 | 17 |
| 18 protected: | 18 protected: |
| 19 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 19 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 20 // TODO(scroggo): Undo this if we decide to fix skia:1763. | 20 // TODO(scroggo): Undo this if we decide to fix skia:1763. |
| 21 return GM::kSkipPipe_Flag; | 21 return GM::kSkipPipe_Flag; |
| 22 } | 22 } |
| 23 | 23 |
| 24 virtual SkString onShortName() SK_OVERRIDE { | 24 virtual SkString onShortName() SK_OVERRIDE { |
| 25 return SkString("android_paint"); | 25 return SkString("android_paint"); |
| 26 } | 26 } |
| 27 | 27 |
| 28 virtual SkISize onISize() SK_OVERRIDE { | 28 virtual SkISize onISize() SK_OVERRIDE { |
| 29 return make_isize(500, 500); | 29 return SkISize::Make(500, 500); |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 32 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 33 | 33 |
| 34 SkPaint paint; | 34 SkPaint paint; |
| 35 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); | 35 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); |
| 36 paint.setTextSize(24); | 36 paint.setTextSize(24); |
| 37 | 37 |
| 38 SkPaintOptionsAndroid options = paint.getPaintOptionsAndroid(); | 38 SkPaintOptionsAndroid options = paint.getPaintOptionsAndroid(); |
| 39 options.setUseFontFallbacks(true); | 39 options.setUseFontFallbacks(true); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 typedef GM INHERITED; | 79 typedef GM INHERITED; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 ////////////////////////////////////////////////////////////////////////////// | 82 ////////////////////////////////////////////////////////////////////////////// |
| 83 | 83 |
| 84 DEF_GM( return SkNEW(AndroidFallbackGM); ) | 84 DEF_GM( return SkNEW(AndroidFallbackGM); ) |
| 85 | 85 |
| 86 } | 86 } |
| OLD | NEW |