| Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
|
| index 7a26d0f0102499c20e5b3afe6f6e882fb03cdeeb..c41262a7c84d208adb2f66613bf496d4255bb80c 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
|
| @@ -232,6 +232,10 @@ bool DrawingBuffer::DefaultBufferRequiresAlphaChannelToBePreserved() {
|
| return !want_alpha_channel_ && rgb_emulation;
|
| }
|
|
|
| +void DrawingBuffer::MarkBlitFramebufferUsedThisFrame() {
|
| + blit_framebuffer_used_this_frame_ = true;
|
| +}
|
| +
|
| std::unique_ptr<cc::SharedBitmap> DrawingBuffer::CreateOrRecycleBitmap() {
|
| auto it = std::remove_if(
|
| recycled_bitmaps_.begin(), recycled_bitmaps_.end(),
|
| @@ -413,6 +417,7 @@ bool DrawingBuffer::FinishPrepareTextureMailboxGpu(
|
| front_color_buffer_ = color_buffer_for_mailbox;
|
|
|
| contents_changed_ = false;
|
| + blit_framebuffer_used_this_frame_ = false;
|
| SetBufferClearNeeded(true);
|
| return true;
|
| }
|
| @@ -1019,6 +1024,27 @@ void DrawingBuffer::ResolveMultisampleFramebufferInternal() {
|
| void DrawingBuffer::ResolveIfNeeded() {
|
| if (anti_aliasing_mode_ != kNone)
|
| ResolveMultisampleFramebufferInternal();
|
| +
|
| + // If the user performed a manual BlitFramebuffer to the default
|
| + // back buffer, they may have populated the alpha channel with
|
| + // values not equal to 1.0. Must undo this.
|
| + if (DefaultBufferRequiresAlphaChannelToBePreserved() &&
|
| + blit_framebuffer_used_this_frame_) {
|
| + // Avoid repeating this work if it's already been done.
|
| + if (anti_aliasing_mode_ != kNone &&
|
| + ContextProvider()
|
| + ->GetCapabilities()
|
| + .disable_multisampling_color_mask_usage) {
|
| + // Do nothing.
|
| + } else {
|
| + DCHECK(state_restorer_);
|
| + state_restorer_->SetClearStateDirty();
|
| + gl_->ClearColor(0, 0, 0, 1);
|
| + gl_->ColorMask(false, false, false, true);
|
| + gl_->Clear(GL_COLOR_BUFFER_BIT);
|
| + }
|
| + }
|
| +
|
| contents_change_resolved_ = true;
|
| }
|
|
|
|
|