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 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 | 67 |
68 SkISize sz = this->onISize(); | 68 SkISize sz = this->onISize(); |
69 fShader.reset(SkGradientShader::CreateRadial(SkPoint::Make(SkIntToScalar
(sz.width() / 2), | 69 fShader.reset(SkGradientShader::CreateRadial(SkPoint::Make(SkIntToScalar
(sz.width() / 2), |
70 SkIntToScalar
(sz.height() / 2)), | 70 SkIntToScalar
(sz.height() / 2)), |
71 sz.width() * .66f, colors,
pos, | 71 sz.width() * .66f, colors,
pos, |
72 SK_ARRAY_COUNT(colors), | 72 SK_ARRAY_COUNT(colors), |
73 SkShader::kRepeat_TileMode)
); | 73 SkShader::kRepeat_TileMode)
); |
74 } | 74 } |
75 | 75 |
76 uint32_t onGetFlags() const SK_OVERRIDE { | |
77 return kSkip565_Flag; | |
78 } | |
79 | |
80 SkString onShortName() SK_OVERRIDE { | 76 SkString onShortName() SK_OVERRIDE { |
81 return SkString("textblobshader"); | 77 return SkString("textblobshader"); |
82 } | 78 } |
83 | 79 |
84 SkISize onISize() SK_OVERRIDE { | 80 SkISize onISize() SK_OVERRIDE { |
85 return SkISize::Make(640, 480); | 81 return SkISize::Make(640, 480); |
86 } | 82 } |
87 | 83 |
88 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 84 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
89 SkPaint p; | 85 SkPaint p; |
(...skipping 15 matching lines...) Expand all Loading... |
105 | 101 |
106 private: | 102 private: |
107 SkTDArray<uint16_t> fGlyphs; | 103 SkTDArray<uint16_t> fGlyphs; |
108 SkAutoTUnref<const SkTextBlob> fBlob; | 104 SkAutoTUnref<const SkTextBlob> fBlob; |
109 SkAutoTUnref<SkShader> fShader; | 105 SkAutoTUnref<SkShader> fShader; |
110 | 106 |
111 typedef skiagm::GM INHERITED; | 107 typedef skiagm::GM INHERITED; |
112 }; | 108 }; |
113 | 109 |
114 DEF_GM( return SkNEW_ARGS(TextBlobShaderGM, ("Blobber")); ) | 110 DEF_GM( return SkNEW_ARGS(TextBlobShaderGM, ("Blobber")); ) |
OLD | NEW |