| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 protected: | 102 protected: |
| 103 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 103 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 104 return kSkipTiled_Flag; | 104 return kSkipTiled_Flag; |
| 105 } | 105 } |
| 106 | 106 |
| 107 SkString onShortName() { | 107 SkString onShortName() { |
| 108 return SkString("shadertext"); | 108 return SkString("shadertext"); |
| 109 } | 109 } |
| 110 | 110 |
| 111 SkISize onISize() { return make_isize(1450, 500); } | 111 SkISize onISize() { return SkISize::Make(1450, 500); } |
| 112 | 112 |
| 113 virtual void onDraw(SkCanvas* canvas) { | 113 virtual void onDraw(SkCanvas* canvas) { |
| 114 const char text[] = "Shaded Text"; | 114 const char text[] = "Shaded Text"; |
| 115 const int textLen = SK_ARRAY_COUNT(text) - 1; | 115 const int textLen = SK_ARRAY_COUNT(text) - 1; |
| 116 const int pointSize = 36; | 116 const int pointSize = 36; |
| 117 | 117 |
| 118 int w = pointSize * textLen; | 118 int w = pointSize * textLen; |
| 119 int h = pointSize; | 119 int h = pointSize; |
| 120 | 120 |
| 121 SkPoint pts[2] = { | 121 SkPoint pts[2] = { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 private: | 193 private: |
| 194 typedef GM INHERITED; | 194 typedef GM INHERITED; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 /////////////////////////////////////////////////////////////////////////////// | 197 /////////////////////////////////////////////////////////////////////////////// |
| 198 | 198 |
| 199 static GM* MyFactory(void*) { return new ShaderTextGM; } | 199 static GM* MyFactory(void*) { return new ShaderTextGM; } |
| 200 static GMRegistry reg(MyFactory); | 200 static GMRegistry reg(MyFactory); |
| 201 } | 201 } |
| OLD | NEW |