Get EGLimage functions out of GrGLInterface.
Only used in test code which can just directly call these.
Also removed related code in interface assemble/validate generator.
Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 014e51f..7732c03 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -325,10 +325,6 @@
/* EXT_window_rectangles */
GrGLFunction<GrGLWindowRectanglesFn> fWindowRectangles;
-
- /* EGL functions */
- GrGLFunction<GrEGLCreateImageFn> fEGLCreateImage;
- GrGLFunction<GrEGLDestroyImageFn> fEGLDestroyImage;
} fFunctions;
#if GR_TEST_UTILS
diff --git a/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp b/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp
index 73aacc1..41411dc 100644
--- a/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp
+++ b/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp
@@ -416,14 +416,6 @@
GET_PROC_SUFFIX(WindowRectangles, EXT);
}
- if (extensions.has("EGL_KHR_image")) {
- GET_EGL_PROC_SUFFIX(CreateImage, KHR);
- GET_EGL_PROC_SUFFIX(DestroyImage, KHR);
- } else if (extensions.has("EGL_KHR_image_base")) {
- GET_EGL_PROC_SUFFIX(CreateImage, KHR);
- GET_EGL_PROC_SUFFIX(DestroyImage, KHR);
- }
-
if (glVer >= GR_GL_VER(3,0)) {
GET_PROC(ClientWaitSync);
GET_PROC(DeleteSync);
diff --git a/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp b/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp
index b39d9d9..f47b3b0 100644
--- a/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp
+++ b/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp
@@ -394,14 +394,6 @@
GET_PROC_SUFFIX(WindowRectangles, EXT);
}
- if (extensions.has("EGL_KHR_image")) {
- GET_EGL_PROC_SUFFIX(CreateImage, KHR);
- GET_EGL_PROC_SUFFIX(DestroyImage, KHR);
- } else if (extensions.has("EGL_KHR_image_base")) {
- GET_EGL_PROC_SUFFIX(CreateImage, KHR);
- GET_EGL_PROC_SUFFIX(DestroyImage, KHR);
- }
-
if (glVer >= GR_GL_VER(3,2)) {
GET_PROC(ClientWaitSync);
GET_PROC(DeleteSync);
diff --git a/src/gpu/gl/GrGLInterfaceAutogen.cpp b/src/gpu/gl/GrGLInterfaceAutogen.cpp
index c2c8a5e..f9ec236 100644
--- a/src/gpu/gl/GrGLInterfaceAutogen.cpp
+++ b/src/gpu/gl/GrGLInterfaceAutogen.cpp
@@ -581,18 +581,6 @@
}
if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("EGL_KHR_image") ||
- fExtensions.has("EGL_KHR_image_base"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("EGL_KHR_image") ||
- fExtensions.has("EGL_KHR_image_base")))) {
- if (!fFunctions.fEGLCreateImage ||
- !fFunctions.fEGLDestroyImage) {
- RETURN_FALSE_INTERFACE;
- }
- }
-
- if ((GR_IS_GR_GL(fStandard) && (
(glVer >= GR_GL_VER(3,2)) ||
fExtensions.has("GL_ARB_sync"))) ||
(GR_IS_GR_GL_ES(fStandard) && (
diff --git a/tools/gpu/gl/angle/GLTestContext_angle.cpp b/tools/gpu/gl/angle/GLTestContext_angle.cpp
index d553b49..3d58809 100644
--- a/tools/gpu/gl/angle/GLTestContext_angle.cpp
+++ b/tools/gpu/gl/angle/GLTestContext_angle.cpp
@@ -296,21 +296,15 @@
if (!this->gl()->hasExtension("EGL_KHR_gl_texture_2D_image")) {
return GR_EGL_NO_IMAGE;
}
- GrEGLImage img;
- GrEGLint attribs[] = { GR_EGL_GL_TEXTURE_LEVEL, 0,
- GR_EGL_IMAGE_PRESERVED, GR_EGL_TRUE,
- GR_EGL_NONE };
+ EGLAttrib attribs[] = { GR_EGL_GL_TEXTURE_LEVEL, 0,
+ GR_EGL_IMAGE_PRESERVED, GR_EGL_TRUE,
+ GR_EGL_NONE };
// 64 bit cast is to shut Visual C++ up about casting 32 bit value to a pointer.
GrEGLClientBuffer clientBuffer = reinterpret_cast<GrEGLClientBuffer>((uint64_t)texID);
- GR_GL_CALL_RET(this->gl(), img,
- EGLCreateImage(fDisplay, fContext, GR_EGL_GL_TEXTURE_2D, clientBuffer,
- attribs));
- return img;
+ return eglCreateImage(fDisplay, fContext, GR_EGL_GL_TEXTURE_2D, clientBuffer, attribs);
}
-void ANGLEGLContext::destroyEGLImage(GrEGLImage image) const {
- GR_GL_CALL(this->gl(), EGLDestroyImage(fDisplay, image));
-}
+void ANGLEGLContext::destroyEGLImage(GrEGLImage image) const { eglDestroyImage(fDisplay, image); }
GrGLuint ANGLEGLContext::eglImageToExternalTexture(GrEGLImage image) const {
GrGLClearErr(this->gl());
diff --git a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
index aefcc35..4abc20b 100644
--- a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
+++ b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
@@ -8,6 +8,8 @@
#include "tools/gpu/gl/GLTestContext.h"
#define GL_GLEXT_PROTOTYPES
+#define EGL_EGLEXT_PROTOTYPES
+
#include <GLES2/gl2.h>
#include <EGL/egl.h>
@@ -243,16 +245,13 @@
if (!this->gl()->hasExtension("EGL_KHR_gl_texture_2D_image")) {
return GR_EGL_NO_IMAGE;
}
- GrEGLImage img;
- GrEGLint attribs[] = { GR_EGL_GL_TEXTURE_LEVEL, 0, GR_EGL_NONE };
+ EGLint attribs[] = { GR_EGL_GL_TEXTURE_LEVEL, 0, GR_EGL_NONE };
GrEGLClientBuffer clientBuffer = reinterpret_cast<GrEGLClientBuffer>(texID);
- GR_GL_CALL_RET(this->gl(), img,
- EGLCreateImage(fDisplay, fContext, GR_EGL_GL_TEXTURE_2D, clientBuffer, attribs));
- return img;
+ return eglCreateImageKHR(fDisplay, fContext, GR_EGL_GL_TEXTURE_2D, clientBuffer, attribs);
}
void EGLGLTestContext::destroyEGLImage(GrEGLImage image) const {
- GR_GL_CALL(this->gl(), EGLDestroyImage(fDisplay, image));
+ eglDestroyImageKHR(fDisplay, image);
}
GrGLuint EGLGLTestContext::eglImageToExternalTexture(GrEGLImage image) const {
diff --git a/tools/gpu/gl/interface/gen_interface.go b/tools/gpu/gl/interface/gen_interface.go
index 17b8e02..6eb94a5 100644
--- a/tools/gpu/gl/interface/gen_interface.go
+++ b/tools/gpu/gl/interface/gen_interface.go
@@ -54,7 +54,6 @@
TestOnlyFunctions []string `json:"test_functions"`
Required bool `json:"required"`
- EGLProc bool `json:"egl_proc"`
}
// Requirement lists how we know if a function exists. Extension is the
@@ -126,7 +125,6 @@
if len(reqs) == 0 {
continue
}
- isEGL := feature.EGLProc
// blocks holds all the if blocks generated - it will be joined with else
// after and appended to content
blocks := []string{}
@@ -150,13 +148,13 @@
// sort for determinism
sort.Strings(feature.Functions)
for _, function := range feature.Functions {
- block = assembleFunction(block, ifExpr, function, isEGL, req)
+ block = assembleFunction(block, ifExpr, function, req)
}
sort.Strings(feature.TestOnlyFunctions)
if len(feature.TestOnlyFunctions) > 0 {
block += "#if GR_TEST_UTILS\n"
for _, function := range feature.TestOnlyFunctions {
- block = assembleFunction(block, ifExpr, function, isEGL, req)
+ block = assembleFunction(block, ifExpr, function, req)
}
block += "#endif\n"
}
@@ -198,7 +196,7 @@
// assembleFunction is a little helper that will add a function to the interface
// using an appropriate macro (e.g. if the function is added)
// with an extension.
-func assembleFunction(block, ifExpr, function string, isEGL bool, req Requirement) string {
+func assembleFunction(block, ifExpr, function string, req Requirement) string {
if ifExpr != "" {
// extra tab for being in an if statement
block += SPACER
@@ -213,9 +211,7 @@
if req.SuffixOverride != nil {
suffix = *req.SuffixOverride
}
- if isEGL {
- block = addLine(block, fmt.Sprintf("GET_EGL_PROC_SUFFIX(%s, %s);", function, suffix))
- } else if req.Extension == CORE_FEATURE || suffix == "" {
+ if req.Extension == CORE_FEATURE || suffix == "" {
block = addLine(block, fmt.Sprintf("GET_PROC(%s);", function))
} else if req.Extension != "" {
block = addLine(block, fmt.Sprintf("GET_PROC_SUFFIX(%s, %s);", function, suffix))
@@ -255,10 +251,9 @@
// driveSuffix returns the suffix of the function associated with the given
// extension.
func deriveSuffix(ext string) string {
- // Some extensions begin with GL_ or EGL_ and then have the actual
+ // Some extensions begin with GL_ and then have the actual
// extension like KHR, EXT etc.
ext = strings.TrimPrefix(ext, "GL_")
- ext = strings.TrimPrefix(ext, "EGL_")
return strings.Split(ext, "_")[0]
}
@@ -359,22 +354,14 @@
if in(function, feature.OptionalFunctions) {
continue
}
- if feature.EGLProc {
- checks = append(checks, "!fFunctions.fEGL"+function)
- } else {
- checks = append(checks, "!fFunctions.f"+function)
- }
+ checks = append(checks, "!fFunctions.f"+function)
}
testOnly := []string{}
for _, function := range feature.TestOnlyFunctions {
if in(function, feature.OptionalFunctions) {
continue
}
- if feature.EGLProc {
- testOnly = append(testOnly, "!fFunctions.fEGL"+function)
- } else {
- testOnly = append(testOnly, "!fFunctions.f"+function)
- }
+ testOnly = append(testOnly, "!fFunctions.f"+function)
}
for _, hcf := range feature.HardCodeFunctions {
checks = append(checks, "!fFunctions."+hcf.PtrName)
diff --git a/tools/gpu/gl/interface/interface.json5 b/tools/gpu/gl/interface/interface.json5
index 731712e..410ae34 100644
--- a/tools/gpu/gl/interface/interface.json5
+++ b/tools/gpu/gl/interface/interface.json5
@@ -540,19 +540,6 @@
},
{
- "GL": [{"ext": "EGL_KHR_image"},
- {"ext": "EGL_KHR_image_base"}],
- "GLES": [{"ext": "EGL_KHR_image"},
- {"ext": "EGL_KHR_image_base"}],
- "WebGL": null,
-
- "functions": [
- "CreateImage", "DestroyImage",
- ],
- "egl_proc": true
- },
-
- {
"GL": [{"min_version": [3, 2], "ext": "<core>"},
{/* else if */ "ext": "GL_ARB_sync"}],
"GLES": [{"min_version": [3, 0], "ext": "<core>"},