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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 2934733002: Workaround for Intel 6xxx clear to 0/1 bug (Closed)
Patch Set: rebase and move GLWorkarounds to a member of GLContext Created 3 years, 6 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
« ui/gl/gl_context.h ('K') | « ui/gl/gl_gl_api_implementation.h ('k') | 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 ecd5881e5c607a067e910a0ac23979c9be967a76..8a12fc6ab982d2aee78e4ec3c06d36436e962a8a 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -423,6 +423,21 @@ void RealGLApi::glClearFn(GLbitfield mask) {
GLApiBase::glClearFn(mask);
}
+void RealGLApi::glClearColorFn(GLclampf red,
+ GLclampf green,
+ GLclampf blue,
+ GLclampf alpha) {
+ if (GLContext::GetGLWorkarounds().clear_to_zero_or_one_broken &&
+ (1 == red || 0 == red) && (1 == green || 0 == green) &&
+ (1 == blue || 0 == blue) && (1 == alpha || 0 == alpha)) {
+ if (1 == alpha)
+ alpha = 2;
+ else
+ alpha = -1;
+ }
+ GLApiBase::glClearColorFn(red, green, blue, alpha);
+}
+
void RealGLApi::glDrawArraysFn(GLenum mode, GLint first, GLsizei count) {
if (!g_null_draw_bindings_enabled)
GLApiBase::glDrawArraysFn(mode, first, count);
« ui/gl/gl_context.h ('K') | « ui/gl/gl_gl_api_implementation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698