diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-01 15:32:49 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-01 15:32:49 +0000 |
commit | b82c3993c2f753e5caaff2df9648ebdafc68595f (patch) | |
tree | 12161404431453387c07e3abf86ccee73c0515cc /src/gpu | |
parent | c61c3c310185f6ffaefce194a079159423945191 (diff) |
Revert 7919 and 7920 (committed wrong version of r7919.)
git-svn-id: http://skia.googlecode.com/svn/trunk@7923 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLCreateNullInterface.cpp | 5 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 20 | ||||
-rw-r--r-- | src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp | 3 | ||||
-rw-r--r-- | src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp | 7 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrDebugGL.cpp | 11 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrDebugGL.h | 26 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp | 56 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrVertexArrayObj.h | 21 | ||||
-rw-r--r-- | src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp | 21 | ||||
-rw-r--r-- | src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp | 181 | ||||
-rw-r--r-- | src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp | 7 | ||||
-rw-r--r-- | src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp | 9 |
12 files changed, 126 insertions, 241 deletions
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index ebaacbc1af..da6491a6d5 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -20,7 +20,6 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLAttachShader(GrGLuint program, GrGLuint shade GrGLvoid GR_GL_FUNCTION_TYPE nullGLBeginQuery(GrGLenum target, GrGLuint id) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindAttribLocation(GrGLuint program, GrGLuint index, const char* name) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindTexture(GrGLenum target, GrGLuint texture) {} -GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindVertexArray(GrGLuint id) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLPixelStorei(GrGLenum pname, GrGLint param) {} GrGLvoid GR_GL_FUNCTION_TYPE nullGLReadPixels(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels) {} @@ -47,6 +46,7 @@ GrGLuint GR_GL_FUNCTION_TYPE nullGLCreateShader(GrGLenum type) { GrGLvoid GR_GL_FUNCTION_TYPE nullGLDelete(GrGLuint program) { } + // In debug builds we do asserts that ensure we agree with GL about when a buffer // is mapped. static SkTDArray<GrGLuint> gMappedBuffers; @@ -168,7 +168,6 @@ const GrGLInterface* GrGLCreateNullInterface() { interface->fBindBuffer = nullGLBindBuffer; interface->fBindFragDataLocation = noOpGLBindFragDataLocation; interface->fBindTexture = nullGLBindTexture; - interface->fBindVertexArray = nullGLBindVertexArray; interface->fBlendColor = noOpGLBlendColor; interface->fBlendFunc = noOpGLBlendFunc; interface->fBufferData = nullGLBufferData; @@ -187,7 +186,6 @@ const GrGLInterface* GrGLCreateNullInterface() { interface->fDeleteQueries = noOpGLDeleteIds; interface->fDeleteShader = nullGLDelete; interface->fDeleteTextures = noOpGLDeleteIds; - interface->fDeleteVertexArrays = noOpGLDeleteIds; interface->fDepthMask = noOpGLDepthMask; interface->fDisable = noOpGLDisable; interface->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; @@ -204,7 +202,6 @@ const GrGLInterface* GrGLCreateNullInterface() { interface->fGenBuffers = noOpGLGenIds; interface->fGenQueries = noOpGLGenIds; interface->fGenTextures = noOpGLGenIds; - interface->fGenVertexArrays = noOpGLGenIds; interface->fGetBufferParameteriv = nullGLGetBufferParameteriv; interface->fGetError = noOpGLGetError; interface->fGetIntegerv = noOpGLGetIntegerv; diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index ea9c29ee95..6fcd6ab578 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -349,25 +349,5 @@ bool GrGLInterface::validate(GrGLBinding binding) const { } } - if (kDesktop_GrGLBinding == binding) { - if (glVer >= GR_GL_VER(3, 0) || extensions.has("GL_ARB_vertex_array_object")) { - if (NULL == fBindVertexArray || - NULL == fDeleteVertexArrays || - NULL == fGenVertexArrays) { - return false; - } - } - } else { -#if 0 // Remove this #if once Chromium interfaces set these pointers - if (extensions.has("GL_OES_vertex_array_object")) { - if (NULL == fBindVertexArray || - NULL == fDeleteVertexArrays || - NULL == fGenVertexArrays) { - return false; - } - } -#endif - } - return true; } diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp index b70090dcc5..79a8229ced 100644 --- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp +++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp @@ -26,7 +26,6 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fBindAttribLocation = glBindAttribLocation; interface->fBindBuffer = glBindBuffer; interface->fBindTexture = glBindTexture; - interface->fBindVertexArray = glBindVertexArrayOES; interface->fBlendColor = glBlendColor; interface->fBlendFunc = glBlendFunc; interface->fBufferData = glBufferData; @@ -44,7 +43,6 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fDeleteProgram = glDeleteProgram; interface->fDeleteShader = glDeleteShader; interface->fDeleteTextures = glDeleteTextures; - interface->fDeleteVertexArrays = glDeleteVertexArraysOES; interface->fDepthMask = glDepthMask; interface->fDisable = glDisable; interface->fDisableVertexAttribArray = glDisableVertexAttribArray; @@ -57,7 +55,6 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fFrontFace = glFrontFace; interface->fGenBuffers = glGenBuffers; interface->fGenTextures = glGenTextures; - interface->fGenVertexArrays= glGenVertexArraysOES; interface->fGetBufferParameteriv = glGetBufferParameteriv; interface->fGetError = glGetError; interface->fGetIntegerv = glGetIntegerv; diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp index 5d9b653841..bc1e0ee6c3 100644 --- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp +++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp @@ -44,7 +44,6 @@ const GrGLInterface* GrGLCreateANGLEInterface() { GR_GET_PROC(GrGLBindAttribLocationProc, BindAttribLocation); GR_GET_PROC(GrGLBindBufferProc, BindBuffer); GR_GET_PROC(GrGLBindTextureProc, BindTexture); - interface->fBindVertexArray = (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArrayOES"); GR_GET_PROC(GrGLBlendColorProc, BlendColor); GR_GET_PROC(GrGLBlendFuncProc, BlendFunc); GR_GET_PROC(GrGLBufferDataProc, BufferData); @@ -62,7 +61,6 @@ const GrGLInterface* GrGLCreateANGLEInterface() { GR_GET_PROC(GrGLDeleteProgramProc, DeleteProgram); GR_GET_PROC(GrGLDeleteShaderProc, DeleteShader); GR_GET_PROC(GrGLDeleteTexturesProc, DeleteTextures); - interface->fDeleteVertexArrays = (GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArraysOES"); GR_GET_PROC(GrGLDepthMaskProc, DepthMask); GR_GET_PROC(GrGLDisableProc, Disable); GR_GET_PROC(GrGLDisableVertexAttribArrayProc, DisableVertexAttribArray); @@ -75,7 +73,6 @@ const GrGLInterface* GrGLCreateANGLEInterface() { GR_GET_PROC(GrGLFrontFaceProc, FrontFace); GR_GET_PROC(GrGLGenBuffersProc, GenBuffers); GR_GET_PROC(GrGLGenTexturesProc, GenTextures); - interface->fGenVertexArrays = (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArraysOES"); GR_GET_PROC(GrGLGetBufferParameterivProc, GetBufferParameteriv); GR_GET_PROC(GrGLGetErrorProc, GetError); GR_GET_PROC(GrGLGetIntegervProc, GetIntegerv); @@ -104,7 +101,9 @@ const GrGLInterface* GrGLCreateANGLEInterface() { #if GL_ARB_texture_storage GR_GET_PROC(GrGLTexStorage2DProc, TexStorage2D); #elif GL_EXT_texture_storage - interface->fTexStorage2D = (PFNGLTEXSTORAGE2DEXTPROC) eglGetProcAddress("glTexStorage2DEXT"); + interface->fTexStorage2D = (GrGLTexStorage2DProc) + GetProcAddress(ghANGLELib, + "glTexStorage2DEXT"); #endif GR_GET_PROC(GrGLUniform1fProc, Uniform1f); GR_GET_PROC(GrGLUniform1iProc, Uniform1i); diff --git a/src/gpu/gl/debug/GrDebugGL.cpp b/src/gpu/gl/debug/GrDebugGL.cpp index e59b99890b..9e2e510b1b 100644 --- a/src/gpu/gl/debug/GrDebugGL.cpp +++ b/src/gpu/gl/debug/GrDebugGL.cpp @@ -14,7 +14,7 @@ #include "GrShaderObj.h" #include "GrProgramObj.h" #include "GrTextureUnitObj.h" -#include "GrVertexArrayObj.h" + GrDebugGL* GrDebugGL::gObj = NULL; int GrDebugGL::gStaticRefCount = 0; @@ -26,7 +26,6 @@ GrDebugGL::Create GrDebugGL::gFactoryFunc[kObjTypeCount] = { GrShaderObj::createGrShaderObj, GrProgramObj::createGrProgramObj, GrTextureUnitObj::createGrTextureUnitObj, - GrVertexArrayObj::createGrVertexArrayObj, }; @@ -39,8 +38,7 @@ GrDebugGL::GrDebugGL() , fFrameBuffer(NULL) , fRenderBuffer(NULL) , fProgram(NULL) - , fTexture(NULL) - , fVertexArray(NULL) { + , fTexture(NULL) { for (int i = 0; i < kDefaultMaxTextureUnits; ++i) { @@ -72,7 +70,6 @@ GrDebugGL::~GrDebugGL() { fRenderBuffer = NULL; fProgram = NULL; fTexture = NULL; - fVertexArray = NULL; } GrFakeRefObj *GrDebugGL::findObject(GrGLuint ID, GrObjTypes type) { @@ -110,10 +107,6 @@ void GrDebugGL::setArrayBuffer(GrBufferObj *arrayBuffer) { } } -void GrDebugGL::setVertexArray(GrVertexArrayObj* vertexArray) { - SkRefCnt_SafeAssign(fVertexArray, vertexArray); -} - void GrDebugGL::setElementArrayBuffer(GrBufferObj *elementArrayBuffer) { if (fElementArrayBuffer) { // automatically break the binding of the old buffer diff --git a/src/gpu/gl/debug/GrDebugGL.h b/src/gpu/gl/debug/GrDebugGL.h index e1a28bb834..409f13d106 100644 --- a/src/gpu/gl/debug/GrDebugGL.h +++ b/src/gpu/gl/debug/GrDebugGL.h @@ -12,14 +12,13 @@ #include "SkTArray.h" #include "gl/GrGLInterface.h" -class GrBufferObj; class GrFakeRefObj; +class GrTextureUnitObj; +class GrBufferObj; +class GrTextureObj; class GrFrameBufferObj; -class GrProgramObj; class GrRenderBufferObj; -class GrTextureObj; -class GrTextureUnitObj; -class GrVertexArrayObj; +class GrProgramObj; //////////////////////////////////////////////////////////////////////////////// // This is the main debugging object. It is a singleton and keeps track of @@ -34,7 +33,6 @@ public: kShader_ObjTypes, kProgram_ObjTypes, kTextureUnit_ObjTypes, - kVertexArray_ObjTypes, kObjTypeCount }; @@ -65,9 +63,6 @@ public: void setElementArrayBuffer(GrBufferObj *elementArrayBuffer); GrBufferObj *getElementArrayBuffer() { return fElementArrayBuffer; } - void setVertexArray(GrVertexArrayObj* vertexArray); - GrVertexArrayObj* getVertexArray() { return fVertexArray; } - void setTexture(GrTextureObj *texture); void setFrameBuffer(GrFrameBufferObj *frameBuffer); @@ -124,14 +119,13 @@ private: GrGLint fUnPackRowLength; GrGLuint fMaxTextureUnits; GrGLuint fCurTextureUnit; - GrBufferObj* fArrayBuffer; - GrBufferObj* fElementArrayBuffer; - GrFrameBufferObj* fFrameBuffer; - GrRenderBufferObj* fRenderBuffer; - GrProgramObj* fProgram; - GrTextureObj* fTexture; + GrBufferObj * fArrayBuffer; + GrBufferObj * fElementArrayBuffer; + GrFrameBufferObj *fFrameBuffer; + GrRenderBufferObj *fRenderBuffer; + GrProgramObj * fProgram; + GrTextureObj * fTexture; GrTextureUnitObj *fTextureUnits[kDefaultMaxTextureUnits]; - GrVertexArrayObj *fVertexArray; typedef GrFakeRefObj *(*Create)(); diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index f02184bd1f..21a3d1bf71 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -16,7 +16,6 @@ #include "GrTextureObj.h" #include "GrFrameBufferObj.h" #include "GrRenderBufferObj.h" -#include "GrVertexArrayObj.h" #include "SkFloatingPoint.h" #include "../GrGLNoOpInterface.h" @@ -213,7 +212,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, GrDebugGL::getInstance()->setFrameBuffer(frameBuffer); } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindRenderbuffer(GrGLenum target, GrGLuint renderBufferID) { + GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindRenderbuffer(GrGLenum target, + GrGLuint renderBufferID) { GrAlwaysAssert(GR_GL_RENDERBUFFER == target); @@ -225,7 +225,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, GrDebugGL::getInstance()->setRenderBuffer(renderBuffer); } - GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteTextures(GrGLsizei n, const GrGLuint* textures) { + GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteTextures(GrGLsizei n, + const GrGLuint* textures) { // first potentially unbind the texture // TODO: move this into GrDebugGL as unBindTexture? @@ -286,6 +287,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLReadPixels(GrGLint x, } + GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteFramebuffers(GrGLsizei n, const GrGLuint *frameBuffers) { @@ -516,55 +518,32 @@ GrGLvoid debugGenObjs(GrDebugGL::GrObjTypes type, } GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenBuffers(GrGLsizei n, GrGLuint* ids) { + debugGenObjs(GrDebugGL::kBuffer_ObjTypes, n, ids); } GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenFramebuffers(GrGLsizei n, GrGLuint* ids) { + debugGenObjs(GrDebugGL::kFrameBuffer_ObjTypes, n, ids); } GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenRenderbuffers(GrGLsizei n, GrGLuint* ids) { + debugGenObjs(GrDebugGL::kRenderBuffer_ObjTypes, n, ids); } GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenTextures(GrGLsizei n, GrGLuint* ids) { - debugGenObjs(GrDebugGL::kTexture_ObjTypes, n, ids); -} - -GrGLvoid GR_GL_FUNCTION_TYPE debugGLGenVertexArrays(GrGLsizei n, GrGLuint* ids) { - debugGenObjs(GrDebugGL::kVertexArray_ObjTypes, n, ids); -} - -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteVertexArrays(GrGLsizei n, const GrGLuint* ids) { - for (GrGLsizei i = 0; i < n; ++i) { - GrVertexArrayObj* array = - GR_FIND(ids[i], GrVertexArrayObj, GrDebugGL::kVertexArray_ObjTypes); - GrAlwaysAssert(array); - // Deleting the current vertex array binds object 0 - if (GrDebugGL::getInstance()->getVertexArray() == array) { - GrDebugGL::getInstance()->setVertexArray(NULL); - } - - if (array->getRefCount()) { - // someone is still using this shader so we can't delete it here - array->setMarkedForDeletion(); - } else { - array->deleteAction(); - } - } + debugGenObjs(GrDebugGL::kTexture_ObjTypes, n, ids); } -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindVertexArray(GrGLuint id) { - GrVertexArrayObj* array = GR_FIND(id, GrVertexArrayObj, GrDebugGL::kVertexArray_ObjTypes); - GrAlwaysAssert(array); - GrDebugGL::getInstance()->setVertexArray(array); -} +GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, + GrGLuint bufferID) { -GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, GrGLuint bufferID) { - GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); + GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || + GR_GL_ELEMENT_ARRAY_BUFFER == target); GrBufferObj *buffer = GR_FIND(bufferID, GrBufferObj, @@ -585,7 +564,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLBindBuffer(GrGLenum target, GrGLuint bufferI } // deleting a bound buffer has the side effect of binding 0 -GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, const GrGLuint* ids) { +GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, + const GrGLuint* ids) { // first potentially unbind the buffers for (int i = 0; i < n; ++i) { @@ -615,7 +595,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLDeleteBuffers(GrGLsizei n, const GrGLuint* i } // map a buffer to the caller's address space -GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, GrGLenum access) { +GrGLvoid* GR_GL_FUNCTION_TYPE debugGLMapBuffer(GrGLenum target, + GrGLenum access) { GrAlwaysAssert(GR_GL_ARRAY_BUFFER == target || GR_GL_ELEMENT_ARRAY_BUFFER == target); @@ -786,7 +767,6 @@ const GrGLInterface* GrGLCreateDebugInterface() { interface->fBindBuffer = debugGLBindBuffer; interface->fBindFragDataLocation = noOpGLBindFragDataLocation; interface->fBindTexture = debugGLBindTexture; - interface->fBindVertexArray = debugGLBindVertexArray; interface->fBlendColor = noOpGLBlendColor; interface->fBlendFunc = noOpGLBlendFunc; interface->fBufferData = debugGLBufferData; @@ -805,7 +785,6 @@ const GrGLInterface* GrGLCreateDebugInterface() { interface->fDeleteQueries = noOpGLDeleteIds; interface->fDeleteShader = debugGLDeleteShader; interface->fDeleteTextures = debugGLDeleteTextures; - interface->fDeleteVertexArrays = debugGLDeleteVertexArrays; interface->fDepthMask = noOpGLDepthMask; interface->fDisable = noOpGLDisable; interface->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; @@ -838,7 +817,6 @@ const GrGLInterface* GrGLCreateDebugInterface() { interface->fGetStringi = noOpGLGetStringi; interface->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv; interface->fGetUniformLocation = noOpGLGetUniformLocation; - interface->fGenVertexArrays = debugGLGenVertexArrays; interface->fLineWidth = noOpGLLineWidth; interface->fLinkProgram = noOpGLLinkProgram; interface->fPixelStorei = debugGLPixelStorei; diff --git a/src/gpu/gl/debug/GrVertexArrayObj.h b/src/gpu/gl/debug/GrVertexArrayObj.h deleted file mode 100644 index 989c610924..0000000000 --- a/src/gpu/gl/debug/GrVertexArrayObj.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef GrVertexArrayObj_DEFINED -#define GrVertexArrayObj_DEFINED - -#include "GrFakeRefObj.h" - -class GrVertexArrayObj : public GrFakeRefObj { - GR_DEFINE_CREATOR(GrVertexArrayObj); - -public: - GrVertexArrayObj() : GrFakeRefObj() {} - - typedef GrFakeRefObj INHERITED; -}; -#endif diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp index 5492e19714..2b4dc64df4 100644 --- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp +++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp @@ -79,11 +79,11 @@ const GrGLInterface* GrGLCreateNativeInterface() { // mac uses GLenum for internalFormat param (non-standard) // amounts to int vs. uint. interface->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D; -#if GL_ARB_texture_storage + #if GL_ARB_texture_storage interface->fTexStorage2D = glTexStorage2D; -#elif GL_EXT_texture_storage + #elif GL_EXT_texture_storage interface->fTexStorage2D = glTexStorage2DEXT; -#endif + #endif interface->fTexParameteri = glTexParameteri; interface->fTexParameteriv = glTexParameteriv; interface->fTexSubImage2D = glTexSubImage2D; @@ -124,21 +124,16 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fFramebufferRenderbuffer = glFramebufferRenderbuffer; interface->fBindRenderbuffer = glBindRenderbuffer; -#if GL_OES_mapbuffer + #if GL_OES_mapbuffer interface->fMapBuffer = glMapBufferOES; interface->fUnmapBuffer = glUnmapBufferOES; -#endif + #endif -#if GL_APPLE_framebuffer_multisample + #if GL_APPLE_framebuffer_multisample interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleAPPLE; interface->fResolveMultisampleFramebuffer = glResolveMultisampleFramebufferAPPLE; -#endif - -#if GL_OES_vertex_array_object - interface->fBindVertexArray = glBindVertexArrayOES; - interface->fDeleteVertexArrays = glDeleteVertexArraysOES; - interface->fGenVertexArrays = glGenVertexArraysOES; -#endif + #endif + interface->fBindFragDataLocationIndexed = NULL; interface->fBindingsExported = kES2_GrGLBinding; } diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp index 74dd49b41a..2e1309f196 100644 --- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp +++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp @@ -45,11 +45,11 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fBindAttribLocation = glBindAttribLocation; interface->fBindBuffer = glBindBuffer; if (ver >= GR_GL_VER(3,0)) { -#if GL_VERSION_3_0 - interface->fBindFragDataLocation = glBindFragDataLocation; -#else - GET_PROC(BindFragDataLocation); -#endif + #if GL_VERSION_3_0 + interface->fBindFragDataLocation = glBindFragDataLocation; + #else + interface->fBindFragDataLocation = GET_PROC(BindFragDataLocation); + #endif } interface->fBindTexture = glBindTexture; interface->fBlendFunc = glBlendFunc; @@ -131,17 +131,17 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D; interface->fTexParameteri = glTexParameteri; interface->fTexParameteriv = glTexParameteriv; -#if GL_ARB_texture_storage || GL_VERSION_4_2 + #if GL_ARB_texture_storage || GL_VERSION_4_2 interface->fTexStorage2D = glTexStorage2D -#elif GL_EXT_texture_storage + #elif GL_EXT_texture_storage interface->fTexStorage2D = glTexStorage2DEXT; -#else + #else if (ver >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) { GET_PROC(TexStorage2D); } else if (extensions.has("GL_EXT_texture_storage")) { GET_PROC_SUFFIX(TexStorage2D, EXT); } -#endif + #endif interface->fTexSubImage2D = glTexSubImage2D; interface->fUniform1f = glUniform1f; interface->fUniform1i = glUniform1i; @@ -169,43 +169,30 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fVertexAttribPointer = glVertexAttribPointer; interface->fViewport = glViewport; - if (ver >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) { - // no ARB suffix for GL_ARB_vertex_array_object -#if GL_ARB_vertex_array_object || GL_VERSION_3_0 - interface->fBindVertexArray = glBindVertexArray; - interface->fDeleteVertexArrays = glDeleteVertexArrays; - interface->fGenVertexArrays = glGenVertexArrays; -#else - GET_PROC(BindVertexArray); - GET_PROC(DeleteVertexArrays); - GET_PROC(GenVertexArrays); -#endif - } - if (ver >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) { // ARB extension doesn't use the ARB suffix on the function name -#if GL_ARB_timer_query || GL_VERSION_3_3 - interface->fQueryCounter = glQueryCounter; - interface->fGetQueryObjecti64v = glGetQueryObjecti64v; - interface->fGetQueryObjectui64v = glGetQueryObjectui64v; -#else - GET_PROC(QueryCounter); - GET_PROC(GetQueryObjecti64v); - GET_PROC(GetQueryObjectui64v); -#endif + #if GL_ARB_timer_query || GL_VERSION_3_3 + interface->fQueryCounter = glQueryCounter; + interface->fGetQueryObjecti64v = glGetQueryObjecti64v; + interface->fGetQueryObjectui64v = glGetQueryObjectui64v; + #else + interface->fQueryCounter = GET_PROC(QueryCounter); + interface->fGetQueryObjecti64v = GET_PROC(GetQueryObjecti64v); + interface->fGetQueryObjectui64v = GET_PROC(GetQueryObjectui64v); + #endif } else if (extensions.has("GL_EXT_timer_query")) { -#if GL_EXT_timer_query - interface->fGetQueryObjecti64v = glGetQueryObjecti64vEXT; - interface->fGetQueryObjectui64v = glGetQueryObjectui64vEXT; -#else - GET_PROC_SUFFIX(GetQueryObjecti64v, EXT); - GET_PROC_SUFFIX(GetQueryObjectui64v, EXT); -#endif + #if GL_EXT_timer_query + interface->fGetQueryObjecti64v = glGetQueryObjecti64vEXT; + interface->fGetQueryObjectui64v = glGetQueryObjectui64vEXT; + #else + interface->fGetQueryObjecti64v = GET_PROC_SUFFIX(GetQueryObjecti64v, EXT); + interface->fGetQueryObjectui64v = GET_PROC_SUFFIX(GetQueryObjectui64v, EXT); + #endif } if (ver >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) { // ARB extension doesn't use the ARB suffix on the function names -#if GL_VERSION_3_0 || GL_ARB_framebuffer_object + #if GL_VERSION_3_0 || GL_ARB_framebuffer_object interface->fGenFramebuffers = glGenFramebuffers; interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv; interface->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv; @@ -220,74 +207,74 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fBindRenderbuffer = glBindRenderbuffer; interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisample; interface->fBlitFramebuffer = glBlitFramebuffer; -#else - GET_PROC(GenFramebuffers); - GET_PROC(GetFramebufferAttachmentParameteriv); - GET_PROC(GetRenderbufferParameteriv); - GET_PROC(BindFramebuffer); - GET_PROC(FramebufferTexture2D); - GET_PROC(CheckFramebufferStatus); - GET_PROC(DeleteFramebuffers); - GET_PROC(RenderbufferStorage); - GET_PROC(GenRenderbuffers); - GET_PROC(DeleteRenderbuffers); - GET_PROC(FramebufferRenderbuffer); - GET_PROC(BindRenderbuffer); - GET_PROC(RenderbufferStorageMultisample); - GET_PROC(BlitFramebuffer); -#endif + #else + interface->fGenFramebuffers = GET_PROC(GenFramebuffers); + interface->fGetFramebufferAttachmentParameteriv = GET_PROC(GetFramebufferAttachmentParameteriv); + interface->fGetRenderbufferParameteriv = GET_PROC(GetRenderbufferParameteriv); + interface->fBindFramebuffer = GET_PROC(BindFramebuffer); + interface->fFramebufferTexture2D = GET_PROC(FramebufferTexture2D); + interface->fCheckFramebufferStatus = GET_PROC(CheckFramebufferStatus); + interface->fDeleteFramebuffers = GET_PROC(DeleteFramebuffers); + interface->fRenderbufferStorage = GET_PROC(RenderbufferStorage); + interface->fGenRenderbuffers = GET_PROC(GenRenderbuffers); + interface->fDeleteRenderbuffers = GET_PROC(DeleteRenderbuffers); + interface->fFramebufferRenderbuffer = GET_PROC(FramebufferRenderbuffer); + interface->fBindRenderbuffer = GET_PROC(BindRenderbuffer); + interface->fRenderbufferStorageMultisample = GET_PROC(RenderbufferStorageMultisample); + interface->fBlitFramebuffer = GET_PROC(BlitFramebuffer); + #endif } else { if (extensions.has("GL_EXT_framebuffer_object")) { -#if GL_EXT_framebuffer_object - interface->fGenFramebuffers = glGenFramebuffersEXT; - interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameterivEXT; - interface->fGetRenderbufferParameteriv = glGetRenderbufferParameterivEXT; - interface->fBindFramebuffer = glBindFramebufferEXT; - interface->fFramebufferTexture2D = glFramebufferTexture2DEXT; - interface->fCheckFramebufferStatus = glCheckFramebufferStatusEXT; - interface->fDeleteFramebuffers = glDeleteFramebuffersEXT; - interface->fRenderbufferStorage = glRenderbufferStorageEXT; - interface->fGenRenderbuffers = glGenRenderbuffersEXT; - interface->fDeleteRenderbuffers = glDeleteRenderbuffersEXT; - interface->fFramebufferRenderbuffer = glFramebufferRenderbufferEXT; - interface->fBindRenderbuffer = glBindRenderbufferEXT; -#else - GET_PROC_SUFFIX(GenFramebuffers, EXT); - GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT); - GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT); - GET_PROC_SUFFIX(BindFramebuffer, EXT); - GET_PROC_SUFFIX(FramebufferTexture2D, EXT); - GET_PROC_SUFFIX(CheckFramebufferStatus, EXT); - GET_PROC_SUFFIX(DeleteFramebuffers, EXT); - GET_PROC_SUFFIX(RenderbufferStorage, EXT); - GET_PROC_SUFFIX(GenRenderbuffers, EXT); - GET_PROC_SUFFIX(DeleteRenderbuffers, EXT); - GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT); - GET_PROC_SUFFIX(BindRenderbuffer, EXT); -#endif + #if GL_EXT_framebuffer_object + interface->fGenFramebuffers = glGenFramebuffersEXT; + interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameterivEXT; + interface->fGetRenderbufferParameteriv = glGetRenderbufferParameterivEXT; + interface->fBindFramebuffer = glBindFramebufferEXT; + interface->fFramebufferTexture2D = glFramebufferTexture2DEXT; + interface->fCheckFramebufferStatus = glCheckFramebufferStatusEXT; + interface->fDeleteFramebuffers = glDeleteFramebuffersEXT; + interface->fRenderbufferStorage = glRenderbufferStorageEXT; + interface->fGenRenderbuffers = glGenRenderbuffersEXT; + interface->fDeleteRenderbuffers = glDeleteRenderbuffersEXT; + interface->fFramebufferRenderbuffer = glFramebufferRenderbufferEXT; + interface->fBindRenderbuffer = glBindRenderbufferEXT; + #else + interface->fGenFramebuffers = GET_PROC_SUFFIX(GenFramebuffers, EXT); + interface->fGetFramebufferAttachmentParameteriv = GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT); + interface->fGetRenderbufferParameteriv = GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT); + interface->fBindFramebuffer = GET_PROC_SUFFIX(BindFramebuffer, EXT); + interface->fFramebufferTexture2D = GET_PROC_SUFFIX(FramebufferTexture2D, EXT); + interface->fCheckFramebufferStatus = GET_PROC_SUFFIX(CheckFramebufferStatus, EXT); + interface->fDeleteFramebuffers = GET_PROC_SUFFIX(DeleteFramebuffers, EXT); + interface->fRenderbufferStorage = GET_PROC_SUFFIX(RenderbufferStorage, EXT); + interface->fGenRenderbuffers = GET_PROC_SUFFIX(GenRenderbuffers, EXT); + interface->fDeleteRenderbuffers = GET_PROC_SUFFIX(DeleteRenderbuffers, EXT); + interface->fFramebufferRenderbuffer = GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT); + interface->fBindRenderbuffer = GET_PROC_SUFFIX(BindRenderbuffer, EXT); + #endif } if (extensions.has("GL_EXT_framebuffer_multisample")) { -#if GL_EXT_framebuffer_multisample - interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleEXT; -#else - GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT); -#endif + #if GL_EXT_framebuffer_multisample + interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleEXT; + #else + interface->fRenderbufferStorageMultisample = GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT); + #endif } if (extensions.has("GL_EXT_framebuffer_blit")) { -#if GL_EXT_framebuffer_blit - interface->fBlitFramebuffer = glBlitFramebufferEXT; -#else - GET_PROC_SUFFIX(BlitFramebuffer, EXT); -#endif + #if GL_EXT_framebuffer_blit + interface->fBlitFramebuffer = glBlitFramebufferEXT; + #else + interface->fBlitFramebuffer = GET_PROC_SUFFIX(BlitFramebuffer, EXT); + #endif } } if (ver >= GR_GL_VER(3,3) || extensions.has("GL_ARB_blend_func_extended")) { // ARB extension doesn't use the ARB suffix on the function name -#if GL_VERSION_3_3 || GL_ARB_blend_func_extended - interface->fBindFragDataLocationIndexed = glBindFragDataLocationIndexed; -#else - GET_PROC(BindFragDataLocationIndexed); -#endif + #if GL_VERSION_3_3 || GL_ARB_blend_func_extended + interface->fBindFragDataLocationIndexed = glBindFragDataLocationIndexed; + #else + interface->fBindFragDataLocationIndexed = GET_PROC(BindFragDataLocationIndexed); + #endif } } glInterface.get()->ref(); diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp index 5fdd5c618e..74f6a51d9e 100644 --- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp +++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp @@ -161,13 +161,6 @@ const GrGLInterface* GrGLCreateMesaInterface() { GR_GL_GET_PROC(VertexAttribPointer); GR_GL_GET_PROC(Viewport); - if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) { - // no ARB suffix for GL_ARB_vertex_array_object - GR_GL_GET_PROC(BindVertexArray); - GR_GL_GET_PROC(DeleteVertexArrays); - GR_GL_GET_PROC(GenVertexArrays); - } - // First look for GL3.0 FBO or GL_ARB_framebuffer_object (same since // GL_ARB_framebuffer_object doesn't use ARB suffix.) if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) { diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp index 173b3a39e0..e08d8d4faf 100644 --- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp +++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp @@ -202,16 +202,9 @@ const GrGLInterface* GrGLCreateNativeInterface() { WGL_SET_PROC(VertexAttribPointer); WGL_SET_PROC(BindFragDataLocationIndexed); - if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) { - // no ARB suffix for GL_ARB_vertex_array_object - WGL_SET_PROC(BindVertexArray); - WGL_SET_PROC(DeleteVertexArrays); - WGL_SET_PROC(GenVertexArrays); - } - // First look for GL3.0 FBO or GL_ARB_framebuffer_object (same since // GL_ARB_framebuffer_object doesn't use ARB suffix.) - if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) { + if (glVer > GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) { WGL_SET_PROC(GenFramebuffers); WGL_SET_PROC(GetFramebufferAttachmentParameteriv); WGL_SET_PROC(GetRenderbufferParameteriv); |