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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(EGLImageTest, reporter, context0, glCtx0) { | 82 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(EGLImageTest, reporter, context0, glCtx0) { |
83 // Try to create a second GL context and then check if the contexts have nec
essary | 83 // Try to create a second GL context and then check if the contexts have nec
essary |
84 // extensions to run this test. | 84 // extensions to run this test. |
85 | 85 |
86 if (kGLES_GrGLStandard != glCtx0->gl()->fStandard) { | 86 if (kGLES_GrGLStandard != glCtx0->gl()->fStandard) { |
87 return; | 87 return; |
88 } | 88 } |
89 GrGLGpu* gpu0 = static_cast<GrGLGpu*>(context0->getGpu()); | 89 GrGLGpu* gpu0 = static_cast<GrGLGpu*>(context0->getGpu()); |
90 if (!gpu0->glCaps().externalTextureSupport()) { | 90 if (!gpu0->glCaps().glslCaps()->externalTextureSupport()) { |
91 return; | 91 return; |
92 } | 92 } |
93 | 93 |
94 SkAutoTDelete<SkGLContext> glCtx1 = glCtx0->createNew(); | 94 SkAutoTDelete<SkGLContext> glCtx1 = glCtx0->createNew(); |
95 if (!glCtx1) { | 95 if (!glCtx1) { |
96 return; | 96 return; |
97 } | 97 } |
98 GrContext* context1 = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext
)glCtx1->gl()); | 98 GrContext* context1 = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext
)glCtx1->gl()); |
99 const GrGLTextureInfo* backendTexture1 = nullptr; | 99 const GrGLTextureInfo* backendTexture1 = nullptr; |
100 GrEGLImage image = GR_EGL_NO_IMAGE; | 100 GrEGLImage image = GR_EGL_NO_IMAGE; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 test_read_pixels(reporter, context0, externalTextureObj, pixels.get()); | 197 test_read_pixels(reporter, context0, externalTextureObj, pixels.get()); |
198 | 198 |
199 test_write_pixels(reporter, context0, externalTextureObj); | 199 test_write_pixels(reporter, context0, externalTextureObj); |
200 | 200 |
201 test_copy_surface(reporter, context0, externalTextureObj, pixels.get()); | 201 test_copy_surface(reporter, context0, externalTextureObj, pixels.get()); |
202 | 202 |
203 cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, imag
e); | 203 cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, imag
e); |
204 } | 204 } |
205 | 205 |
206 #endif | 206 #endif |
OLD | NEW |