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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 2934733002: Workaround for Intel 6xxx clear to 0/1 bug (Closed)
Patch Set: rebased, rename setGLWorkarounds to set_gl_workarounds Created 3 years, 5 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 | « ui/gl/gl_gl_api_implementation.h ('k') | ui/gl/gl_workarounds.h » ('j') | 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..bc55bfb5433232b72df829bddc8fd438666ea8fc 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 (gl_workarounds_.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);
@@ -491,6 +506,10 @@ void RealGLApi::InitializeFilteredExtensions() {
}
}
+void RealGLApi::set_gl_workarounds(const GLWorkarounds& workarounds) {
+ gl_workarounds_ = workarounds;
+}
+
void RealGLApi::set_version(std::unique_ptr<GLVersionInfo> version) {
version_ = std::move(version);
}
« no previous file with comments | « ui/gl/gl_gl_api_implementation.h ('k') | ui/gl/gl_workarounds.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698