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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 2934733002: Workaround for Intel 6xxx clear to 0/1 bug (Closed)
Patch Set: 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
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..4772c696e8c8ec02503bf74f1b7542b9cdbb82a1 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::setGLWorkarounds(const GLWorkarounds& workarounds) {
+ gl_workarounds_ = workarounds;
+}
+
void RealGLApi::set_version(std::unique_ptr<GLVersionInfo> version) {
version_ = std::move(version);
}

Powered by Google App Engine
This is Rietveld 408576698