| 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkTypeface.h" | 9 #include "SkTypeface.h" |
| 10 | 10 |
| 11 namespace skiagm { | 11 namespace skiagm { |
| 12 | 12 |
| 13 class DevicePropertiesGM : public GM { | 13 class DevicePropertiesGM : public GM { |
| 14 public: | 14 public: |
| 15 DevicePropertiesGM() { | 15 DevicePropertiesGM() { |
| 16 this->setBGColor(0xFFFFFFFF); | 16 this->setBGColor(0xFFFFFFFF); |
| 17 } | 17 } |
| 18 | 18 |
| 19 virtual ~DevicePropertiesGM() { | 19 virtual ~DevicePropertiesGM() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 protected: | 22 protected: |
| 23 virtual SkString onShortName() { | 23 virtual SkString onShortName() { |
| 24 return SkString("deviceproperties"); | 24 return SkString("deviceproperties"); |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual SkISize onISize() { | 27 virtual SkISize onISize() { |
| 28 return make_isize(1450, 750); | 28 return SkISize::Make(1450, 750); |
| 29 } | 29 } |
| 30 | 30 |
| 31 static void rotate_about(SkCanvas* canvas, | 31 static void rotate_about(SkCanvas* canvas, |
| 32 SkScalar degrees, | 32 SkScalar degrees, |
| 33 SkScalar px, SkScalar py) { | 33 SkScalar px, SkScalar py) { |
| 34 canvas->translate(px, py); | 34 canvas->translate(px, py); |
| 35 canvas->rotate(degrees); | 35 canvas->rotate(degrees); |
| 36 canvas->translate(-px, -py); | 36 canvas->translate(-px, -py); |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 private: | 104 private: |
| 105 typedef GM INHERITED; | 105 typedef GM INHERITED; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 ////////////////////////////////////////////////////////////////////////////// | 108 ////////////////////////////////////////////////////////////////////////////// |
| 109 | 109 |
| 110 static GM* MyFactory(void*) { return new DevicePropertiesGM; } | 110 static GM* MyFactory(void*) { return new DevicePropertiesGM; } |
| 111 static GMRegistry reg(MyFactory); | 111 static GMRegistry reg(MyFactory); |
| 112 | 112 |
| 113 } | 113 } |
| OLD | NEW |