aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer
diff options
context:
space:
mode:
Diffstat (limited to 'tools/viewer')
-rw-r--r--tools/viewer/sk_app/win/GLWindowContext_win.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/viewer/sk_app/win/GLWindowContext_win.cpp b/tools/viewer/sk_app/win/GLWindowContext_win.cpp
index 055abf358d..24db9659f0 100644
--- a/tools/viewer/sk_app/win/GLWindowContext_win.cpp
+++ b/tools/viewer/sk_app/win/GLWindowContext_win.cpp
@@ -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);