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 // 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 73 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
74 if (nullptr == rt) { | 74 if (nullptr == rt) { |
75 return; | 75 return; |
76 } | 76 } |
77 GrContext* context = rt->getContext(); | 77 GrContext* context = rt->getContext(); |
78 if (nullptr == context) { | 78 if (nullptr == context) { |
79 skiagm::GM::DrawGpuOnlyMessage(canvas); | 79 skiagm::GM::DrawGpuOnlyMessage(canvas); |
80 return; | 80 return; |
81 } | 81 } |
82 | 82 |
83 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); | 83 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
84 if (!drawContext) { | 84 if (!drawContext) { |
85 return; | 85 return; |
86 } | 86 } |
87 | 87 |
88 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp, | 88 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp, |
89 GrTextureParams
::ClampNoFilter())); | 89 GrTextureParams
::ClampNoFilter())); |
90 if (!texture) { | 90 if (!texture) { |
91 return; | 91 return; |
92 } | 92 } |
93 | 93 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 }; | 153 }; |
154 | 154 |
155 // Windows builds did not like SkScalar initialization in class :( | 155 // Windows builds did not like SkScalar initialization in class :( |
156 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 156 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
157 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 157 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
158 | 158 |
159 DEF_GM(return new TextureDomainEffect;) | 159 DEF_GM(return new TextureDomainEffect;) |
160 } | 160 } |
161 | 161 |
162 #endif | 162 #endif |
OLD | NEW |