OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 border, with no red. | 64 border, with no red. |
65 */ | 65 */ |
66 | 66 |
67 class AAClipGM : public skiagm::GM { | 67 class AAClipGM : public skiagm::GM { |
68 public: | 68 public: |
69 AAClipGM() { | 69 AAClipGM() { |
70 | 70 |
71 } | 71 } |
72 | 72 |
73 protected: | 73 protected: |
74 SkString onShortName() SK_OVERRIDE { | 74 SkString onShortName() override { |
75 return SkString("aaclip"); | 75 return SkString("aaclip"); |
76 } | 76 } |
77 | 77 |
78 SkISize onISize() SK_OVERRIDE { | 78 SkISize onISize() override { |
79 return SkISize::Make(240, 120); | 79 return SkISize::Make(240, 120); |
80 } | 80 } |
81 | 81 |
82 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 82 void onDraw(SkCanvas* canvas) override { |
83 // Initial pixel-boundary-aligned draw | 83 // Initial pixel-boundary-aligned draw |
84 draw_rect_tests(canvas); | 84 draw_rect_tests(canvas); |
85 | 85 |
86 // Repeat 4x with .2, .4, .6, .8 px offsets | 86 // Repeat 4x with .2, .4, .6, .8 px offsets |
87 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); | 87 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); |
88 canvas->translate(SkIntToScalar(50), 0); | 88 canvas->translate(SkIntToScalar(50), 0); |
89 draw_rect_tests(canvas); | 89 draw_rect_tests(canvas); |
90 | 90 |
91 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); | 91 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); |
92 canvas->translate(SkIntToScalar(50), 0); | 92 canvas->translate(SkIntToScalar(50), 0); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 CGImageRelease(image); | 147 CGImageRelease(image); |
148 | 148 |
149 canvas->drawBitmap(bm2, 10, 120); | 149 canvas->drawBitmap(bm2, 10, 120); |
150 } | 150 } |
151 | 151 |
152 class CGImageGM : public skiagm::GM { | 152 class CGImageGM : public skiagm::GM { |
153 public: | 153 public: |
154 CGImageGM() {} | 154 CGImageGM() {} |
155 | 155 |
156 protected: | 156 protected: |
157 SkString onShortName() SK_OVERRIDE { | 157 SkString onShortName() override { |
158 return SkString("cgimage"); | 158 return SkString("cgimage"); |
159 } | 159 } |
160 | 160 |
161 SkISize onISize() SK_OVERRIDE { | 161 SkISize onISize() override { |
162 return SkISize::Make(800, 250); | 162 return SkISize::Make(800, 250); |
163 } | 163 } |
164 | 164 |
165 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 165 void onDraw(SkCanvas* canvas) override { |
166 const struct { | 166 const struct { |
167 SkColorType fCT; | 167 SkColorType fCT; |
168 SkAlphaType fAT; | 168 SkAlphaType fAT; |
169 } rec[] = { | 169 } rec[] = { |
170 { kRGB_565_SkColorType, kOpaque_SkAlphaType }, | 170 { kRGB_565_SkColorType, kOpaque_SkAlphaType }, |
171 | 171 |
172 { kRGBA_8888_SkColorType, kPremul_SkAlphaType }, | 172 { kRGBA_8888_SkColorType, kPremul_SkAlphaType }, |
173 { kRGBA_8888_SkColorType, kUnpremul_SkAlphaType }, | 173 { kRGBA_8888_SkColorType, kUnpremul_SkAlphaType }, |
174 { kRGBA_8888_SkColorType, kOpaque_SkAlphaType }, | 174 { kRGBA_8888_SkColorType, kOpaque_SkAlphaType }, |
175 | 175 |
(...skipping 10 matching lines...) Expand all Loading... |
186 } | 186 } |
187 | 187 |
188 private: | 188 private: |
189 typedef skiagm::GM INHERITED; | 189 typedef skiagm::GM INHERITED; |
190 }; | 190 }; |
191 | 191 |
192 #if 0 // Disabled pending fix from reed@ | 192 #if 0 // Disabled pending fix from reed@ |
193 DEF_GM( return SkNEW(CGImageGM); ) | 193 DEF_GM( return SkNEW(CGImageGM); ) |
194 #endif | 194 #endif |
195 #endif | 195 #endif |
OLD | NEW |