aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-06-16 14:08:04 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-06-16 14:08:04 +0000
commite67bd3fbc9bcd0929033635d546544527784b4c0 (patch)
treecc14b4e092a2d5986cb6e1581c9457a9bead20b6
parent716a0387ca197ca728ba691f3d812d4252c0f10b (diff)
Rename GrGLBug to GrGLCapability.
Default all architectures to kProbe_GrGLCapability. Use new facilities better from GrGpuGL.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@1613 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--gpu/include/GrGLInterface.h8
-rw-r--r--gpu/src/GrGpuGL.cpp10
-rw-r--r--gpu/src/android/GrGLDefaultInterface_android.cpp6
-rw-r--r--gpu/src/mac/GrGLDefaultInterface_mac.cpp6
-rw-r--r--gpu/src/mesa/GrGLDefaultInterface_mesa.cpp6
-rw-r--r--gpu/src/unix/GrGLDefaultInterface_unix.cpp6
-rw-r--r--gpu/src/win/GrGLDefaultInterface_win.cpp6
7 files changed, 25 insertions, 23 deletions
diff --git a/gpu/include/GrGLInterface.h b/gpu/include/GrGLInterface.h
index 5802ec4f3b..e3942cd203 100644
--- a/gpu/include/GrGLInterface.h
+++ b/gpu/include/GrGLInterface.h
@@ -205,8 +205,8 @@ extern "C" {
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFragDataLocationIndexedProc)(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar * name);
} // extern "C"
-enum GrGLBug {
- kProbe_GrGLBug = -1
+enum GrGLCapability {
+ kProbe_GrGLCapability = -1
};
/*
@@ -226,12 +226,12 @@ struct GrGLInterface {
GrGLBinding fBindingsExported;
/// Does this GL support NPOT textures on FBOs?
- /// boolean value, or kProbe_GrGLBug to probe (slowly) at context creation.
+ /// boolean value, or kProbe_GrGLCapability to probe (slowly) at context creation.
int fNPOTRenderTargetSupport;
/// Some GL implementations (PowerVR SGX devices like the iPhone 4)
/// have restrictions on the size of small render targets.
- /// kProbe_GrGLBug to probe (slowly) at context creation.
+ /// kProbe_GrGLCapability to probe (slowly) at context creation.
int fMinRenderTargetHeight;
int fMinRenderTargetWidth;
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index 973e1e4a53..e40024a837 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -471,11 +471,13 @@ GrGpuGL::GrGpuGL() {
// TODO: Make these a preprocess that generate some compile time constants.
// TODO: probe once at startup, rather than once per context creation.
- if (GrGLGetGLInterface()->fNPOTRenderTargetSupport < 0) {
+ int expectNPOTTargets = GrGLGetGLInterface()->fNPOTRenderTargetSupport;
+ if (expectNPOTTargets == kProbe_GrGLCapability) {
fNPOTRenderTargetSupport =
probe_for_npot_render_target_support(fNPOTTextureSupport);
} else {
- fNPOTRenderTargetSupport = GrGLGetGLInterface()->fNPOTRenderTargetSupport;
+ GrAssert(expectNPOTTargets == 0 || expectNPOTTargets == 1);
+ fNPOTRenderTargetSupport = static_cast<bool>(expectNPOTTargets);
}
if (gPrintStartupSpew) {
@@ -503,14 +505,14 @@ GrGpuGL::GrGpuGL() {
fMaxRenderTargetSize = GrMin(fMaxTextureSize, fMaxRenderTargetSize);
fMinRenderTargetHeight = GrGLGetGLInterface()->fMinRenderTargetHeight;
- if (fMinRenderTargetHeight < 0) {
+ if (fMinRenderTargetHeight == kProbe_GrGLCapability) {
fMinRenderTargetHeight =
probe_for_min_render_target_height(fNPOTRenderTargetSupport,
fMaxRenderTargetSize);
}
fMinRenderTargetWidth = GrGLGetGLInterface()->fMinRenderTargetWidth;
- if (fMinRenderTargetWidth < 0) {
+ if (fMinRenderTargetWidth == kProbe_GrGLCapability) {
fMinRenderTargetWidth =
probe_for_min_render_target_width(fNPOTRenderTargetSupport,
fMaxRenderTargetSize);
diff --git a/gpu/src/android/GrGLDefaultInterface_android.cpp b/gpu/src/android/GrGLDefaultInterface_android.cpp
index 54bc2f60d3..4c06f17770 100644
--- a/gpu/src/android/GrGLDefaultInterface_android.cpp
+++ b/gpu/src/android/GrGLDefaultInterface_android.cpp
@@ -19,9 +19,9 @@
void GrGLSetDefaultGLInterface() {
static GrGLInterface cmd_buffer_interface = {
kES2_GrGLBinding,
- kProbe_GrGLBug, // fNPOTRenderTargetSupport
- kProbe_GrGLBug, // fMinRenderTargetHeight
- kProbe_GrGLBug, // fMinRenderTargetWidth
+ kProbe_GrGLCapability, // fNPOTRenderTargetSupport
+ kProbe_GrGLCapability, // fMinRenderTargetHeight
+ kProbe_GrGLCapability, // fMinRenderTargetWidth
glActiveTexture,
glAttachShader,
glBindAttribLocation,
diff --git a/gpu/src/mac/GrGLDefaultInterface_mac.cpp b/gpu/src/mac/GrGLDefaultInterface_mac.cpp
index cfa528ab79..d21bdda755 100644
--- a/gpu/src/mac/GrGLDefaultInterface_mac.cpp
+++ b/gpu/src/mac/GrGLDefaultInterface_mac.cpp
@@ -23,9 +23,9 @@ void GrGLSetDefaultGLInterface() {
static GrGLInterface gDefaultInterface;
static bool gDefaultInterfaceInit;
if (!gDefaultInterfaceInit) {
- gDefaultInterface.fNPOTRenderTargetSupport = true;
- gDefaultInterface.fMinRenderTargetHeight = 1;
- gDefaultInterface.fMinRenderTargetWidth = 1;
+ gDefaultInterface.fNPOTRenderTargetSupport = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetHeight = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetWidth = kProbe_GrGLCapability;
gDefaultInterface.fActiveTexture = glActiveTexture;
gDefaultInterface.fAttachShader = glAttachShader;
diff --git a/gpu/src/mesa/GrGLDefaultInterface_mesa.cpp b/gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
index bc75a2c4c7..1324649896 100644
--- a/gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
+++ b/gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
@@ -38,9 +38,9 @@ void GrGLSetDefaultGLInterface() {
// We must have array and element_array buffer objects.
return;
}
- gDefaultInterface.fNPOTRenderTargetSupport = true;
- gDefaultInterface.fMinRenderTargetHeight = 1;
- gDefaultInterface.fMinRenderTargetWidth = 1;
+ gDefaultInterface.fNPOTRenderTargetSupport = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetHeight = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetWidth = kProbe_GrGLCapability;
gDefaultInterface.fActiveTexture = glActiveTexture;
GR_GL_GET_PROC(AttachShader);
diff --git a/gpu/src/unix/GrGLDefaultInterface_unix.cpp b/gpu/src/unix/GrGLDefaultInterface_unix.cpp
index 2e233e02b2..724f4381dc 100644
--- a/gpu/src/unix/GrGLDefaultInterface_unix.cpp
+++ b/gpu/src/unix/GrGLDefaultInterface_unix.cpp
@@ -40,9 +40,9 @@ void GrGLSetDefaultGLInterface() {
return;
}
- gDefaultInterface.fNPOTRenderTargetSupport = true;
- gDefaultInterface.fMinRenderTargetHeight = 1;
- gDefaultInterface.fMinRenderTargetWidth = 1;
+ gDefaultInterface.fNPOTRenderTargetSupport = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetHeight = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetWidth = kProbe_GrGLCapability;
gDefaultInterface.fActiveTexture = glActiveTexture;
GR_GL_GET_PROC(AttachShader);
diff --git a/gpu/src/win/GrGLDefaultInterface_win.cpp b/gpu/src/win/GrGLDefaultInterface_win.cpp
index 9b40a94edb..3bbd262a64 100644
--- a/gpu/src/win/GrGLDefaultInterface_win.cpp
+++ b/gpu/src/win/GrGLDefaultInterface_win.cpp
@@ -45,9 +45,9 @@ void GrGLSetDefaultGLInterface() {
return;
}
- gDefaultInterface.fNPOTRenderTargetSupport = true;
- gDefaultInterface.fMinRenderTargetHeight = 1;
- gDefaultInterface.fMinRenderTargetWidth = 1;
+ gDefaultInterface.fNPOTRenderTargetSupport = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetHeight = kProbe_GrGLCapability;
+ gDefaultInterface.fMinRenderTargetWidth = kProbe_GrGLCapability;
// Functions that are part of GL 1.1 will return NULL in
// wglGetProcAddress