diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/GrGLContext.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLExtensions.cpp | 11 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 6 |
3 files changed, 16 insertions, 5 deletions
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(); } |