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 "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 static const int kPointSize = 300; | 46 static const int kPointSize = 300; |
47 | 47 |
48 class ShaderText3GM : public GM { | 48 class ShaderText3GM : public GM { |
49 public: | 49 public: |
50 ShaderText3GM() { | 50 ShaderText3GM() { |
51 this->setBGColor(0xFFDDDDDD); | 51 this->setBGColor(0xFFDDDDDD); |
52 } | 52 } |
53 | 53 |
54 protected: | 54 protected: |
55 | 55 |
56 SkString onShortName() SK_OVERRIDE { | 56 SkString onShortName() override { |
57 return SkString("shadertext3"); | 57 return SkString("shadertext3"); |
58 } | 58 } |
59 | 59 |
60 SkISize onISize() SK_OVERRIDE{ return SkISize::Make(800, 1000); } | 60 SkISize onISize() override{ return SkISize::Make(800, 1000); } |
61 | 61 |
62 void onOnceBeforeDraw() SK_OVERRIDE { | 62 void onOnceBeforeDraw() override { |
63 makebm(&fBmp, kPointSize / 4, kPointSize / 4); | 63 makebm(&fBmp, kPointSize / 4, kPointSize / 4); |
64 } | 64 } |
65 | 65 |
66 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 66 void onDraw(SkCanvas* canvas) override { |
67 | 67 |
68 SkPaint bmpPaint; | 68 SkPaint bmpPaint; |
69 bmpPaint.setAntiAlias(true); | 69 bmpPaint.setAntiAlias(true); |
70 bmpPaint.setFilterQuality(kLow_SkFilterQuality); | 70 bmpPaint.setFilterQuality(kLow_SkFilterQuality); |
71 bmpPaint.setAlpha(0x80); | 71 bmpPaint.setAlpha(0x80); |
72 canvas->drawBitmap(fBmp, 5.f, 5.f, &bmpPaint); | 72 canvas->drawBitmap(fBmp, 5.f, 5.f, &bmpPaint); |
73 | 73 |
74 SkPaint outlinePaint; | 74 SkPaint outlinePaint; |
75 outlinePaint.setAntiAlias(true); | 75 outlinePaint.setAntiAlias(true); |
76 sk_tool_utils::set_portable_typeface(&outlinePaint); | 76 sk_tool_utils::set_portable_typeface(&outlinePaint); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 private: | 130 private: |
131 SkBitmap fBmp; | 131 SkBitmap fBmp; |
132 typedef GM INHERITED; | 132 typedef GM INHERITED; |
133 }; | 133 }; |
134 | 134 |
135 /////////////////////////////////////////////////////////////////////////////// | 135 /////////////////////////////////////////////////////////////////////////////// |
136 | 136 |
137 static GM* MyFactory(void*) { return new ShaderText3GM; } | 137 static GM* MyFactory(void*) { return new ShaderText3GM; } |
138 static GMRegistry reg(MyFactory); | 138 static GMRegistry reg(MyFactory); |
139 } | 139 } |
OLD | NEW |