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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 11734037: Restore gl scissor state when switching FBO targets on Qualcomm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 12 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index 672f1ea47473ec8e1b1d43b922f9c0c68dda102b..d9f5f63e59146318b4e41ce295be85256d8f903c 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -112,9 +112,9 @@ void VirtualGLApi::Initialize(DriverGL* driver, GLContext* real_context) {
bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
bool switched_contexts = g_current_gl_context != this;
- GLSurface* current_surface = GLSurface::GetCurrent();
- if (switched_contexts || surface != current_surface) {
- if (!switched_contexts && current_surface &&
+ bool switched_surfaces = GLSurface::GetCurrent() != surface;
brianderson 2013/01/04 22:00:56 Note: This comparison is almost always false beca
+ if (switched_contexts || switched_surfaces) {
+ if (!switched_contexts && GLSurface::GetCurrent() &&
virtual_context->IsCurrent(surface)) {
// MakeCurrent 'lite' path that avoids potentially expensive MakeCurrent()
// calls if the GLSurface uses the same underlying surface or renders to
@@ -132,7 +132,13 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
DCHECK(real_context_->IsCurrent(GLSurface::GetCurrent()));
DCHECK(virtual_context->IsCurrent(surface));
- if (switched_contexts || virtual_context != current_context_) {
+ // This work around restores gl state on virtual context switches
+ // where only the surface changes.
+ bool qualcomm_WAR_enabled = true; // TODO: Set this only when needed.
+ bool use_qualcomm_WAR = qualcomm_WAR_enabled && switched_surfaces;
+
+ if (switched_contexts || virtual_context != current_context_ ||
+ use_qualcomm_WAR) {
// There should be no errors from the previous context leaking into the
// new context.
DCHECK_EQ(glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698