OLD | NEW |
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 Loading... |
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 (GLContext::GetGLWorkarounds().clear_to_zero_or_one_broken && |
| 431 (1 == red || 0 == red) && (1 == green || 0 == green) && |
| 432 (1 == blue || 0 == blue) && (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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 517 |
503 DebugGLApi::~DebugGLApi() {} | 518 DebugGLApi::~DebugGLApi() {} |
504 | 519 |
505 NoContextGLApi::NoContextGLApi() { | 520 NoContextGLApi::NoContextGLApi() { |
506 } | 521 } |
507 | 522 |
508 NoContextGLApi::~NoContextGLApi() { | 523 NoContextGLApi::~NoContextGLApi() { |
509 } | 524 } |
510 | 525 |
511 } // namespace gl | 526 } // namespace gl |
OLD | NEW |