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
This commit is contained in:
parent
5bdfb331ac
commit
00142c4405
@ -40,6 +40,8 @@ public:
|
||||
|
||||
void reset() { fStrings.reset(); }
|
||||
|
||||
void print(const char* sep = "\n") const;
|
||||
|
||||
private:
|
||||
SkTArray<SkString> fStrings;
|
||||
};
|
||||
|
@ -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()) {
|
||||
|
@ -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 : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user