diff options
author | csmartdalton <csmartdalton@google.com> | 2016-08-09 12:42:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 12:42:47 -0700 |
commit | 9bc1187249f27ffed448b49ad75fd226d8181241 (patch) | |
tree | 8d7c76ace097f356523e6f57936994cdbe90920b /src/gpu/gl | |
parent | b47cd4b3d6daad037651daa20fae6770285966d6 (diff) |
Include EXT_window_rectangles API
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221393004
Review-Url: https://codereview.chromium.org/2221393004
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/GrGLDefines.h | 5 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 6 |
4 files changed, 25 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index 539d1ae0bc..2233005b6a 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -511,6 +511,10 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { GET_PROC(ObjectLabel); } + if (extensions.has("GL_EXT_window_rectangles")) { + GET_PROC_SUFFIX(WindowRectangles, EXT); + } + if (extensions.has("EGL_KHR_image") || extensions.has("EGL_KHR_image_base")) { GET_EGL_PROC_SUFFIX(CreateImage, KHR); GET_EGL_PROC_SUFFIX(DestroyImage, KHR); @@ -897,6 +901,10 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(BindUniformLocation, CHROMIUM); } + if (extensions.has("GL_EXT_window_rectangles")) { + GET_PROC_SUFFIX(WindowRectangles, EXT); + } + if (extensions.has("EGL_KHR_image") || extensions.has("EGL_KHR_image_base")) { GET_EGL_PROC_SUFFIX(CreateImage, KHR); GET_EGL_PROC_SUFFIX(DestroyImage, KHR); diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index ea02d21c90..2c9990fa25 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -462,6 +462,12 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, } fMaxColorSampleCount = fMaxStencilSampleCount; + if (ctxInfo.hasExtension("GL_EXT_window_rectangles")) { + GR_GL_GetIntegerv(gli, GR_GL_MAX_WINDOW_RECTANGLES, &fMaxWindowRectangles); + // Protect ourselves against tracking huge amounts of window rectangle state. + fMaxWindowRectangles = SkTMin(31, fMaxWindowRectangles); + } + if (kPowerVR54x_GrGLRenderer == ctxInfo.renderer() || kPowerVRRogue_GrGLRenderer == ctxInfo.renderer() || kAdreno3xx_GrGLRenderer == ctxInfo.renderer()) { diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index 2fe22bd0a3..8cd3751907 100644 --- a/src/gpu/gl/GrGLDefines.h +++ b/src/gpu/gl/GrGLDefines.h @@ -962,6 +962,11 @@ /* GL_ARB_texture_rectangle */ #define GR_GL_TEXTURE_RECTANGLE 0x84F5 +/* GL_EXT_window_rectangles */ +#define GR_GL_MAX_WINDOW_RECTANGLES 0x8f14 +#define GR_GL_INCLUSIVE 0x8f10 +#define GR_GL_EXCLUSIVE 0x8f11 + /* EGL Defines */ #define GR_EGL_NO_DISPLAY ((GrEGLDisplay)0) #define GR_EGL_EXTENSIONS 0x3055 diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index d11a86b15a..ada6d8bc29 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -769,6 +769,12 @@ bool GrGLInterface::validate() const { } } + if (fExtensions.has("GL_EXT_window_rectangles")) { + if (nullptr == fFunctions.fWindowRectangles) { + RETURN_FALSE_INTERFACE + } + } + if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,0)) || fExtensions.has("GL_ARB_sample_shading")) { if (nullptr == fFunctions.fMinSampleShading) { |