Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); | 102 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); |
| 103 if (nullptr == rt) { | 103 if (nullptr == rt) { |
| 104 skiagm::GM::DrawGpuOnlyMessage(canvas); | 104 skiagm::GM::DrawGpuOnlyMessage(canvas); |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 GrContext* context = rt->getContext(); | 107 GrContext* context = rt->getContext(); |
| 108 if (nullptr == context) { | 108 if (nullptr == context) { |
| 109 return; | 109 return; |
| 110 } | 110 } |
| 111 | 111 |
| 112 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); | 112 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
|
bsalomon
2016/04/26 13:09:25
It seems strange that we need to ref the rt here w
robertphillips
2016/04/26 13:36:53
GrContext::drawContext should now take an sk_sp
| |
| 113 if (!drawContext) { | 113 if (!drawContext) { |
| 114 return; | 114 return; |
| 115 } | 115 } |
| 116 | 116 |
| 117 struct Vertex { | 117 struct Vertex { |
| 118 SkPoint fPosition; | 118 SkPoint fPosition; |
| 119 float fKLM[4]; // The last value is ignored. The effect expects a vec4f. | 119 float fKLM[4]; // The last value is ignored. The effect expects a vec4f. |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 static const int kNumCubics = 15; | 122 static const int kNumCubics = 15; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); | 241 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); |
| 242 if (nullptr == rt) { | 242 if (nullptr == rt) { |
| 243 skiagm::GM::DrawGpuOnlyMessage(canvas); | 243 skiagm::GM::DrawGpuOnlyMessage(canvas); |
| 244 return; | 244 return; |
| 245 } | 245 } |
| 246 GrContext* context = rt->getContext(); | 246 GrContext* context = rt->getContext(); |
| 247 if (nullptr == context) { | 247 if (nullptr == context) { |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 | 250 |
| 251 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); | 251 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
| 252 if (!drawContext) { | 252 if (!drawContext) { |
| 253 return; | 253 return; |
| 254 } | 254 } |
| 255 | 255 |
| 256 struct Vertex { | 256 struct Vertex { |
| 257 SkPoint fPosition; | 257 SkPoint fPosition; |
| 258 float fKLM[4]; // The last value is ignored. The effect expects a vec4f. | 258 float fKLM[4]; // The last value is ignored. The effect expects a vec4f. |
| 259 }; | 259 }; |
| 260 | 260 |
| 261 static const int kNumConics = 10; | 261 static const int kNumConics = 10; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); | 458 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); |
| 459 if (nullptr == rt) { | 459 if (nullptr == rt) { |
| 460 skiagm::GM::DrawGpuOnlyMessage(canvas); | 460 skiagm::GM::DrawGpuOnlyMessage(canvas); |
| 461 return; | 461 return; |
| 462 } | 462 } |
| 463 GrContext* context = rt->getContext(); | 463 GrContext* context = rt->getContext(); |
| 464 if (nullptr == context) { | 464 if (nullptr == context) { |
| 465 return; | 465 return; |
| 466 } | 466 } |
| 467 | 467 |
| 468 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); | 468 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
| 469 if (!drawContext) { | 469 if (!drawContext) { |
| 470 return; | 470 return; |
| 471 } | 471 } |
| 472 | 472 |
| 473 struct Vertex { | 473 struct Vertex { |
| 474 SkPoint fPosition; | 474 SkPoint fPosition; |
| 475 float fUV[4]; // The last two values are ignored. The effect expec ts a vec4f. | 475 float fUV[4]; // The last two values are ignored. The effect expec ts a vec4f. |
| 476 }; | 476 }; |
| 477 | 477 |
| 478 static const int kNumQuads = 5; | 478 static const int kNumQuads = 5; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 private: | 566 private: |
| 567 typedef GM INHERITED; | 567 typedef GM INHERITED; |
| 568 }; | 568 }; |
| 569 | 569 |
| 570 DEF_GM(return new BezierCubicEffects;) | 570 DEF_GM(return new BezierCubicEffects;) |
| 571 DEF_GM(return new BezierConicEffects;) | 571 DEF_GM(return new BezierConicEffects;) |
| 572 DEF_GM(return new BezierQuadEffects;) | 572 DEF_GM(return new BezierQuadEffects;) |
| 573 } | 573 } |
| 574 | 574 |
| 575 #endif | 575 #endif |
| OLD | NEW |