aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-03-17 12:05:41 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-17 17:43:19 +0000
commitb2082afc1d2076576327d9d1de5fbec6b13403fe (patch)
treeafed4137333490c38050b6a47c3f3701d582a09a /tools
parentce91b19b1080fccbb33dcdc4b3a34f6c82dad603 (diff)
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>
Diffstat (limited to 'tools')
-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);