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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_gl_api_implementation.h" 5 #include "ui/gl/gl_gl_api_implementation.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 GLenum gl_internal_format = GetInternalFormat(version_.get(), internalformat); 416 GLenum gl_internal_format = GetInternalFormat(version_.get(), internalformat);
417 GLApiBase::glRenderbufferStorageMultisampleFn( 417 GLApiBase::glRenderbufferStorageMultisampleFn(
418 target, samples, gl_internal_format, width, height); 418 target, samples, gl_internal_format, width, height);
419 } 419 }
420 420
421 void RealGLApi::glClearFn(GLbitfield mask) { 421 void RealGLApi::glClearFn(GLbitfield mask) {
422 if (!g_null_draw_bindings_enabled) 422 if (!g_null_draw_bindings_enabled)
423 GLApiBase::glClearFn(mask); 423 GLApiBase::glClearFn(mask);
424 } 424 }
425 425
426 void RealGLApi::glClearColorFn(GLclampf red,
427 GLclampf green,
428 GLclampf blue,
429 GLclampf alpha) {
430 if (gl_workarounds_.clear_to_zero_or_one_broken && (1 == red || 0 == red) &&
431 (1 == green || 0 == green) && (1 == blue || 0 == blue) &&
432 (1 == alpha || 0 == alpha)) {
433 if (1 == alpha)
434 alpha = 2;
435 else
436 alpha = -1;
437 }
438 GLApiBase::glClearColorFn(red, green, blue, alpha);
439 }
440
426 void RealGLApi::glDrawArraysFn(GLenum mode, GLint first, GLsizei count) { 441 void RealGLApi::glDrawArraysFn(GLenum mode, GLint first, GLsizei count) {
427 if (!g_null_draw_bindings_enabled) 442 if (!g_null_draw_bindings_enabled)
428 GLApiBase::glDrawArraysFn(mode, first, count); 443 GLApiBase::glDrawArraysFn(mode, first, count);
429 } 444 }
430 445
431 void RealGLApi::glDrawElementsFn(GLenum mode, 446 void RealGLApi::glDrawElementsFn(GLenum mode,
432 GLsizei count, 447 GLsizei count,
433 GLenum type, 448 GLenum type,
434 const void* indices) { 449 const void* indices) {
435 if (!g_null_draw_bindings_enabled) 450 if (!g_null_draw_bindings_enabled)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 filtered_exts_.push_back(gl_extension); 499 filtered_exts_.push_back(gl_extension);
485 } 500 }
486 filtered_exts_str_ = base::JoinString(filtered_exts_, " "); 501 filtered_exts_str_ = base::JoinString(filtered_exts_, " ");
487 } 502 }
488 #if DCHECK_IS_ON() 503 #if DCHECK_IS_ON()
489 filtered_exts_initialized_ = true; 504 filtered_exts_initialized_ = true;
490 #endif 505 #endif
491 } 506 }
492 } 507 }
493 508
509 void RealGLApi::set_gl_workarounds(const GLWorkarounds& workarounds) {
510 gl_workarounds_ = workarounds;
511 }
512
494 void RealGLApi::set_version(std::unique_ptr<GLVersionInfo> version) { 513 void RealGLApi::set_version(std::unique_ptr<GLVersionInfo> version) {
495 version_ = std::move(version); 514 version_ = std::move(version);
496 } 515 }
497 516
498 TraceGLApi::~TraceGLApi() { 517 TraceGLApi::~TraceGLApi() {
499 } 518 }
500 519
501 DebugGLApi::DebugGLApi(GLApi* gl_api) : gl_api_(gl_api) {} 520 DebugGLApi::DebugGLApi(GLApi* gl_api) : gl_api_(gl_api) {}
502 521
503 DebugGLApi::~DebugGLApi() {} 522 DebugGLApi::~DebugGLApi() {}
504 523
505 NoContextGLApi::NoContextGLApi() { 524 NoContextGLApi::NoContextGLApi() {
506 } 525 }
507 526
508 NoContextGLApi::~NoContextGLApi() { 527 NoContextGLApi::~NoContextGLApi() {
509 } 528 }
510 529
511 } // namespace gl 530 } // namespace gl
OLDNEW
« 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