OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class GlyphPosAlignGM : public GM { | 22 class GlyphPosAlignGM : public GM { |
23 protected: | 23 protected: |
24 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 24 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
25 return kSkipTiled_Flag; | 25 return kSkipTiled_Flag; |
26 } | 26 } |
27 | 27 |
28 virtual SkString onShortName() SK_OVERRIDE { | 28 virtual SkString onShortName() SK_OVERRIDE { |
29 return SkString("glyph_pos_align"); | 29 return SkString("glyph_pos_align"); |
30 } | 30 } |
31 | 31 |
32 virtual SkISize onISize() { return SkISize::Make(kWidth, kHeight); } | 32 virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(kWidth, kHeight
); } |
33 | 33 |
34 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 34 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
35 canvas->clear(SK_ColorBLACK); | 35 canvas->clear(SK_ColorBLACK); |
36 | 36 |
37 SkPaint paint; | 37 SkPaint paint; |
38 paint.setTextSize(kTextHeight); | 38 paint.setTextSize(kTextHeight); |
39 paint.setFakeBoldText(true); | 39 paint.setFakeBoldText(true); |
40 const SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE }; | 40 const SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE }; |
41 const SkPoint pts[] = {{0, 0}, {kWidth, kHeight}}; | 41 const SkPoint pts[] = {{0, 0}, {kWidth, kHeight}}; |
42 SkAutoTUnref<SkShader> grad(SkGradientShader::CreateLinear(pts, colors,
NULL, | 42 SkAutoTUnref<SkShader> grad(SkGradientShader::CreateLinear(pts, colors,
NULL, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 ////////////////////////////////////////////////////////////////////////////// | 91 ////////////////////////////////////////////////////////////////////////////// |
92 | 92 |
93 static GM* GlyphPosAlignFactory(void*) { | 93 static GM* GlyphPosAlignFactory(void*) { |
94 return new GlyphPosAlignGM(); | 94 return new GlyphPosAlignGM(); |
95 } | 95 } |
96 | 96 |
97 static GMRegistry reg(GlyphPosAlignFactory); | 97 static GMRegistry reg(GlyphPosAlignFactory); |
98 | 98 |
99 } | 99 } |
OLD | NEW |