Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1415503008: Fix setColocatedSampleLocations on ES and GL < 4.5 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index dc3ea0c3d782afd8afdd6e6172e395b08d87f180..0e9aa0d917850884ba45998e8c26023544c6b470 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2035,9 +2035,17 @@ void GrGLGpu::setColocatedSampleLocations(GrRenderTarget* rt, bool useColocatedS
return;
}
- GL_CALL(NamedFramebufferParameteri(target->renderFBOID(),
- GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS,
- useColocatedSampleLocations));
+ if (kGL_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(4,5)) {
Chris Dalton 2015/11/03 07:21:30 Would it be ok/consistent/better to just check the
bsalomon 2015/11/03 15:21:12 In general we don't do that. You could add a enum
Chris Dalton 2015/11/03 15:49:15 No problem. Would you actually prefer another cap?
bsalomon 2015/11/03 15:54:22 Whatever works for you
+ GL_CALL(NamedFramebufferParameteri(target->renderFBOID(),
+ GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS,
+ useColocatedSampleLocations));
+ } else {
+ GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, target->renderFBOID()));
+ GL_CALL(FramebufferParameteri(GR_GL_FRAMEBUFFER,
+ GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS,
+ useColocatedSampleLocations));
+ fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID;
+ }
target->flagAsUsingColocatedSampleLocations(useColocatedSampleLocations);
}

Powered by Google App Engine
This is Rietveld 408576698