OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 fRects.addToTail(SkRect::MakeLTRB(5.5f, .05f, 29.5f, .25f)); | 88 fRects.addToTail(SkRect::MakeLTRB(5.5f, .05f, 29.5f, .25f)); |
89 // small in x and y | 89 // small in x and y |
90 fRects.addToTail(SkRect::MakeLTRB(5.05f, .55f, 5.45f, .85f)); | 90 fRects.addToTail(SkRect::MakeLTRB(5.05f, .55f, 5.45f, .85f)); |
91 // inverted in x and y | 91 // inverted in x and y |
92 fRects.addToTail(SkRect::MakeLTRB(100.f, 50.5f, 5.f, 0.5f)); | 92 fRects.addToTail(SkRect::MakeLTRB(100.f, 50.5f, 5.f, 0.5f)); |
93 } | 93 } |
94 | 94 |
95 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 95 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
96 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 96 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
97 if (NULL == rt) { | 97 if (NULL == rt) { |
| 98 this->drawGpuOnlyMessage(canvas); |
98 return; | 99 return; |
99 } | 100 } |
100 GrContext* context = rt->getContext(); | 101 GrContext* context = rt->getContext(); |
101 if (NULL == context) { | 102 if (NULL == context) { |
102 return; | 103 return; |
103 } | 104 } |
104 | 105 |
105 SkScalar y = 0; | 106 SkScalar y = 0; |
106 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I
terStart); | 107 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I
terStart); |
107 iter.get(); | 108 iter.get(); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 SkTLList<SkPath> fPaths; | 226 SkTLList<SkPath> fPaths; |
226 SkTLList<SkRect> fRects; | 227 SkTLList<SkRect> fRects; |
227 | 228 |
228 typedef GM INHERITED; | 229 typedef GM INHERITED; |
229 }; | 230 }; |
230 | 231 |
231 DEF_GM( return SkNEW(ConvexPolyEffect); ) | 232 DEF_GM( return SkNEW(ConvexPolyEffect); ) |
232 } | 233 } |
233 | 234 |
234 #endif | 235 #endif |
OLD | NEW |