diff options
author | 2016-11-28 15:23:57 -0500 | |
---|---|---|
committer | 2016-11-29 18:23:59 +0000 | |
commit | 32ac83ebdc4ac967aae95a48a62c991d459dab73 (patch) | |
tree | 5860dff33fb1f398e7de56b47c3984119417e13d /src/gpu/gl | |
parent | c18baa11a0c4611b71f59b68c06796615e2a2912 (diff) |
Add #define for Nsight compatibility
NVIDIA's Nsight tool is not compatible with certain GL calls. This
change places them behind a #define in GrGLGpu.cpp.
BUG=skia:
Change-Id: Id80ed291b6fe4fd777c5690b25d4fbb47de3c187
Reviewed-on: https://skia-review.googlesource.com/5281
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index af44af4338..58051f8225 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -47,6 +47,8 @@ #define CHECK_ALLOC_ERROR(iface) GR_GL_NO_ERROR #endif +//#define USE_NSIGHT + /////////////////////////////////////////////////////////////////////////////// using gr_instanced::InstancedRendering; @@ -494,8 +496,8 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { fHWBufferState[kXferGpuToCpu_GrBufferType].invalidate(); fHWDrawFace = GrDrawFace::kInvalid; - if (kGL_GrGLStandard == this->glStandard()) { +#ifndef USE_NSIGHT // Desktop-only state that we never change if (!this->glCaps().isCoreProfile()) { GL_CALL(Disable(GR_GL_POINT_SMOOTH)); @@ -512,6 +514,7 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { GL_CALL(Disable(GR_GL_COLOR_TABLE)); } GL_CALL(Disable(GR_GL_POLYGON_OFFSET_FILL)); +#endif // Since ES doesn't support glPointSize at all we always use the VS to // set the point size GL_CALL(Enable(GR_GL_VERTEX_PROGRAM_POINT_SIZE)); @@ -1977,6 +1980,7 @@ void GrGLGpu::flushScissor(const GrScissorState& scissorState, void GrGLGpu::flushWindowRectangles(const GrWindowRectsState& windowState, const GrGLRenderTarget* rt) { +#ifndef USE_NSIGHT typedef GrWindowRectsState::Mode Mode; SkASSERT(!windowState.enabled() || rt->renderFBOID()); // Window rects can't be used on-screen. SkASSERT(windowState.numWindows() <= this->caps()->maxWindowRectangles()); @@ -2003,14 +2007,17 @@ void GrGLGpu::flushWindowRectangles(const GrWindowRectsState& windowState, GL_CALL(WindowRectangles(glmode, numWindows, glwindows->asInts())); fHWWindowRectsState.set(rt->origin(), rt->getViewport(), windowState); +#endif } void GrGLGpu::disableWindowRectangles() { +#ifndef USE_NSIGHT if (!this->caps()->maxWindowRectangles() || fHWWindowRectsState.knownDisabled()) { return; } GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr)); fHWWindowRectsState.setDisabled(); +#endif } void GrGLGpu::flushMinSampleShading(float minSampleShading) { |