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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2822743003: Preserve alpha channel of 1.0 when emulating RGB back buffer.
Patch Set: Created 3 years, 8 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: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index 3d554f9a4d72ac1c51e7d07e791a817fc4ce65d8..28962bf5e795f1333d31c31731e4f6c6955d500f 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -427,6 +427,14 @@ void WebGL2RenderingContextBase::blitFramebuffer(GLint src_x0,
ContextGL()->BlitFramebufferCHROMIUM(src_x0, src_y0, src_x1, src_y1, dst_x0,
dst_y0, dst_x1, dst_y1, mask, filter);
+
+ // If blitting from a user-defined framebuffer to the default back
+ // buffer, there is a possibility of overwriting the alpha channel
+ // in ways that can result in incorrect compositing. Notify the
+ // DrawingBuffer in this case.
+ if (read_framebuffer_binding_ && !framebuffer_binding_) {
+ GetDrawingBuffer()->MarkBlitFramebufferUsedThisFrame();
+ }
}
bool WebGL2RenderingContextBase::ValidateTexFuncLayer(const char* function_name,
« no previous file with comments | « content/test/gpu/gpu_tests/pixel_test_pages.py ('k') | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698