GrGLInterface.cpp revision f4e67e3e5e5017284300a61e7bb046723a44b0cf
1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/* 2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2011 Google Inc. 3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * 4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be 5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file. 659a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com */ 759a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com 859a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com 96bf38b59c9de1cd35cd091cf8766117f4e1f66a0tomhudson@google.com#include "gl/GrGLInterface.h" 101744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com#include "gl/GrGLExtensions.h" 111744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com#include "gl/GrGLUtil.h" 1259a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com 1359a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com#include <stdio.h> 1459a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com 1556bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#if GR_GL_PER_GL_FUNC_CALLBACK 1656bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.comnamespace { 1756bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.comvoid GrGLDefaultInterfaceCallback(const GrGLInterface*) {} 1856bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com} 1956bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#endif 2056bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com 21a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.orgconst GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interface, 22a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org GrGLInsertEventMarkerProc insertEventMarkerFn, 23a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org GrGLPushGroupMarkerProc pushGroupMarkerFn, 24a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org GrGLPopGroupMarkerProc popGroupMarkerFn) { 25a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org GrGLInterface* newInterface = GrGLInterface::NewClone(interface); 26a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org 27a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org if (!newInterface->fExtensions.has("GL_EXT_debug_marker")) { 28a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org newInterface->fExtensions.add("GL_EXT_debug_marker"); 29a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org } 30a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org 31f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fInsertEventMarker = insertEventMarkerFn; 32f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPushGroupMarker = pushGroupMarkerFn; 33f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn; 34a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org 35a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org return newInterface; 36a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org} 37a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org 38d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.orgconst GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { 39d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org GrGLInterface* newInterface = GrGLInterface::NewClone(interface); 40d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org 41d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org newInterface->fExtensions.remove("GL_NV_path_rendering"); 42d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org 43f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathCommands = NULL; 44f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathCoords = NULL; 45f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathSubCommands = NULL; 46f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathSubCoords = NULL; 47f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathString = NULL; 48f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathGlyphs = NULL; 49f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathGlyphRange = NULL; 50f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fWeightPaths = NULL; 51f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fCopyPath = NULL; 52f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fInterpolatePaths = NULL; 53f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fTransformPath = NULL; 54f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathParameteriv = NULL; 55f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathParameteri = NULL; 56f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathParameterfv = NULL; 57f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathParameterf = NULL; 58f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathDashArray = NULL; 59f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGenPaths = NULL; 60f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fDeletePaths = NULL; 61f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fIsPath = NULL; 62f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathStencilFunc = NULL; 63f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathStencilDepthOffset = NULL; 64f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fStencilFillPath = NULL; 65f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fStencilStrokePath = NULL; 66f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fStencilFillPathInstanced = NULL; 67f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fStencilStrokePathInstanced = NULL; 68f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathCoverDepthFunc = NULL; 69f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathColorGen = NULL; 70f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathTexGen = NULL; 71f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPathFogGen = NULL; 72f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fCoverFillPath = NULL; 73f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fCoverStrokePath = NULL; 74f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fCoverFillPathInstanced = NULL; 75f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fCoverStrokePathInstanced = NULL; 76f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathParameteriv = NULL; 77f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathParameterfv = NULL; 78f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathCommands = NULL; 79f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathCoords = NULL; 80f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathDashArray = NULL; 81f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathMetrics = NULL; 82f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathMetricRange = NULL; 83f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathSpacing = NULL; 84f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathColorGeniv = NULL; 85f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathColorGenfv = NULL; 86f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathTexGeniv = NULL; 87f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathTexGenfv = NULL; 88f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fIsPointInFillPath = NULL; 89f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fIsPointInStrokePath = NULL; 90f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fGetPathLength = NULL; 91f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.org newInterface->fFunctions.fPointAlongPath = NULL; 92d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org 93d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org return newInterface; 94d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org} 95d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org 96f535561b3baeb5f19c5b81fb439818bdde00d882commit-bot@chromium.orgGrGLInterface::GrGLInterface() { 979e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org fStandard = kNone_GrGLStandard; 980b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com 9956bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#if GR_GL_PER_GL_FUNC_CALLBACK 10056bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com fCallback = GrGLDefaultInterfaceCallback; 10156bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com fCallbackData = 0; 10256bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#endif 1030b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com} 1040b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com 105d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.orgGrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) { 106d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org SkASSERT(NULL != interface); 107d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org 108d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org GrGLInterface* clone = SkNEW(GrGLInterface); 109d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org clone->fStandard = interface->fStandard; 110d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org clone->fExtensions = interface->fExtensions; 111d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org clone->fFunctions = interface->fFunctions; 112d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org#if GR_GL_PER_GL_FUNC_CALLBACK 113d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org clone->fCallback = interface->fCallback; 114d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org clone->fCallbackData = interface->fCallbackData; 115d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org#endif 116d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org return clone; 117d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org} 118d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org 119adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org#define RETURN_FALSE_INTERFACE \ 120adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org GrDebugCrash("GrGLInterface::validate() failed."); \ 121adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org return false; \ 122adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org 1239e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.orgbool GrGLInterface::validate() const { 124bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 1259e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kNone_GrGLStandard == fStandard) { 126adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 127bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 12812eea2b10d6caaafe0a207d10b1e9322510983a2skia.committer@gmail.com 12990313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (!fExtensions.isInitialized()) { 130adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 1311744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com } 132bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 133bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // functions that are always required 134c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fActiveTexture || 135c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fAttachShader || 136c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBindAttribLocation || 137c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBindBuffer || 138c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBindTexture || 139c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBlendFunc || 140c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension 141c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBufferData || 142c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBufferSubData || 143c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fClear || 144c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fClearColor || 145c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fClearStencil || 146c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fColorMask || 147c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCompileShader || 148c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCopyTexSubImage2D || 149c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCreateProgram || 150c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCreateShader || 151c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCullFace || 152c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteBuffers || 153c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteProgram || 154c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteShader || 155c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteTextures || 156c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDepthMask || 157c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDisable || 158c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDisableVertexAttribArray || 159c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDrawArrays || 160c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDrawElements || 161c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fEnable || 162c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fEnableVertexAttribArray || 163c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fFrontFace || 164c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenBuffers || 165c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenTextures || 166c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetBufferParameteriv || 167c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenerateMipmap || 168c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetError || 169c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetIntegerv || 170c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetProgramInfoLog || 171c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetProgramiv || 172c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetShaderInfoLog || 173c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetShaderiv || 174c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetString || 175c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetUniformLocation || 176c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fLinkProgram || 177c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fLineWidth || 178c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPixelStorei || 179c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fReadPixels || 180c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fScissor || 181c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fShaderSource || 182c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilFunc || 183c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilMask || 184c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilOp || 185c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fTexImage2D || 186c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fTexParameteri || 187c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fTexParameteriv || 188c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fTexSubImage2D || 189c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform1f || 190c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform1i || 191c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform1fv || 192c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform1iv || 193c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform2f || 194c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform2i || 195c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform2fv || 196c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform2iv || 197c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform3f || 198c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform3i || 199c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform3fv || 200c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform3iv || 201c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform4f || 202c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform4i || 203c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform4fv || 204c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniform4iv || 205c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniformMatrix2fv || 206c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniformMatrix3fv || 207c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUniformMatrix4fv || 208c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUseProgram || 209c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fVertexAttrib4fv || 210c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fVertexAttribPointer || 211c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fViewport || 212c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBindFramebuffer || 213c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBindRenderbuffer || 214c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCheckFramebufferStatus || 215c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteFramebuffers || 216c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteRenderbuffers || 217c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fFinish || 218c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fFlush || 219c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fFramebufferRenderbuffer || 220c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fFramebufferTexture2D || 221c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetFramebufferAttachmentParameteriv || 222c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetRenderbufferParameteriv || 223c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenFramebuffers || 224c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenRenderbuffers || 225c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fRenderbufferStorage) { 226adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 227bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 228bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 229c82b8899d97c2a26f5991bc771ad3beb8257edaebsalomon@google.com GrGLVersion glVer = GrGLGetVersion(this); 230f4e67e3e5e5017284300a61e7bb046723a44b0cfcommit-bot@chromium.org if (GR_GL_INVALID_VER == glVer) { 231f4e67e3e5e5017284300a61e7bb046723a44b0cfcommit-bot@chromium.org RETURN_FALSE_INTERFACE 232f4e67e3e5e5017284300a61e7bb046723a44b0cfcommit-bot@chromium.org } 233bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 234bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // Now check that baseline ES/Desktop fns not covered above are present 23590313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org // and that we have fn pointers for any advertised fExtensions that we will 236bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // try to use. 237bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 238bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // these functions are part of ES2, we assume they are available 239bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // On the desktop we assume they are available if the extension 240bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // is present or GL version is high enough. 2419e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGLES_GrGLStandard == fStandard) { 242c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fStencilFuncSeparate || 243c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilMaskSeparate || 244c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilOpSeparate) { 245adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 246bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 2479e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org } else if (kGL_GrGLStandard == fStandard) { 248e788430144d1474329878abd1ddb39cc0ca52a0arobertphillips@google.com 249c82b8899d97c2a26f5991bc771ad3beb8257edaebsalomon@google.com if (glVer >= GR_GL_VER(2,0)) { 250c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fStencilFuncSeparate || 251c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilMaskSeparate || 252c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilOpSeparate) { 253adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 254bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 255bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 256c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation) { 257adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 258bc5cf51627505f763586100675aa60b66d743c7ebsalomon@google.com } 25990313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) { 260c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fDrawBuffers) { 261adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 262d32c5f564e4aa9ada2650e07d3856d5b21cd2138bsalomon@google.com } 263d32c5f564e4aa9ada2650e07d3856d5b21cd2138bsalomon@google.com } 264e788430144d1474329878abd1ddb39cc0ca52a0arobertphillips@google.com 26590313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")) { 266c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fGenQueries || 267c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteQueries || 268c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBeginQuery || 269c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fEndQuery || 270c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetQueryiv || 271c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetQueryObjectiv || 272c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetQueryObjectuiv) { 273adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 274373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com } 275373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com } 276373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com if (glVer >= GR_GL_VER(3,3) || 27790313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org fExtensions.has("GL_ARB_timer_query") || 27890313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org fExtensions.has("GL_EXT_timer_query")) { 279c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fGetQueryObjecti64v || 280c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetQueryObjectui64v) { 281adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 282373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com } 283373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com } 28490313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { 285c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fQueryCounter) { 286adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 287373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com } 288373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com } 289f66967243c3732523c2035f7d6dbf65c2d20b264commit-bot@chromium.org if (fExtensions.has("GL_EXT_direct_state_access")) { 290f66967243c3732523c2035f7d6dbf65c2d20b264commit-bot@chromium.org if (NULL == fFunctions.fMatrixLoadf || 291f66967243c3732523c2035f7d6dbf65c2d20b264commit-bot@chromium.org NULL == fFunctions.fMatrixLoadIdentity) { 292adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 29346fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org } 294fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com } 295d8ed85101ee77ad2cb0c186a79d197698a75d246commit-bot@chromium.org if (fExtensions.has("GL_NV_path_rendering")) { 296c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fPathCommands || 297c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathCoords || 298c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathSubCommands || 299c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathSubCoords || 300c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathString || 301c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathGlyphs || 302c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathGlyphRange || 303c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fWeightPaths || 304c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCopyPath || 305c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fInterpolatePaths || 306c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fTransformPath || 307c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathParameteriv || 308c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathParameteri || 309c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathParameterfv || 310c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathParameterf || 311c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathDashArray || 312c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenPaths || 313c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeletePaths || 314c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fIsPath || 315c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathStencilFunc || 316c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathStencilDepthOffset || 317c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilFillPath || 318c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilStrokePath || 319c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilFillPathInstanced || 320c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fStencilStrokePathInstanced || 321c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathCoverDepthFunc || 322c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathColorGen || 323c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathTexGen || 324c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPathFogGen || 325c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCoverFillPath || 326c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCoverStrokePath || 327c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCoverFillPathInstanced || 328c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fCoverStrokePathInstanced || 329c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathParameteriv || 330c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathParameterfv || 331c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathCommands || 332c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathCoords || 333c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathDashArray || 334c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathMetrics || 335c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathMetricRange || 336c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathSpacing || 337c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathColorGeniv || 338c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathColorGenfv || 339c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathTexGeniv || 340c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathTexGenfv || 341c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fIsPointInFillPath || 342c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fIsPointInStrokePath || 343c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGetPathLength || 344c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fPointAlongPath) { 345adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 346fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com } 347fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com } 348bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 349bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 350bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // optional function on desktop before 1.3 3519e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGL_GrGLStandard != fStandard || 3521744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com (glVer >= GR_GL_VER(1,3)) || 35390313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org fExtensions.has("GL_ARB_texture_compression")) { 354c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fCompressedTexImage2D) { 355adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 356bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 357bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 358bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 359d32c5f564e4aa9ada2650e07d3856d5b21cd2138bsalomon@google.com // part of desktop GL, but not ES 3609e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGL_GrGLStandard == fStandard && 361c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org (NULL == fFunctions.fGetTexLevelParameteriv || 362c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDrawBuffer || 363c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fReadBuffer)) { 364adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 365bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 366cee661af926cc977addc6e039b7022975a448acebsalomon@google.com 367280e99f1a61f2cf66a8ee9b9e6c517f3d2290de7bsalomon@google.com // GL_EXT_texture_storage is part of desktop 4.2 368280e99f1a61f2cf66a8ee9b9e6c517f3d2290de7bsalomon@google.com // There is a desktop ARB extension and an ES+desktop EXT extension 3699e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGL_GrGLStandard == fStandard) { 370baa9ea10f9b704f42efc804e7401e0aa519b3e29bsalomon@google.com if (glVer >= GR_GL_VER(4,2) || 37190313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org fExtensions.has("GL_ARB_texture_storage") || 37290313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org fExtensions.has("GL_EXT_texture_storage")) { 373c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fTexStorage2D) { 374adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 375baa9ea10f9b704f42efc804e7401e0aa519b3e29bsalomon@google.com } 376baa9ea10f9b704f42efc804e7401e0aa519b3e29bsalomon@google.com } 37790313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) { 378c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fTexStorage2D) { 379adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 380baa9ea10f9b704f42efc804e7401e0aa519b3e29bsalomon@google.com } 381280e99f1a61f2cf66a8ee9b9e6c517f3d2290de7bsalomon@google.com } 382280e99f1a61f2cf66a8ee9b9e6c517f3d2290de7bsalomon@google.com 38390313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (fExtensions.has("GL_EXT_discard_framebuffer")) { 384a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com// FIXME: Remove this once Chromium is updated to provide this function 385a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com#if 0 386c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fDiscardFramebuffer) { 387adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 388a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com } 389a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com#endif 390a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com } 391a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com 392bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // FBO MSAA 3939e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGL_GrGLStandard == fStandard) { 394bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // GL 3.0 and the ARB extension have multisample + blit 39590313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_object")) { 396c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fRenderbufferStorageMultisample || 397c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBlitFramebuffer) { 398adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 399bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 400bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } else { 40190313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (fExtensions.has("GL_EXT_framebuffer_blit") && 402c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBlitFramebuffer) { 403adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 404bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 40590313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (fExtensions.has("GL_EXT_framebuffer_multisample") && 406c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fRenderbufferStorageMultisample) { 407adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 408bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 409bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 410bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } else { 41190313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_multisample")) { 412c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fRenderbufferStorageMultisample || 413c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fBlitFramebuffer) { 414adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 415a8e5a06f69b7e0cb17a4b3203f0a7a1d52aa73eccommit-bot@chromium.org } 416a8e5a06f69b7e0cb17a4b3203f0a7a1d52aa73eccommit-bot@chromium.org } 41790313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (fExtensions.has("GL_APPLE_framebuffer_multisample")) { 418c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE || 419c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fResolveMultisampleFramebuffer) { 420adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 421bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 422bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 42390313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (fExtensions.has("GL_IMG_multisampled_render_to_texture") || 42490313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org fExtensions.has("GL_EXT_multisampled_render_to_texture")) { 425c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT || 426c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fFramebufferTexture2DMultisample) { 427adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 428f3a60c09b975f50bbd14215df10effffd2fd46e8bsalomon@google.com } 429f3a60c09b975f50bbd14215df10effffd2fd46e8bsalomon@google.com } 430bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 431bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 432bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // On ES buffer mapping is an extension. On Desktop 433bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // buffer mapping was part of original VBO extension 434bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com // which we require. 43590313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) { 436c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fMapBuffer || 437c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fUnmapBuffer) { 438adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 439bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 440bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com } 441bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com 442271cffc77bd2fcb3458559e509634442517ca1e9bsalomon@google.com // Dual source blending 4439e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGL_GrGLStandard == fStandard && 44490313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended"))) { 445c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fBindFragDataLocationIndexed) { 446adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 447271cffc77bd2fcb3458559e509634442517ca1e9bsalomon@google.com } 448271cffc77bd2fcb3458559e509634442517ca1e9bsalomon@google.com } 44912eea2b10d6caaafe0a207d10b1e9322510983a2skia.committer@gmail.com 450726e621000582e4de7c9ce0f7e9950c3af4e5d9bcommit-bot@chromium.org // glGetStringi was added in version 3.0 of both desktop and ES. 451726e621000582e4de7c9ce0f7e9950c3af4e5d9bcommit-bot@chromium.org if (glVer >= GR_GL_VER(3, 0)) { 452c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fGetStringi) { 453adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 4541744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com } 4551744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com } 456271cffc77bd2fcb3458559e509634442517ca1e9bsalomon@google.com 4579e90aed5de82732cc9921f01388d3063a41a053bcommit-bot@chromium.org if (kGL_GrGLStandard == fStandard) { 45890313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_object")) { 459c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fBindVertexArray || 460c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteVertexArrays || 461c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenVertexArrays) { 462adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 463ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com } 464ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com } 465ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com } else { 46690313cc36a6f43a3e9d3818aca536cd6631c222bcommit-bot@chromium.org if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_object")) { 467c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org if (NULL == fFunctions.fBindVertexArray || 468c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fDeleteVertexArrays || 469c72425ae368bfcb47de7d2532eb90d305ec0d1cfcommit-bot@chromium.org NULL == fFunctions.fGenVertexArrays) { 470adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 471ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com } 472ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com } 473ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com } 474a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org 475a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org if (fExtensions.has("GL_EXT_debug_marker")) { 476a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org if (NULL == fFunctions.fInsertEventMarker || 477a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org NULL == fFunctions.fPushGroupMarker || 478a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org NULL == fFunctions.fPopGroupMarker) { 479adadf7c31f964fb98a64d1f59c18fa099888cae5commit-bot@chromium.org RETURN_FALSE_INTERFACE 480a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org } 481a3baf3be0e2a3128fb73bd41d40d130f75a4dc86commit-bot@chromium.org } 482a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com 483a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com#if 0 // This can be enabled once Chromium is updated to set these functions pointers. 484a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com if ((kGL_GrGLStandard == fStandard) || fExtensions.has("GL_ARB_invalidate_subdata")) { 485a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com if (NULL == fFunctions.fInvalidateBufferData || 486a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com NULL == fFunctions.fInvalidateBufferSubData || 487a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com NULL == fFunctions.fInvalidateFramebuffer || 488a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com NULL == fFunctions.fInvalidateSubFramebuffer || 489a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com NULL == fFunctions.fInvalidateTexImage || 490a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com NULL == fFunctions.fInvalidateTexSubImage) { 491a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com RETURN_FALSE_INTERFACE; 492a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com } 493a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com } else if (glVer >= GR_GL_VER(3,0)) { 494a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com // ES 3.0 adds the framebuffer functions but not the others. 495a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com if (NULL == fFunctions.fInvalidateFramebuffer || 496a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com NULL == fFunctions.fInvalidateSubFramebuffer) { 497a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com RETURN_FALSE_INTERFACE; 498a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com } 499a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com } 500beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org 501beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub")) { 502beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org if (NULL == fFunctions.fMapBufferSubData || 503beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org NULL == fFunctions.fMapTexSubImage2D || 504beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org NULL == fFunctions.fUnmapBufferSubData || 505beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org NULL == fFunctions.fUnmapTexSubImage2D) { 506beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org RETURN_FALSE_INTERFACE; 507beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org } 508beb8b3a4da83ce30e313e72ae0e444870acecb7ecommit-bot@chromium.org } 509a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com#endif 510a34bb60c4e319f2289106d519544fe09d43eabd5bsalomon@google.com 511bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com return true; 512bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com} 513