diff options
author | Brian Salomon <bsalomon@google.com> | 2017-11-27 10:05:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-27 16:50:26 +0000 |
commit | cf7e1d06bc357d679f8798dc063411efd007231f (patch) | |
tree | a697749e664bbeee324c56ec8cc48e73c57d4a41 /tools/gpu | |
parent | a560c4796f5b83a2e55cf564dc847ad6498164b0 (diff) |
Make EGL test context access GL via GrGLInterface
Bug: skia:7334
Change-Id: I5153ef83ae350648a15d6dc427b03d464258608b
Reviewed-on: https://skia-review.googlesource.com/75980
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/gpu')
-rw-r--r-- | tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp index 7fa88c094a..4a09d2202a 100644 --- a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp +++ b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp @@ -251,7 +251,6 @@ GrGLuint EGLGLTestContext::eglImageToExternalTexture(GrEGLImage image) const { if (!this->gl()->hasExtension("GL_OES_EGL_image_external")) { return 0; } -#ifndef EGL_NO_IMAGE_EXTERNAL typedef GrGLvoid (*EGLImageTargetTexture2DProc)(GrGLenum, GrGLeglImage); EGLImageTargetTexture2DProc glEGLImageTargetTexture2D = @@ -260,27 +259,21 @@ GrGLuint EGLGLTestContext::eglImageToExternalTexture(GrEGLImage image) const { return 0; } GrGLuint texID; - // TODO(kjlubick): Migrate away from using the #define hackery by using the - // function pointers directly, e.g. - // this->gl()->fFunctions.fGenTextures(1, &texID); - glGenTextures(1, &texID); + GR_GL_CALL(this->gl(), GenTextures(1, &texID)); if (!texID) { return 0; } - glBindTexture(GR_GL_TEXTURE_EXTERNAL, texID); - if (glGetError() != GR_GL_NO_ERROR) { - glDeleteTextures(1, &texID); + GR_GL_CALL_NOERRCHECK(this->gl(), BindTexture(GR_GL_TEXTURE_EXTERNAL, texID)); + if (GR_GL_GET_ERROR(this->gl()) != GR_GL_NO_ERROR) { + GR_GL_CALL(this->gl(), DeleteTextures(1, &texID)); return 0; } glEGLImageTargetTexture2D(GR_GL_TEXTURE_EXTERNAL, image); - if (glGetError() != GR_GL_NO_ERROR) { - glDeleteTextures(1, &texID); + if (GR_GL_GET_ERROR(this->gl()) != GR_GL_NO_ERROR) { + GR_GL_CALL(this->gl(), DeleteTextures(1, &texID)); return 0; } return texID; -#else - return 0; -#endif //EGL_NO_IMAGE_EXTERNAL } std::unique_ptr<sk_gpu_test::GLTestContext> EGLGLTestContext::makeNew() const { |