OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 50 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
51 if (nullptr == rt) { | 51 if (nullptr == rt) { |
52 return; | 52 return; |
53 } | 53 } |
54 GrContext* context = rt->getContext(); | 54 GrContext* context = rt->getContext(); |
55 if (nullptr == context) { | 55 if (nullptr == context) { |
56 skiagm::GM::DrawGpuOnlyMessage(canvas); | 56 skiagm::GM::DrawGpuOnlyMessage(canvas); |
57 return; | 57 return; |
58 } | 58 } |
59 | 59 |
60 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); | 60 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
61 if (!drawContext) { | 61 if (!drawContext) { |
62 return; | 62 return; |
63 } | 63 } |
64 | 64 |
65 static const GrColor kColors[] = { | 65 static const GrColor kColors[] = { |
66 0xFFFFFFFF, | 66 0xFFFFFFFF, |
67 0xFFFF00FF, | 67 0xFFFF00FF, |
68 0x80000000, | 68 0x80000000, |
69 0x00000000, | 69 0x00000000, |
70 }; | 70 }; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 typedef GM INHERITED; | 189 typedef GM INHERITED; |
190 }; | 190 }; |
191 | 191 |
192 const SkScalar ConstColorProcessor::kPad = 10.f; | 192 const SkScalar ConstColorProcessor::kPad = 10.f; |
193 const SkScalar ConstColorProcessor::kRectSize = 20.f; | 193 const SkScalar ConstColorProcessor::kRectSize = 20.f; |
194 | 194 |
195 DEF_GM(return new ConstColorProcessor;) | 195 DEF_GM(return new ConstColorProcessor;) |
196 } | 196 } |
197 | 197 |
198 #endif | 198 #endif |
OLD | NEW |