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 #include "Test.h" | 8 #include "Test.h" |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 copyDesc.fWidth = externalTexture->width(); | 75 copyDesc.fWidth = externalTexture->width(); |
76 copyDesc.fHeight = externalTexture->height(); | 76 copyDesc.fHeight = externalTexture->height(); |
77 copyDesc.fFlags = kRenderTarget_GrSurfaceFlag; | 77 copyDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
78 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture( | 78 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture( |
79 copyDesc, SkBudgeted::kYes)); | 79 copyDesc, SkBudgeted::kYes)); |
80 context->copySurface(copy, externalTexture); | 80 context->copySurface(copy, externalTexture); |
81 test_read_pixels(reporter, context, copy, expectedPixelValues); | 81 test_read_pixels(reporter, context, copy, expectedPixelValues); |
82 } | 82 } |
83 | 83 |
84 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { | 84 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { |
85 GrContext* context0 = ctxInfo.fGrContext; | 85 GrContext* context0 = ctxInfo.grContext(); |
86 sk_gpu_test::GLTestContext* glCtx0 = ctxInfo.fGLContext; | 86 sk_gpu_test::GLTestContext* glCtx0 = ctxInfo.glContext(); |
87 | 87 |
88 // Try to create a second GL context and then check if the contexts have nec
essary | 88 // Try to create a second GL context and then check if the contexts have nec
essary |
89 // extensions to run this test. | 89 // extensions to run this test. |
90 | 90 |
91 if (kGLES_GrGLStandard != glCtx0->gl()->fStandard) { | 91 if (kGLES_GrGLStandard != glCtx0->gl()->fStandard) { |
92 return; | 92 return; |
93 } | 93 } |
94 GrGLGpu* gpu0 = static_cast<GrGLGpu*>(context0->getGpu()); | 94 GrGLGpu* gpu0 = static_cast<GrGLGpu*>(context0->getGpu()); |
95 if (!gpu0->glCaps().glslCaps()->externalTextureSupport()) { | 95 if (!gpu0->glCaps().glslCaps()->externalTextureSupport()) { |
96 return; | 96 return; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 test_read_pixels(reporter, context0, externalTextureObj, pixels.get()); | 202 test_read_pixels(reporter, context0, externalTextureObj, pixels.get()); |
203 | 203 |
204 test_write_pixels(reporter, context0, externalTextureObj); | 204 test_write_pixels(reporter, context0, externalTextureObj); |
205 | 205 |
206 test_copy_surface(reporter, context0, externalTextureObj, pixels.get()); | 206 test_copy_surface(reporter, context0, externalTextureObj, pixels.get()); |
207 | 207 |
208 cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, imag
e); | 208 cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, imag
e); |
209 } | 209 } |
210 | 210 |
211 #endif | 211 #endif |
OLD | NEW |