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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 72 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
73 if (nullptr == rt) { | 73 if (nullptr == rt) { |
74 return; | 74 return; |
75 } | 75 } |
76 GrContext* context = rt->getContext(); | 76 GrContext* context = rt->getContext(); |
77 if (nullptr == context) { | 77 if (nullptr == context) { |
78 skiagm::GM::DrawGpuOnlyMessage(canvas); | 78 skiagm::GM::DrawGpuOnlyMessage(canvas); |
79 return; | 79 return; |
80 } | 80 } |
81 | 81 |
82 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); | 82 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt))); |
83 if (!drawContext) { | 83 if (!drawContext) { |
84 return; | 84 return; |
85 } | 85 } |
86 | 86 |
87 SkAutoTUnref<GrTexture> texture[3]; | 87 SkAutoTUnref<GrTexture> texture[3]; |
88 texture[0].reset(GrRefCachedBitmapTexture(context, fBmp[0], | 88 texture[0].reset(GrRefCachedBitmapTexture(context, fBmp[0], |
89 GrTextureParams::ClampBilerp()
)); | 89 GrTextureParams::ClampBilerp()
)); |
90 texture[1].reset(GrRefCachedBitmapTexture(context, fBmp[1], | 90 texture[1].reset(GrRefCachedBitmapTexture(context, fBmp[1], |
91 GrTextureParams::ClampBilerp()
)); | 91 GrTextureParams::ClampBilerp()
)); |
92 texture[2].reset(GrRefCachedBitmapTexture(context, fBmp[2], | 92 texture[2].reset(GrRefCachedBitmapTexture(context, fBmp[2], |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 private: | 141 private: |
142 SkBitmap fBmp[3]; | 142 SkBitmap fBmp[3]; |
143 | 143 |
144 typedef GM INHERITED; | 144 typedef GM INHERITED; |
145 }; | 145 }; |
146 | 146 |
147 DEF_GM(return new YUVtoRGBEffect;) | 147 DEF_GM(return new YUVtoRGBEffect;) |
148 } | 148 } |
149 | 149 |
150 #endif | 150 #endif |
OLD | NEW |