aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-02 19:42:54 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-02 19:42:54 +0000
commit00142c44057e5a7c156b17a4bfc98a9605cf3f18 (patch)
tree2b22c0bad592edf041471719080b05ded059984f
parent5bdfb331ac650cf464baa96a49e2473ee10a515c (diff)
Fix GL extension printing on core profiles.
R=robertphillips@google.com Review URL: https://codereview.chromium.org/14864002 git-svn-id: http://skia.googlecode.com/svn/trunk@8970 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/gpu/gl/GrGLExtensions.h2
-rw-r--r--src/gpu/gl/GrGLContext.h4
-rw-r--r--src/gpu/gl/GrGLExtensions.cpp11
-rw-r--r--src/gpu/gl/GrGpuGL.cpp6
4 files changed, 18 insertions, 5 deletions
diff --git a/include/gpu/gl/GrGLExtensions.h b/include/gpu/gl/GrGLExtensions.h
index d0970a650d..f4e950a7ad 100644
--- a/include/gpu/gl/GrGLExtensions.h
+++ b/include/gpu/gl/GrGLExtensions.h
@@ -40,6 +40,8 @@ public:
void reset() { fStrings.reset(); }
+ void print(const char* sep = "\n") const;
+
private:
SkTArray<SkString> fStrings;
};
diff --git a/src/gpu/gl/GrGLContext.h b/src/gpu/gl/GrGLContext.h
index 71b3861a94..172cd8b864 100644
--- a/src/gpu/gl/GrGLContext.h
+++ b/src/gpu/gl/GrGLContext.h
@@ -49,10 +49,10 @@ public:
GrGLVendor vendor() const { return fVendor; }
const GrGLCaps* caps() const { return fGLCaps.get(); }
GrGLCaps* caps() { return fGLCaps; }
+ const GrGLExtensions& extensions() const { return fExtensions; }
/**
- * Checks for extension support using a cached copy of the GL_EXTENSIONS
- * string.
+ * Shortcut for extensions().has(ext);
*/
bool hasExtension(const char* ext) const {
if (!this->isInitialized()) {
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index 47cdba14b8..232ea7c0cf 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -81,3 +81,14 @@ bool GrGLExtensions::has(const char* ext) const {
sizeof(SkString));
return idx >= 0;
}
+
+void GrGLExtensions::print(const char* sep) const {
+ if (NULL == sep) {
+ sep = " ";
+ }
+ int cnt = fStrings.count();
+ for (int i = 0; i < cnt; ++i) {
+ GrPrintf("%s%s", fStrings[i].c_str(), (i < cnt - 1) ? sep : "");
+ }
+}
+
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index a0121d7d82..7cf70218e0 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -161,8 +161,6 @@ GrGpuGL::GrGpuGL(const GrGLContext& ctx, GrContext* context)
GrGLClearErr(fGLContext.interface());
if (gPrintStartupSpew) {
- const GrGLubyte* ext;
- GL_CALL_RET(ext, GetString(GR_GL_EXTENSIONS));
const GrGLubyte* vendor;
const GrGLubyte* renderer;
const GrGLubyte* version;
@@ -174,7 +172,9 @@ GrGpuGL::GrGpuGL(const GrGLContext& ctx, GrContext* context)
GrPrintf("------ VENDOR %s\n", vendor);
GrPrintf("------ RENDERER %s\n", renderer);
GrPrintf("------ VERSION %s\n", version);
- GrPrintf("------ EXTENSIONS\n %s \n", ext);
+ GrPrintf("------ EXTENSIONS\n");
+ ctx.info().extensions().print();
+ GrPrintf("\n");
ctx.info().caps()->print();
}