зеркало из https://github.com/mozilla/moz-skia.git
Use glGetStringi to get extensions when available.
Review URL: https://codereview.chromium.org/12328111 git-svn-id: http://skia.googlecode.com/svn/trunk@7872 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
8d33a24cfe
Коммит
1744f97ea7
|
@ -15,8 +15,8 @@ BenchGpuTimer::BenchGpuTimer(const SkGLContext* glctx) {
|
|||
glctx->makeCurrent();
|
||||
fStarted = false;
|
||||
fSupported = GrGLGetVersion(glctx->gl()) > GR_GL_VER(3,3) ||
|
||||
GrGLHasExtension(glctx->gl(), "GL_ARB_timer_query") ||
|
||||
GrGLHasExtension(glctx->gl(), "GL_EXT_timer_query");
|
||||
glctx->hasExtension("GL_ARB_timer_query") ||
|
||||
glctx->hasExtension("GL_EXT_timer_query");
|
||||
|
||||
if (fSupported) {
|
||||
SK_GL(*glctx, GenQueries(1, &fQuery));
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
'<(skia_include_path)/gpu/GrUserConfig.h',
|
||||
|
||||
'<(skia_include_path)/gpu/gl/GrGLConfig.h',
|
||||
'<(skia_include_path)/gpu/gl/GrGLExtensions.h',
|
||||
'<(skia_include_path)/gpu/gl/GrGLFunctions.h',
|
||||
'<(skia_include_path)/gpu/gl/GrGLInterface.h',
|
||||
|
||||
|
@ -145,6 +146,7 @@
|
|||
'<(skia_src_path)/gpu/gl/GrGLDefines.h',
|
||||
'<(skia_src_path)/gpu/gl/GrGLEffect.cpp',
|
||||
'<(skia_src_path)/gpu/gl/GrGLEffect.h',
|
||||
'<(skia_src_path)/gpu/gl/GrGLExtensions.cpp',
|
||||
'<(skia_src_path)/gpu/gl/GrGLEffectMatrix.cpp',
|
||||
'<(skia_src_path)/gpu/gl/GrGLEffectMatrix.h',
|
||||
'<(skia_src_path)/gpu/gl/GrGLIndexBuffer.cpp',
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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 GrGLExtensions_DEFINED
|
||||
#define GrGLExtensions_DEFINED
|
||||
|
||||
#include "GrGLInterface.h"
|
||||
#include "SkString.h"
|
||||
#include "SkTArray.h"
|
||||
|
||||
/**
|
||||
* This helper queries the current GL context for its extensions, remembers them, and can be
|
||||
* queried. It supports both glGetString- and glGetStringi-style extension string APIs and will
|
||||
* use the latter if it is available.
|
||||
*/
|
||||
class GrGLExtensions {
|
||||
public:
|
||||
bool init(GrGLBinding binding, const GrGLInterface* iface) {
|
||||
GrAssert(binding & iface->fBindingsExported);
|
||||
return this->init(binding, iface->fGetString, iface->fGetStringi, iface->fGetIntegerv);
|
||||
}
|
||||
/**
|
||||
* We sometimes need to use this class without having yet created a GrGLInterface. This version
|
||||
* of init expects that getString is always non-NULL while getIntegerv and getStringi are non-
|
||||
* NULL if on desktop GL with version 3.0 or higher. Otherwise it will fail.
|
||||
*/
|
||||
bool init(GrGLBinding binding,
|
||||
GrGLGetStringProc getString,
|
||||
GrGLGetStringiProc getStringi,
|
||||
GrGLGetIntegervProc getIntegerv);
|
||||
|
||||
/**
|
||||
* Queries whether an extension is present. This will fail if init() has not been called.
|
||||
*/
|
||||
bool has(const char*) const;
|
||||
|
||||
void reset() { fStrings.reset(); }
|
||||
|
||||
private:
|
||||
SkTArray<SkString> fStrings;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -108,6 +108,7 @@ extern "C" {
|
|||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetShaderInfoLogProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetShaderivProc)(GrGLuint shader, GrGLenum pname, GrGLint* params);
|
||||
typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE* GrGLGetStringProc)(GrGLenum name);
|
||||
typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE* GrGLGetStringiProc)(GrGLenum name, GrGLuint index);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetTexLevelParameterivProc)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params);
|
||||
typedef GrGLint (GR_GL_FUNCTION_TYPE* GrGLGetUniformLocationProc)(GrGLuint program, const char* name);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLineWidthProc)(GrGLfloat width);
|
||||
|
|
|
@ -203,6 +203,7 @@ public:
|
|||
GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
|
||||
GLPtr<GrGLGetShaderivProc> fGetShaderiv;
|
||||
GLPtr<GrGLGetStringProc> fGetString;
|
||||
GLPtr<GrGLGetStringiProc> fGetStringi;
|
||||
GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
|
||||
GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
|
||||
GLPtr<GrGLLineWidthProc> fLineWidth;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#ifndef SkGLContext_DEFINED
|
||||
#define SkGLContext_DEFINED
|
||||
|
||||
#include "GrGLExtensions.h"
|
||||
#include "GrGLInterface.h"
|
||||
#include "SkString.h"
|
||||
|
||||
/**
|
||||
* Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO.
|
||||
|
@ -34,7 +34,10 @@ public:
|
|||
|
||||
virtual void makeCurrent() const = 0;
|
||||
|
||||
bool hasExtension(const char* extensionName) const;
|
||||
bool hasExtension(const char* extensionName) const {
|
||||
GrAssert(NULL != fGL);
|
||||
return fExtensions.has(extensionName);
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
@ -51,7 +54,7 @@ protected:
|
|||
virtual void destroyGLContext() = 0;
|
||||
|
||||
private:
|
||||
SkString fExtensionString;
|
||||
GrGLExtensions fExtensions;
|
||||
GrGLuint fFBO;
|
||||
GrGLuint fColorBufferID;
|
||||
GrGLuint fDepthStencilBufferID;
|
||||
|
|
|
@ -31,7 +31,7 @@ GrGLContextInfo& GrGLContextInfo::operator = (const GrGLContextInfo& ctx) {
|
|||
fGLVersion = ctx.fGLVersion;
|
||||
fGLSLGeneration = ctx.fGLSLGeneration;
|
||||
fVendor = ctx.fVendor;
|
||||
fExtensionString = ctx.fExtensionString;
|
||||
fExtensions = ctx.fExtensions;
|
||||
fGLCaps = ctx.fGLCaps;
|
||||
return *this;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ void GrGLContextInfo::reset() {
|
|||
fGLVersion = GR_GL_VER(0, 0);
|
||||
fGLSLGeneration = static_cast<GrGLSLGeneration>(0);
|
||||
fVendor = kOther_GrGLVendor;
|
||||
fExtensionString = "";
|
||||
fExtensions.reset();
|
||||
fGLCaps.reset();
|
||||
}
|
||||
|
||||
|
@ -50,14 +50,13 @@ bool GrGLContextInfo::initialize(const GrGLInterface* interface) {
|
|||
this->reset();
|
||||
// We haven't validated the GrGLInterface yet, so check for GetString
|
||||
// function pointer
|
||||
if (NULL != interface->fGetString) {
|
||||
|
||||
if (interface->fGetString) {
|
||||
const GrGLubyte* verUByte;
|
||||
GR_GL_CALL_RET(interface, verUByte, GetString(GR_GL_VERSION));
|
||||
const char* ver = reinterpret_cast<const char*>(verUByte);
|
||||
GrGLBinding binding = GrGLGetBindingInUseFromString(ver);
|
||||
|
||||
if (interface->validate(binding)) {
|
||||
if (0 != binding && interface->validate(binding) && fExtensions.init(binding, interface)) {
|
||||
|
||||
fInterface = interface;
|
||||
interface->ref();
|
||||
|
@ -69,9 +68,6 @@ bool GrGLContextInfo::initialize(const GrGLInterface* interface) {
|
|||
fGLSLGeneration = GrGetGLSLGeneration(fBindingInUse,
|
||||
this->interface());
|
||||
|
||||
const GrGLubyte* ext;
|
||||
GR_GL_CALL_RET(interface, ext, GetString(GR_GL_EXTENSIONS));
|
||||
fExtensionString = reinterpret_cast<const char*>(ext);
|
||||
fVendor = GrGLGetVendor(interface);
|
||||
fGLCaps.init(*this);
|
||||
return true;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#ifndef GrGLContextInfo_DEFINED
|
||||
#define GrGLContextInfo_DEFINED
|
||||
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "gl/GrGLInterface.h"
|
||||
#include "GrGLCaps.h"
|
||||
#include "GrGLSL.h"
|
||||
|
@ -70,7 +71,7 @@ public:
|
|||
if (!this->isInitialized()) {
|
||||
return false;
|
||||
}
|
||||
return GrGLHasExtensionFromString(ext, fExtensionString.c_str());
|
||||
return fExtensions.has(ext);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -81,7 +82,7 @@ private:
|
|||
GrGLVersion fGLVersion;
|
||||
GrGLSLGeneration fGLSLGeneration;
|
||||
GrGLVendor fVendor;
|
||||
SkString fExtensionString;
|
||||
GrGLExtensions fExtensions;
|
||||
GrGLCaps fGLCaps;
|
||||
};
|
||||
|
||||
|
|
|
@ -215,6 +215,7 @@ const GrGLInterface* GrGLCreateNullInterface() {
|
|||
interface->fGetShaderInfoLog = noOpGLGetInfoLog;
|
||||
interface->fGetShaderiv = noOpGLGetShaderOrProgramiv;
|
||||
interface->fGetString = noOpGLGetString;
|
||||
interface->fGetStringi = noOpGLGetStringi;
|
||||
interface->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
|
||||
interface->fGetUniformLocation = noOpGLGetUniformLocation;
|
||||
interface->fLineWidth = noOpGLLineWidth;
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
#ifndef GrGLDefines_DEFINED
|
||||
#define GrGLDefines_DEFINED
|
||||
|
||||
/* Profiles */
|
||||
#define GR_GL_CONTEXT_PROFILE_MASK 0x9126
|
||||
#define GR_GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
|
||||
#define GR_GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
|
||||
|
||||
// The following constants consist of the intersection of GL constants
|
||||
// exported by GLES 1.0, GLES 2.0, and desktop GL required by the system.
|
||||
|
||||
|
@ -356,6 +361,9 @@
|
|||
#define GR_GL_VERSION 0x1F02
|
||||
#define GR_GL_EXTENSIONS 0x1F03
|
||||
|
||||
/* StringCounts */
|
||||
#define GR_GL_NUM_EXTENSIONS 0x821D
|
||||
|
||||
/* Pixel Mode / Transfer */
|
||||
#define GR_GL_UNPACK_ROW_LENGTH 0x0CF2
|
||||
#define GR_GL_PACK_ROW_LENGTH 0x0D02
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright 2013 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "gl/GrGLDefines.h"
|
||||
#include "gl/GrGLUtil.h"
|
||||
|
||||
bool GrGLExtensions::init(GrGLBinding binding,
|
||||
GrGLGetStringProc getString,
|
||||
GrGLGetStringiProc getStringi,
|
||||
GrGLGetIntegervProc getIntegerv) {
|
||||
fStrings.reset();
|
||||
if (NULL == getString) {
|
||||
return false;
|
||||
}
|
||||
bool indexed = false;
|
||||
if (kDesktop_GrGLBinding == binding) {
|
||||
const GrGLubyte* verString = getString(GR_GL_VERSION);
|
||||
if (NULL == verString) {
|
||||
return false;
|
||||
}
|
||||
GrGLVersion version = GrGLGetVersionFromString((const char*) verString);
|
||||
indexed = version >= GR_GL_VER(3, 0);
|
||||
}
|
||||
if (indexed) {
|
||||
if (NULL == getStringi || NULL == getIntegerv) {
|
||||
return false;
|
||||
}
|
||||
GrGLint extensionCnt = 0;
|
||||
getIntegerv(GR_GL_NUM_EXTENSIONS, &extensionCnt);
|
||||
fStrings.push_back_n(extensionCnt);
|
||||
for (int i = 0; i < extensionCnt; ++i) {
|
||||
const char* ext = (const char*) getStringi(GR_GL_EXTENSIONS, i);
|
||||
fStrings[i] = ext;
|
||||
}
|
||||
} else {
|
||||
const char* extensions = (const char*) getString(GR_GL_EXTENSIONS);
|
||||
if (NULL == extensions) {
|
||||
return false;
|
||||
}
|
||||
// First count the extensions so that we don't cause the array to malloc multiple times.
|
||||
int extensionCnt = 1;
|
||||
const char* e = (const char*) extensions;
|
||||
while (NULL != (e = strchr(e+1, ' '))) {
|
||||
e += 1;
|
||||
++extensionCnt;
|
||||
}
|
||||
fStrings.push_back_n(extensionCnt);
|
||||
|
||||
int i = 0;
|
||||
while (true) {
|
||||
size_t length = strcspn(extensions, " ");
|
||||
GrAssert(i < extensionCnt);
|
||||
fStrings[i].set(extensions, length);
|
||||
++i;
|
||||
if ('\0' == extensions[length]) {
|
||||
break;
|
||||
}
|
||||
extensions += length + 1;
|
||||
}
|
||||
GrAssert(i == extensionCnt);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GrGLExtensions::has(const char* ext) const {
|
||||
// TODO: Sort the extensions and binary search.
|
||||
int count = fStrings.count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
if (fStrings[i].equals(ext)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
|
||||
#include "gl/GrGLInterface.h"
|
||||
#include "GrGLUtil.h"
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "gl/GrGLUtil.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -37,6 +38,11 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
if (0 == (binding & fBindingsExported)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
GrGLExtensions extensions;
|
||||
if (!extensions.init(binding, this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// functions that are always required
|
||||
if (NULL == fActiveTexture ||
|
||||
|
@ -131,9 +137,7 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
const char* ext;
|
||||
GrGLVersion glVer = GrGLGetVersion(this);
|
||||
ext = (const char*)fGetString(GR_GL_EXTENSIONS);
|
||||
|
||||
// Now check that baseline ES/Desktop fns not covered above are present
|
||||
// and that we have fn pointers for any advertised extensions that we will
|
||||
|
@ -160,15 +164,13 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
if (glVer >= GR_GL_VER(3,0) && NULL == fBindFragDataLocation) {
|
||||
return false;
|
||||
}
|
||||
if (glVer >= GR_GL_VER(2,0) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_draw_buffers", ext)) {
|
||||
if (glVer >= GR_GL_VER(2,0) || extensions.has("GL_ARB_draw_buffers")) {
|
||||
if (NULL == fDrawBuffers) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (glVer >= GR_GL_VER(1,5) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_occlusion_query", ext)) {
|
||||
if (glVer >= GR_GL_VER(1,5) || extensions.has("GL_ARB_occlusion_query")) {
|
||||
if (NULL == fGenQueries ||
|
||||
NULL == fDeleteQueries ||
|
||||
NULL == fBeginQuery ||
|
||||
|
@ -180,15 +182,14 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
}
|
||||
}
|
||||
if (glVer >= GR_GL_VER(3,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_timer_query", ext) ||
|
||||
GrGLHasExtensionFromString("GL_EXT_timer_query", ext)) {
|
||||
extensions.has("GL_ARB_timer_query") ||
|
||||
extensions.has("GL_EXT_timer_query")) {
|
||||
if (NULL == fGetQueryObjecti64v ||
|
||||
NULL == fGetQueryObjectui64v) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (glVer >= GR_GL_VER(3,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_timer_query", ext)) {
|
||||
if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) {
|
||||
if (NULL == fQueryCounter) {
|
||||
return false;
|
||||
}
|
||||
|
@ -202,7 +203,7 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
NULL == fLoadMatrixf)) {
|
||||
return false;
|
||||
}
|
||||
if (false && GrGLHasExtensionFromString("GL_NV_path_rendering", ext)) {
|
||||
if (false && extensions.has("GL_NV_path_rendering")) {
|
||||
if (NULL == fPathCommands ||
|
||||
NULL == fPathCoords ||
|
||||
NULL == fPathSubCommands ||
|
||||
|
@ -259,8 +260,8 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
|
||||
// optional function on desktop before 1.3
|
||||
if (kDesktop_GrGLBinding != binding ||
|
||||
(glVer >= GR_GL_VER(1,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_compression", ext))) {
|
||||
(glVer >= GR_GL_VER(1,3)) ||
|
||||
extensions.has("GL_ARB_texture_compression")) {
|
||||
if (NULL == fCompressedTexImage2D) {
|
||||
return false;
|
||||
}
|
||||
|
@ -279,13 +280,13 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
// There is a desktop ARB extension and an ES+desktop EXT extension
|
||||
if (kDesktop_GrGLBinding == binding) {
|
||||
if (glVer >= GR_GL_VER(4,2) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_storage", ext) ||
|
||||
GrGLHasExtensionFromString("GL_EXT_texture_storage", ext)) {
|
||||
extensions.has("GL_ARB_texture_storage") ||
|
||||
extensions.has("GL_EXT_texture_storage")) {
|
||||
if (NULL == fTexStorage2D) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_texture_storage", ext)) {
|
||||
} else if (extensions.has("GL_EXT_texture_storage")) {
|
||||
if (NULL == fTexStorage2D) {
|
||||
return false;
|
||||
}
|
||||
|
@ -294,29 +295,29 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
// FBO MSAA
|
||||
if (kDesktop_GrGLBinding == binding) {
|
||||
// GL 3.0 and the ARB extension have multisample + blit
|
||||
if (glVer >= GR_GL_VER(3,0) || GrGLHasExtensionFromString("GL_ARB_framebuffer_object", ext)) {
|
||||
if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fBlitFramebuffer) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_blit", ext) &&
|
||||
if (extensions.has("GL_EXT_framebuffer_blit") &&
|
||||
NULL == fBlitFramebuffer) {
|
||||
return false;
|
||||
}
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample", ext) &&
|
||||
if (extensions.has("GL_EXT_framebuffer_multisample") &&
|
||||
NULL == fRenderbufferStorageMultisample) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (GrGLHasExtensionFromString("GL_CHROMIUM_framebuffer_multisample", ext)) {
|
||||
if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fBlitFramebuffer) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (GrGLHasExtensionFromString("GL_APPLE_framebuffer_multisample", ext)) {
|
||||
if (extensions.has("GL_APPLE_framebuffer_multisample")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fResolveMultisampleFramebuffer) {
|
||||
return false;
|
||||
|
@ -327,8 +328,7 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
// On ES buffer mapping is an extension. On Desktop
|
||||
// buffer mapping was part of original VBO extension
|
||||
// which we require.
|
||||
if (kDesktop_GrGLBinding == binding ||
|
||||
GrGLHasExtensionFromString("GL_OES_mapbuffer", ext)) {
|
||||
if (kDesktop_GrGLBinding == binding || extensions.has("GL_OES_mapbuffer")) {
|
||||
if (NULL == fMapBuffer ||
|
||||
NULL == fUnmapBuffer) {
|
||||
return false;
|
||||
|
@ -337,12 +337,17 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
|||
|
||||
// Dual source blending
|
||||
if (kDesktop_GrGLBinding == binding &&
|
||||
(glVer >= GR_GL_VER(3,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_blend_func_extended", ext))) {
|
||||
(glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_blend_func_extended"))) {
|
||||
if (NULL == fBindFragDataLocationIndexed) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (kDesktop_GrGLBinding == binding && glVer >= GR_GL_VER(3, 0)) {
|
||||
if (NULL == fGetStringi) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
*/
|
||||
|
||||
#include "GrGLNoOpInterface.h"
|
||||
#include "SkString.h"
|
||||
#include "SkThread.h"
|
||||
|
||||
// the OpenGLES 2.0 spec says this must be >= 128
|
||||
static const GrGLint kDefaultMaxVertexUniformVectors = 128;
|
||||
|
@ -19,6 +21,33 @@ static const GrGLint kDefaultMaxVertexAttribs = 8;
|
|||
// the OpenGLES 2.0 spec says this must be >= 8
|
||||
static const GrGLint kDefaultMaxVaryingVectors = 8;
|
||||
|
||||
static const char* kExtensions[] = {
|
||||
"GL_ARB_framebuffer_object",
|
||||
"GL_ARB_blend_func_extended",
|
||||
"GL_ARB_timer_query",
|
||||
"GL_ARB_draw_buffers",
|
||||
"GL_ARB_occlusion_query",
|
||||
"GL_EXT_blend_color",
|
||||
"GL_EXT_stencil_wrap"
|
||||
};
|
||||
|
||||
namespace {
|
||||
const GrGLubyte* combined_extensions_string() {
|
||||
static SkString gExtString;
|
||||
static SkMutex gMutex;
|
||||
gMutex.acquire();
|
||||
if (0 == gExtString.size()) {
|
||||
for (size_t i = 0; i < GR_ARRAY_COUNT(kExtensions) - 1; ++i) {
|
||||
gExtString.append(kExtensions[i]);
|
||||
gExtString.append(" ");
|
||||
}
|
||||
gExtString.append(kExtensions[GR_ARRAY_COUNT(kExtensions) - 1]);
|
||||
}
|
||||
gMutex.release();
|
||||
return (const GrGLubyte*) gExtString.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendColor(GrGLclampf red,
|
||||
GrGLclampf green,
|
||||
GrGLclampf blue,
|
||||
|
@ -53,9 +82,9 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearStencil(GrGLint s) {
|
|||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLColorMask(GrGLboolean red,
|
||||
GrGLboolean green,
|
||||
GrGLboolean blue,
|
||||
GrGLboolean alpha) {
|
||||
GrGLboolean green,
|
||||
GrGLboolean blue,
|
||||
GrGLboolean alpha) {
|
||||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompileShader(GrGLuint shader) {
|
||||
|
@ -132,9 +161,9 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLReadBuffer(GrGLenum src) {
|
|||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLScissor(GrGLint x,
|
||||
GrGLint y,
|
||||
GrGLsizei width,
|
||||
GrGLsizei height) {
|
||||
GrGLint y,
|
||||
GrGLsizei width,
|
||||
GrGLsizei height) {
|
||||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLShaderSource(GrGLuint shader,
|
||||
|
@ -318,15 +347,15 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttribPointer(GrGLuint indx,
|
|||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLViewport(GrGLint x,
|
||||
GrGLint y,
|
||||
GrGLsizei width,
|
||||
GrGLsizei height) {
|
||||
GrGLint y,
|
||||
GrGLsizei width,
|
||||
GrGLsizei height) {
|
||||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetFramebufferAttachmentParameteriv(GrGLenum target,
|
||||
GrGLenum attachment,
|
||||
GrGLenum pname,
|
||||
GrGLint* params) {
|
||||
GrGLenum attachment,
|
||||
GrGLenum pname,
|
||||
GrGLint* params) {
|
||||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetRenderbufferParameteriv(GrGLenum target,
|
||||
|
@ -393,6 +422,9 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params)
|
|||
// TODO: remove from Ganesh the #defines for gets we don't use.
|
||||
// We would like to minimize gets overall due to performance issues
|
||||
switch (pname) {
|
||||
case GR_GL_CONTEXT_PROFILE_MASK:
|
||||
*params = GR_GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
|
||||
break;
|
||||
case GR_GL_STENCIL_BITS:
|
||||
*params = 8;
|
||||
break;
|
||||
|
@ -440,6 +472,9 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params)
|
|||
case GR_GL_MAX_VARYING_VECTORS:
|
||||
*params = kDefaultMaxVaryingVectors;
|
||||
break;
|
||||
case GR_GL_NUM_EXTENSIONS:
|
||||
*params = GR_ARRAY_COUNT(kExtensions);
|
||||
break;
|
||||
default:
|
||||
GrCrash("Unexpected pname to GetIntegerv");
|
||||
}
|
||||
|
@ -448,7 +483,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params)
|
|||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetInfoLog(GrGLuint program,
|
||||
GrGLsizei bufsize,
|
||||
GrGLsizei* length,
|
||||
char* infolog) {
|
||||
char* infolog) {
|
||||
if (length) {
|
||||
*length = 0;
|
||||
}
|
||||
|
@ -534,7 +569,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectuiv(GrGLuint id,
|
|||
const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name) {
|
||||
switch (name) {
|
||||
case GR_GL_EXTENSIONS:
|
||||
return (const GrGLubyte*)"GL_ARB_framebuffer_object GL_ARB_blend_func_extended GL_ARB_timer_query GL_ARB_draw_buffers GL_ARB_occlusion_query GL_EXT_blend_color GL_EXT_stencil_wrap";
|
||||
return combined_extensions_string();
|
||||
case GR_GL_VERSION:
|
||||
return (const GrGLubyte*)"4.0 Debug GL";
|
||||
case GR_GL_SHADING_LANGUAGE_VERSION:
|
||||
|
@ -544,11 +579,25 @@ const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name) {
|
|||
case GR_GL_RENDERER:
|
||||
return (const GrGLubyte*)"The Debug (Non-)Renderer";
|
||||
default:
|
||||
GrCrash("Unexpected name to GetString");
|
||||
GrCrash("Unexpected name passed to GetString");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i) {
|
||||
switch (name) {
|
||||
case GR_GL_EXTENSIONS:
|
||||
if (static_cast<size_t>(i) <= GR_ARRAY_COUNT(kExtensions)) {
|
||||
return (const GrGLubyte*) kExtensions[i];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
default:
|
||||
GrCrash("Unexpected name passed to GetStringi");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target,
|
||||
GrGLint level,
|
||||
GrGLenum pname,
|
||||
|
@ -558,8 +607,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target,
|
|||
GrCrash("Should never query texture parameters.");
|
||||
}
|
||||
|
||||
GrGLint GR_GL_FUNCTION_TYPE noOpGLGetUniformLocation(GrGLuint program,
|
||||
const char* name) {
|
||||
GrGLint GR_GL_FUNCTION_TYPE noOpGLGetUniformLocation(GrGLuint program, const char* name) {
|
||||
static int gUniLocation = 0;
|
||||
return ++gUniLocation;
|
||||
}
|
||||
|
|
|
@ -335,6 +335,8 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectuiv(GrGLuint id,
|
|||
|
||||
const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name);
|
||||
|
||||
const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i);
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target,
|
||||
GrGLint level,
|
||||
GrGLenum pname,
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "GrGLUtil.h"
|
||||
|
||||
|
||||
void GrGLClearErr(const GrGLInterface* gl) {
|
||||
while (GR_GL_NO_ERROR != gl->fGetError()) {}
|
||||
}
|
||||
|
@ -149,23 +148,6 @@ GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool GrGLHasExtensionFromString(const char* ext, const char* extensionString) {
|
||||
int extLength = strlen(ext);
|
||||
|
||||
while (true) {
|
||||
int n = strcspn(extensionString, " ");
|
||||
if (n == extLength && 0 == strncmp(ext, extensionString, n)) {
|
||||
return true;
|
||||
}
|
||||
if (0 == extensionString[n]) {
|
||||
return false;
|
||||
}
|
||||
extensionString += n+1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
GrGLVendor GrGLGetVendorFromString(const char* vendorString) {
|
||||
if (NULL != vendorString) {
|
||||
if (0 == strcmp(vendorString, "ARM")) {
|
||||
|
@ -181,12 +163,6 @@ GrGLVendor GrGLGetVendorFromString(const char* vendorString) {
|
|||
return kOther_GrGLVendor;
|
||||
}
|
||||
|
||||
bool GrGLHasExtension(const GrGLInterface* gl, const char* ext) {
|
||||
const GrGLubyte* glstr;
|
||||
GR_GL_CALL_RET(gl, glstr, GetString(GR_GL_EXTENSIONS));
|
||||
return GrGLHasExtensionFromString(ext, (const char*) glstr);
|
||||
}
|
||||
|
||||
GrGLBinding GrGLGetBindingInUse(const GrGLInterface* gl) {
|
||||
const GrGLubyte* v;
|
||||
GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
|
||||
|
|
|
@ -71,11 +71,9 @@ enum GrGLVendor {
|
|||
GrGLVersion GrGLGetVersionFromString(const char* versionString);
|
||||
GrGLBinding GrGLGetBindingInUseFromString(const char* versionString);
|
||||
GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString);
|
||||
bool GrGLHasExtensionFromString(const char* ext, const char* extensionString);
|
||||
GrGLVendor GrGLGetVendorFromString(const char* vendorString);
|
||||
|
||||
// these variants call glGetString()
|
||||
bool GrGLHasExtension(const GrGLInterface*, const char* ext);
|
||||
GrGLBinding GrGLGetBindingInUse(const GrGLInterface*);
|
||||
GrGLVersion GrGLGetVersion(const GrGLInterface*);
|
||||
GrGLSLVersion GrGLGetGLSLVersion(const GrGLInterface*);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file.
|
||||
*/
|
||||
#include "gl/SkGLContext.h"
|
||||
#include "gl/GrGLUtil.h"
|
||||
#include "GrGLUtil.h"
|
||||
|
||||
SK_DEFINE_INST_COUNT(SkGLContext)
|
||||
|
||||
|
@ -29,10 +29,6 @@ SkGLContext::~SkGLContext() {
|
|||
SkSafeUnref(fGL);
|
||||
}
|
||||
|
||||
bool SkGLContext::hasExtension(const char* extensionName) const {
|
||||
return GrGLHasExtensionFromString(extensionName, fExtensionString.c_str());
|
||||
}
|
||||
|
||||
bool SkGLContext::init(int width, int height) {
|
||||
if (fGL) {
|
||||
fGL->unref();
|
||||
|
@ -43,8 +39,13 @@ bool SkGLContext::init(int width, int height) {
|
|||
if (fGL) {
|
||||
const GrGLubyte* temp;
|
||||
|
||||
SK_GL_RET(*this, temp, GetString(GR_GL_EXTENSIONS));
|
||||
fExtensionString = reinterpret_cast<const char*>(temp);
|
||||
GrGLBinding bindingInUse = GrGLGetBindingInUse(this->gl());
|
||||
|
||||
if (!fGL->validate(bindingInUse) || !fExtensions.init(bindingInUse, fGL)) {
|
||||
fGL = NULL;
|
||||
this->destroyGLContext();
|
||||
return false;
|
||||
}
|
||||
|
||||
SK_GL_RET(*this, temp, GetString(GR_GL_VERSION));
|
||||
const char* versionStr = reinterpret_cast<const char*>(temp);
|
||||
|
@ -56,8 +57,6 @@ bool SkGLContext::init(int width, int height) {
|
|||
SK_GL_RET(*this, error, GetError());
|
||||
} while (GR_GL_NO_ERROR != error);
|
||||
|
||||
GrGLBinding bindingInUse = GrGLGetBindingInUse(this->gl());
|
||||
|
||||
SK_GL(*this, GenFramebuffers(1, &fFBO));
|
||||
SK_GL(*this, BindFramebuffer(GR_GL_FRAMEBUFFER, fFBO));
|
||||
SK_GL(*this, GenRenderbuffers(1, &fColorBufferID));
|
||||
|
@ -83,12 +82,11 @@ bool SkGLContext::init(int width, int height) {
|
|||
// depth stencil being available.
|
||||
bool supportsPackedDepthStencil;
|
||||
if (kES2_GrGLBinding == bindingInUse) {
|
||||
supportsPackedDepthStencil =
|
||||
this->hasExtension("GL_OES_packed_depth_stencil");
|
||||
supportsPackedDepthStencil = this->hasExtension("GL_OES_packed_depth_stencil");
|
||||
} else {
|
||||
supportsPackedDepthStencil = version >= GR_GL_VER(3,0) ||
|
||||
this->hasExtension("GL_EXT_packed_depth_stencil") ||
|
||||
this->hasExtension("GL_ARB_framebuffer_object");
|
||||
this->hasExtension("GL_EXT_packed_depth_stencil") ||
|
||||
this->hasExtension("GL_ARB_framebuffer_object");
|
||||
}
|
||||
|
||||
if (supportsPackedDepthStencil) {
|
||||
|
|
|
@ -814,6 +814,7 @@ const GrGLInterface* GrGLCreateDebugInterface() {
|
|||
interface->fGetShaderInfoLog = noOpGLGetInfoLog;
|
||||
interface->fGetShaderiv = noOpGLGetShaderOrProgramiv;
|
||||
interface->fGetString = noOpGLGetString;
|
||||
interface->fGetStringi = noOpGLGetStringi;
|
||||
interface->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
|
||||
interface->fGetUniformLocation = noOpGLGetUniformLocation;
|
||||
interface->fLineWidth = noOpGLLineWidth;
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
|
||||
|
||||
#include "gl/GrGLInterface.h"
|
||||
#include "../GrGLUtil.h"
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "GrGLUtil.h"
|
||||
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glext.h>
|
||||
|
@ -31,8 +32,12 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
glInterface.reset(interface);
|
||||
const char* verStr = (const char*) glGetString(GL_VERSION);
|
||||
GrGLVersion ver = GrGLGetVersionFromString(verStr);
|
||||
const char* extStr = (const char*) glGetString(GL_EXTENSIONS);
|
||||
|
||||
GrGLExtensions extensions;
|
||||
GrGLGetStringiProc glGetStringi = (GrGLGetStringiProc) GetProcAddress("glGetStringi");
|
||||
if (!extensions.init(kDesktop_GrGLBinding, glGetString, glGetStringi, glGetIntegerv)) {
|
||||
glInterface.reset(NULL);
|
||||
return NULL;
|
||||
}
|
||||
interface->fBindingsExported = kDesktop_GrGLBinding;
|
||||
interface->fActiveTexture = glActiveTexture;
|
||||
interface->fAttachShader = glAttachShader;
|
||||
|
@ -51,8 +56,8 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
|
||||
if (ver >= GR_GL_VER(1,4)) {
|
||||
interface->fBlendColor = glBlendColor;
|
||||
} else if (GrGLHasExtensionFromString("GL_ARB_imaging", extStr) ||
|
||||
GrGLHasExtensionFromString("GL_EXT_blend_color", extStr)) {
|
||||
} else if (extensions.has("GL_ARB_imaging") ||
|
||||
extensions.has("GL_EXT_blend_color")) {
|
||||
GET_PROC(BlendColor);
|
||||
}
|
||||
|
||||
|
@ -74,8 +79,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fDeleteTextures = glDeleteTextures;
|
||||
interface->fDepthMask = glDepthMask;
|
||||
interface->fDisable = glDisable;
|
||||
interface->fDisableVertexAttribArray =
|
||||
glDisableVertexAttribArray;
|
||||
interface->fDisableVertexAttribArray = glDisableVertexAttribArray;
|
||||
interface->fDrawArrays = glDrawArrays;
|
||||
interface->fDrawBuffer = glDrawBuffer;
|
||||
interface->fDrawBuffers = glDrawBuffers;
|
||||
|
@ -99,6 +103,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fGetShaderInfoLog = glGetShaderInfoLog;
|
||||
interface->fGetShaderiv = glGetShaderiv;
|
||||
interface->fGetString = glGetString;
|
||||
interface->fGetStringi = glGetStringi;
|
||||
interface->fGetTexLevelParameteriv = glGetTexLevelParameteriv;
|
||||
interface->fGenTextures = glGenTextures;
|
||||
interface->fGetUniformLocation = glGetUniformLocation;
|
||||
|
@ -131,10 +136,9 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
#elif GL_EXT_texture_storage
|
||||
interface->fTexStorage2D = glTexStorage2DEXT;
|
||||
#else
|
||||
if (ver >= GR_GL_VER(4,2) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_storage", extStr)) {
|
||||
if (ver >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) {
|
||||
GET_PROC(TexStorage2D);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_texture_storage", extStr)) {
|
||||
} else if (extensions.has("GL_EXT_texture_storage")) {
|
||||
GET_PROC_SUFFIX(TexStorage2D, EXT);
|
||||
}
|
||||
#endif
|
||||
|
@ -165,7 +169,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fVertexAttribPointer = glVertexAttribPointer;
|
||||
interface->fViewport = glViewport;
|
||||
|
||||
if (ver >= GR_GL_VER(3,3) || GrGLHasExtensionFromString("GL_ARB_timer_query", extStr)) {
|
||||
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;
|
||||
|
@ -176,7 +180,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fGetQueryObjecti64v = GET_PROC(GetQueryObjecti64v);
|
||||
interface->fGetQueryObjectui64v = GET_PROC(GetQueryObjectui64v);
|
||||
#endif
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_timer_query", extStr)) {
|
||||
} else if (extensions.has("GL_EXT_timer_query")) {
|
||||
#if GL_EXT_timer_query
|
||||
interface->fGetQueryObjecti64v = glGetQueryObjecti64vEXT;
|
||||
interface->fGetQueryObjectui64v = glGetQueryObjectui64vEXT;
|
||||
|
@ -186,7 +190,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
#endif
|
||||
}
|
||||
|
||||
if (ver >= GR_GL_VER(3,0) || GrGLHasExtensionFromString("GL_ARB_framebuffer_object", extStr)) {
|
||||
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
|
||||
interface->fGenFramebuffers = glGenFramebuffers;
|
||||
|
@ -220,7 +224,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fBlitFramebuffer = GET_PROC(BlitFramebuffer);
|
||||
#endif
|
||||
} else {
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_object", extStr)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_object")) {
|
||||
#if GL_EXT_framebuffer_object
|
||||
interface->fGenFramebuffers = glGenFramebuffersEXT;
|
||||
interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameterivEXT;
|
||||
|
@ -249,14 +253,14 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fBindRenderbuffer = GET_PROC_SUFFIX(BindRenderbuffer, EXT);
|
||||
#endif
|
||||
}
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample", extStr)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_multisample")) {
|
||||
#if GL_EXT_framebuffer_multisample
|
||||
interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleEXT;
|
||||
#else
|
||||
interface->fRenderbufferStorageMultisample = GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT);
|
||||
#endif
|
||||
}
|
||||
if (GrGLHasExtensionFromString("", extStr)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_blit")) {
|
||||
#if GL_EXT_framebuffer_blit
|
||||
interface->fBlitFramebuffer = glBlitFramebufferEXT;
|
||||
#else
|
||||
|
@ -264,7 +268,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
#endif
|
||||
}
|
||||
}
|
||||
if (ver >= GR_GL_VER(3,3) || GrGLHasExtensionFromString("GL_ARB_blend_func_extended", extStr)) {
|
||||
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;
|
||||
|
@ -272,8 +276,6 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fBindFragDataLocationIndexed = GET_PROC(BindFragDataLocationIndexed);
|
||||
#endif
|
||||
}
|
||||
|
||||
interface->fBindingsExported = kDesktop_GrGLBinding;
|
||||
}
|
||||
glInterface.get()->ref();
|
||||
return glInterface.get();
|
||||
|
|
|
@ -36,7 +36,7 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
|
|||
|
||||
CGLPixelFormatAttribute attributes[] = {
|
||||
#if 0
|
||||
kCGLPFAOpenGLProfile, kCGLOGLPVersion_3_2_Core,
|
||||
kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core,
|
||||
#endif
|
||||
(CGLPixelFormatAttribute)0
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "gl/GrGLInterface.h"
|
||||
#include "../GrGLUtil.h"
|
||||
|
||||
|
@ -23,9 +23,20 @@
|
|||
|
||||
const GrGLInterface* GrGLCreateMesaInterface() {
|
||||
if (NULL != OSMesaGetCurrentContext()) {
|
||||
GrGLGetStringProc getString = (GrGLGetStringProc) OSMesaGetProcAddress("glGetString");
|
||||
|
||||
GrGLGetStringProc getString =
|
||||
(GrGLGetStringProc) OSMesaGetProcAddress("glGetString");
|
||||
GrGLGetStringiProc glGetStringi =
|
||||
(GrGLGetStringiProc) OSMesaGetProcAddress("glGetStringi");
|
||||
GrGLGetIntegervProc glGetIntegerv =
|
||||
(GrGLGetIntegervProc) OSMesaGetProcAddress("glGetIntegerv");
|
||||
|
||||
GrGLExtensions extensions;
|
||||
if (!extensions.init(kDesktop_GrGLBinding, glGetString, glGetStringi, glGetIntegerv)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* versionString = (const char*) getString(GL_VERSION);
|
||||
const char* extString = (const char*) getString(GL_EXTENSIONS);
|
||||
GrGLVersion glVer = GrGLGetVersionFromString(versionString);
|
||||
|
||||
if (glVer < GR_GL_VER(1,5)) {
|
||||
|
@ -44,8 +55,8 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||
GR_GL_GET_PROC(BlendFunc);
|
||||
|
||||
if (glVer >= GR_GL_VER(1,4) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_imaging", extString) ||
|
||||
GrGLHasExtensionFromString("GL_EXT_blend_color", extString)) {
|
||||
extensions.has("GL_ARB_imaging") ||
|
||||
extensions.has("GL_EXT_blend_color")) {
|
||||
GR_GL_GET_PROC(BlendColor);
|
||||
}
|
||||
|
||||
|
@ -85,12 +96,11 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||
GR_GL_GET_PROC(GetIntegerv);
|
||||
GR_GL_GET_PROC(GetProgramInfoLog);
|
||||
GR_GL_GET_PROC(GetProgramiv);
|
||||
if (glVer >= GR_GL_VER(3,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_timer_query", extString)) {
|
||||
if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) {
|
||||
GR_GL_GET_PROC(GetQueryObjecti64v);
|
||||
GR_GL_GET_PROC(GetQueryObjectui64v)
|
||||
GR_GL_GET_PROC(QueryCounter);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_timer_query", extString)) {
|
||||
} else if (extensions.has("GL_EXT_timer_query")) {
|
||||
GR_GL_GET_PROC_SUFFIX(GetQueryObjecti64v, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(GetQueryObjectui64v, EXT);
|
||||
}
|
||||
|
@ -100,6 +110,7 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||
GR_GL_GET_PROC(GetShaderInfoLog);
|
||||
GR_GL_GET_PROC(GetShaderiv);
|
||||
GR_GL_GET_PROC(GetString);
|
||||
GR_GL_GET_PROC(GetStringi);
|
||||
GR_GL_GET_PROC(GetTexLevelParameteriv);
|
||||
GR_GL_GET_PROC(GenTextures);
|
||||
GR_GL_GET_PROC(GetUniformLocation);
|
||||
|
@ -152,9 +163,7 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||
|
||||
// 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) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_framebuffer_object",
|
||||
extString)) {
|
||||
if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) {
|
||||
GR_GL_GET_PROC(GenFramebuffers);
|
||||
GR_GL_GET_PROC(GetFramebufferAttachmentParameteriv);
|
||||
GR_GL_GET_PROC(GetRenderbufferParameteriv);
|
||||
|
@ -169,8 +178,7 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||
GR_GL_GET_PROC(BindRenderbuffer);
|
||||
GR_GL_GET_PROC(RenderbufferStorageMultisample);
|
||||
GR_GL_GET_PROC(BlitFramebuffer);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_framebuffer_object",
|
||||
extString)) {
|
||||
} else if (extensions.has("GL_EXT_framebuffer_object")) {
|
||||
GR_GL_GET_PROC_SUFFIX(GenFramebuffers, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT);
|
||||
|
@ -183,12 +191,10 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||
GR_GL_GET_PROC_SUFFIX(DeleteRenderbuffers, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(BindRenderbuffer, EXT);
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample",
|
||||
extString)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_multisample")) {
|
||||
GR_GL_GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT);
|
||||
}
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_blit",
|
||||
extString)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_blit")) {
|
||||
GR_GL_GET_PROC_SUFFIX(BlitFramebuffer, EXT);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "gl/GrGLInterface.h"
|
||||
#include "../GrGLUtil.h"
|
||||
|
||||
|
@ -22,10 +23,19 @@
|
|||
|
||||
const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
if (NULL != glXGetCurrentContext()) {
|
||||
|
||||
const char* versionString = (const char*) glGetString(GL_VERSION);
|
||||
const char* extString = (const char*) glGetString(GL_EXTENSIONS);
|
||||
GrGLVersion glVer = GrGLGetVersionFromString(versionString);
|
||||
|
||||
// This may or may not succeed depending on the gl version.
|
||||
GrGLGetStringiProc glGetStringi =
|
||||
(GrGLGetStringiProc) glXGetProcAddress(reinterpret_cast<const GLubyte*>("glGetStringi"));
|
||||
|
||||
GrGLExtensions extensions;
|
||||
if (!extensions.init(kDesktop_GrGLBinding, glGetString, glGetStringi, glGetIntegerv)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (glVer < GR_GL_VER(1,5)) {
|
||||
// We must have array and element_array buffer objects.
|
||||
return NULL;
|
||||
|
@ -43,8 +53,8 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fBlendFunc = glBlendFunc;
|
||||
|
||||
if (glVer >= GR_GL_VER(1,4) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_imaging", extString) ||
|
||||
GrGLHasExtensionFromString("GL_EXT_blend_color", extString)) {
|
||||
extensions.has("GL_ARB_imaging") ||
|
||||
extensions.has("GL_EXT_blend_color")) {
|
||||
GR_GL_GET_PROC(BlendColor);
|
||||
}
|
||||
|
||||
|
@ -83,12 +93,11 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fGetIntegerv = glGetIntegerv;
|
||||
GR_GL_GET_PROC(GetQueryObjectiv);
|
||||
GR_GL_GET_PROC(GetQueryObjectuiv);
|
||||
if (glVer >= GR_GL_VER(3,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_timer_query", extString)) {
|
||||
if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) {
|
||||
GR_GL_GET_PROC(GetQueryObjecti64v);
|
||||
GR_GL_GET_PROC(GetQueryObjectui64v);
|
||||
GR_GL_GET_PROC(QueryCounter);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_timer_query", extString)) {
|
||||
} else if (extensions.has("GL_EXT_timer_query")) {
|
||||
GR_GL_GET_PROC_SUFFIX(GetQueryObjecti64v, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(GetQueryObjectui64v, EXT);
|
||||
}
|
||||
|
@ -98,6 +107,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
GR_GL_GET_PROC(GetShaderInfoLog);
|
||||
GR_GL_GET_PROC(GetShaderiv);
|
||||
interface->fGetString = glGetString;
|
||||
GR_GL_GET_PROC(GetStringi);
|
||||
interface->fGetTexLevelParameteriv = glGetTexLevelParameteriv;
|
||||
GR_GL_GET_PROC(GenQueries);
|
||||
interface->fGenTextures = glGenTextures;
|
||||
|
@ -108,8 +118,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fPixelStorei = glPixelStorei;
|
||||
interface->fReadBuffer = glReadBuffer;
|
||||
interface->fReadPixels = glReadPixels;
|
||||
if (GrGLHasExtensionFromString("GL_NV_framebuffer_multisample_coverage",
|
||||
extString)) {
|
||||
if (extensions.has("GL_NV_framebuffer_multisample_coverage")) {
|
||||
GR_GL_GET_PROC_SUFFIX(RenderbufferStorageMultisampleCoverage, NV);
|
||||
}
|
||||
interface->fScissor = glScissor;
|
||||
|
@ -123,10 +132,9 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
interface->fTexImage2D = glTexImage2D;
|
||||
interface->fTexParameteri = glTexParameteri;
|
||||
interface->fTexParameteriv = glTexParameteriv;
|
||||
if (glVer >= GR_GL_VER(4,2) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_storage", extString)) {
|
||||
if (glVer >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) {
|
||||
GR_GL_GET_PROC(TexStorage2D);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_texture_storage", extString)) {
|
||||
} else if (extensions.has("GL_EXT_texture_storage")) {
|
||||
GR_GL_GET_PROC_SUFFIX(TexStorage2D, EXT);
|
||||
}
|
||||
interface->fTexSubImage2D = glTexSubImage2D;
|
||||
|
@ -158,9 +166,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
|
||||
// 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) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_framebuffer_object",
|
||||
extString)) {
|
||||
if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) {
|
||||
GR_GL_GET_PROC(GenFramebuffers);
|
||||
GR_GL_GET_PROC(GetFramebufferAttachmentParameteriv);
|
||||
GR_GL_GET_PROC(GetRenderbufferParameteriv);
|
||||
|
@ -175,8 +181,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
GR_GL_GET_PROC(BindRenderbuffer);
|
||||
GR_GL_GET_PROC(RenderbufferStorageMultisample);
|
||||
GR_GL_GET_PROC(BlitFramebuffer);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_framebuffer_object",
|
||||
extString)) {
|
||||
} else if (extensions.has("GL_EXT_framebuffer_object")) {
|
||||
GR_GL_GET_PROC_SUFFIX(GenFramebuffers, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT);
|
||||
|
@ -189,12 +194,10 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
GR_GL_GET_PROC_SUFFIX(DeleteRenderbuffers, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT);
|
||||
GR_GL_GET_PROC_SUFFIX(BindRenderbuffer, EXT);
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample",
|
||||
extString)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_multisample")) {
|
||||
GR_GL_GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT);
|
||||
}
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_blit",
|
||||
extString)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_blit")) {
|
||||
GR_GL_GET_PROC_SUFFIX(BlitFramebuffer, EXT);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "gl/GrGLExtensions.h"
|
||||
#include "gl/GrGLInterface.h"
|
||||
#include "../GrGLUtil.h"
|
||||
#include "gl/GrGLUtil.h"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
|
@ -48,12 +49,26 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
if (NULL == alu.get()) {
|
||||
return NULL;
|
||||
}
|
||||
GrGLGetStringProc glGetString =
|
||||
(GrGLGetStringProc) GetProcAddress(alu.get(), "glGetString");
|
||||
|
||||
if (NULL != wglGetCurrentContext()) {
|
||||
|
||||
// These should always be present and don't require wglGetProcAddress
|
||||
GrGLGetStringProc glGetString =
|
||||
(GrGLGetStringProc) GetProcAddress(alu.get(), "glGetString");
|
||||
GrGLGetIntegervProc glGetIntegerv =
|
||||
(GrGLGetIntegervProc) GetProcAddress(alu.get(), "glGetIntegerv");
|
||||
if (NULL == glGetString || NULL == glGetIntegerv) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// This may or may not succeed depending on the gl version.
|
||||
GrGLGetStringiProc glGetStringi = (GrGLGetStringiProc) wglGetProcAddress("glGetStringi");
|
||||
|
||||
GrGLExtensions extensions;
|
||||
if (!extensions.init(kDesktop_GrGLBinding, glGetString, glGetStringi, glGetIntegerv)) {
|
||||
return NULL;
|
||||
}
|
||||
const char* versionString = (const char*) glGetString(GR_GL_VERSION);
|
||||
const char* extString = (const char*) glGetString(GR_GL_EXTENSIONS);
|
||||
GrGLVersion glVer = GrGLGetVersionFromString(versionString);
|
||||
|
||||
if (glVer < GR_GL_VER(1,5)) {
|
||||
|
@ -68,8 +83,8 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
SET_PROC(BlendFunc)
|
||||
|
||||
if (glVer >= GR_GL_VER(1,4) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_imaging", extString) ||
|
||||
GrGLHasExtensionFromString("GL_EXT_blend_color", extString)) {
|
||||
extensions.has("GL_ARB_imaging") ||
|
||||
extensions.has("GL_EXT_blend_color")) {
|
||||
WGL_SET_PROC(BlendColor);
|
||||
}
|
||||
|
||||
|
@ -107,10 +122,9 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
SET_PROC(TexImage2D)
|
||||
SET_PROC(TexParameteri)
|
||||
SET_PROC(TexParameteriv)
|
||||
if (glVer >= GR_GL_VER(4,2) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_storage", extString)) {
|
||||
if (glVer >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) {
|
||||
WGL_SET_PROC(TexStorage2D);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_texture_storage", extString)) {
|
||||
} else if (extensions.has("GL_EXT_texture_storage")) {
|
||||
WGL_SET_PROC_SUFFIX(TexStorage2D, EXT);
|
||||
}
|
||||
SET_PROC(TexSubImage2D)
|
||||
|
@ -142,12 +156,11 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
WGL_SET_PROC(GetQueryiv);
|
||||
WGL_SET_PROC(GetQueryObjectiv);
|
||||
WGL_SET_PROC(GetQueryObjectuiv);
|
||||
if (glVer > GR_GL_VER(3,3) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_timer_query", extString)) {
|
||||
if (glVer > GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) {
|
||||
WGL_SET_PROC(GetQueryObjecti64v);
|
||||
WGL_SET_PROC(GetQueryObjectui64v);
|
||||
WGL_SET_PROC(QueryCounter);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_timer_query", extString)) {
|
||||
} else if (extensions.has("GL_EXT_timer_query")) {
|
||||
WGL_SET_PROC_SUFFIX(GetQueryObjecti64v, EXT);
|
||||
WGL_SET_PROC_SUFFIX(GetQueryObjectui64v, EXT);
|
||||
}
|
||||
|
@ -155,9 +168,10 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
WGL_SET_PROC(GetProgramiv);
|
||||
WGL_SET_PROC(GetShaderInfoLog);
|
||||
WGL_SET_PROC(GetShaderiv);
|
||||
WGL_SET_PROC(GetStringi)
|
||||
WGL_SET_PROC(GetUniformLocation);
|
||||
WGL_SET_PROC(LinkProgram);
|
||||
if (GrGLHasExtensionFromString("GL_NV_framebuffer_multisample_coverage", extString)) {
|
||||
if (extensions.has("GL_NV_framebuffer_multisample_coverage")) {
|
||||
WGL_SET_PROC_SUFFIX(RenderbufferStorageMultisampleCoverage, NV);
|
||||
}
|
||||
WGL_SET_PROC(ShaderSource);
|
||||
|
@ -190,8 +204,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
|
||||
// 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) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_framebuffer_object", extString)) {
|
||||
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);
|
||||
|
@ -206,8 +219,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
WGL_SET_PROC(BindRenderbuffer);
|
||||
WGL_SET_PROC(RenderbufferStorageMultisample);
|
||||
WGL_SET_PROC(BlitFramebuffer);
|
||||
} else if (GrGLHasExtensionFromString("GL_EXT_framebuffer_object",
|
||||
extString)) {
|
||||
} else if (extensions.has("GL_EXT_framebuffer_object")) {
|
||||
WGL_SET_PROC_SUFFIX(GenFramebuffers, EXT);
|
||||
WGL_SET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT);
|
||||
WGL_SET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT);
|
||||
|
@ -220,10 +232,10 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
WGL_SET_PROC_SUFFIX(DeleteRenderbuffers, EXT);
|
||||
WGL_SET_PROC_SUFFIX(FramebufferRenderbuffer, EXT);
|
||||
WGL_SET_PROC_SUFFIX(BindRenderbuffer, EXT);
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample", extString)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_multisample")) {
|
||||
WGL_SET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT);
|
||||
}
|
||||
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_blit", extString)) {
|
||||
if (extensions.has("GL_EXT_framebuffer_blit")) {
|
||||
WGL_SET_PROC_SUFFIX(BlitFramebuffer, EXT);
|
||||
}
|
||||
} else {
|
||||
|
@ -234,7 +246,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||
WGL_SET_PROC(MapBuffer);
|
||||
WGL_SET_PROC(UnmapBuffer);
|
||||
|
||||
if (GrGLHasExtensionFromString("GL_NV_path_rendering", extString)) {
|
||||
if (extensions.has("GL_NV_path_rendering")) {
|
||||
WGL_SET_PROC_SUFFIX(PathCommands, NV);
|
||||
WGL_SET_PROC_SUFFIX(PathCoords, NV);
|
||||
WGL_SET_PROC_SUFFIX(PathSubCommands, NV);
|
||||
|
|
Загрузка…
Ссылка в новой задаче