Detect RenderDoc in Windows viewer and make a core profile
BUG=skia: Change-Id: I03a8a1b1ed9bd2483ddd8e231ba54dc10753b454 Reviewed-on: https://skia-review.googlesource.com/9836 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
ce91b19b10
commit
b2082afc1d
@ -58,6 +58,21 @@ void GLWindowContext_win::onInitializeContext() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Look to see if RenderDoc is attached. If so, re-create the context with a core profile
|
||||
if (wglMakeCurrent(dc, fHGLRC)) {
|
||||
const GrGLInterface* glInterface = GrGLCreateNativeInterface();
|
||||
bool renderDocAttached = glInterface->hasExtension("GL_EXT_debug_tool");
|
||||
SkSafeUnref(glInterface);
|
||||
if (renderDocAttached) {
|
||||
wglDeleteContext(fHGLRC);
|
||||
fHGLRC = SkCreateWGLContext(dc, fDisplayParams.fMSAASampleCount, false /* deepColor */,
|
||||
kGLPreferCoreProfile_SkWGLContextRequest);
|
||||
if (NULL == fHGLRC) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wglMakeCurrent(dc, fHGLRC)) {
|
||||
glClearStencil(0);
|
||||
glClearColor(0, 0, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user