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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2879593003: super hacky opaque black clear bug workaround
Patch Set: Created 3 years, 7 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 | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index cd29b4cb87ec7ff9eda0e9947fc8609971f9a7a0..d1614cba0bd8e72c96234c1f474e78a643676e16 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2137,7 +2137,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
// If the back buffer has a non-emulated alpha channel, the clear color should
// be 0. Otherwise, the clear color should be 1.
GLfloat BackBufferAlphaClearColor() const {
- return offscreen_buffer_should_have_alpha_ ? 0.f : 1.f;
+ return offscreen_buffer_should_have_alpha_ ? 0.f : 1.001f;
}
// Set remaining commands to process to 0 to force DoCommands to return
@@ -2613,7 +2613,7 @@ ScopedResolvedFramebufferBinder::ScopedResolvedFramebufferBinder(
decoder_->offscreen_target_frame_buffer_->id());
decoder_->state_.SetDeviceColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
decoder->state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false);
- glClearColor(0, 0, 0, 1);
+ glClearColor(0, 0, 0, 1.001);
glClear(GL_COLOR_BUFFER_BIT);
decoder_->RestoreClearState();
}
@@ -3587,7 +3587,7 @@ bool GLES2DecoderImpl::Initialize(
// alpha, clear the surface alpha to 1.0 to be correct on ReadPixels/etc.
bool clear_alpha = back_buffer_color_format_ == GL_RGB && alpha_bits > 0;
if (clear_alpha) {
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+ glClearColor(0.0f, 0.0f, 0.0f, 1.001f);
}
// Clear the backbuffer.
@@ -7717,7 +7717,7 @@ void GLES2DecoderImpl::RestoreClearState() {
framebuffer_state_.clear_state_dirty = true;
glClearColor(
state_.color_clear_red, state_.color_clear_green, state_.color_clear_blue,
- state_.color_clear_alpha);
+ state_.color_clear_alpha + 0.001);
glClearStencil(state_.stencil_clear);
glClearDepth(state_.depth_clear);
state_.SetDeviceCapabilityState(GL_SCISSOR_TEST,
@@ -8652,7 +8652,7 @@ bool GLES2DecoderImpl::VerifyMultisampleRenderbufferIntegrity(
state_.SetDeviceColorMask(
color_mask[0], color_mask[1], color_mask[2], color_mask[3]);
- glClearColor(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+ glClearColor(clear_color[0], clear_color[1], clear_color[2], clear_color[3] + 0.001);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, draw_framebuffer);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER, read_framebuffer);
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698