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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/webgl/WebGL2RenderingContextBase.h" 5 #include "modules/webgl/WebGL2RenderingContextBase.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "bindings/modules/v8/WebGLAny.h" 8 #include "bindings/modules/v8/WebGLAny.h"
9 #include "core/frame/ImageBitmap.h" 9 #include "core/frame/ImageBitmap.h"
10 #include "core/html/HTMLCanvasElement.h" 10 #include "core/html/HTMLCanvasElement.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 GLint dst_y0, 420 GLint dst_y0,
421 GLint dst_x1, 421 GLint dst_x1,
422 GLint dst_y1, 422 GLint dst_y1,
423 GLbitfield mask, 423 GLbitfield mask,
424 GLenum filter) { 424 GLenum filter) {
425 if (isContextLost()) 425 if (isContextLost())
426 return; 426 return;
427 427
428 ContextGL()->BlitFramebufferCHROMIUM(src_x0, src_y0, src_x1, src_y1, dst_x0, 428 ContextGL()->BlitFramebufferCHROMIUM(src_x0, src_y0, src_x1, src_y1, dst_x0,
429 dst_y0, dst_x1, dst_y1, mask, filter); 429 dst_y0, dst_x1, dst_y1, mask, filter);
430
431 // If blitting from a user-defined framebuffer to the default back
432 // buffer, there is a possibility of overwriting the alpha channel
433 // in ways that can result in incorrect compositing. Notify the
434 // DrawingBuffer in this case.
435 if (read_framebuffer_binding_ && !framebuffer_binding_) {
436 GetDrawingBuffer()->MarkBlitFramebufferUsedThisFrame();
437 }
430 } 438 }
431 439
432 bool WebGL2RenderingContextBase::ValidateTexFuncLayer(const char* function_name, 440 bool WebGL2RenderingContextBase::ValidateTexFuncLayer(const char* function_name,
433 GLenum tex_target, 441 GLenum tex_target,
434 GLint layer) { 442 GLint layer) {
435 if (layer < 0) { 443 if (layer < 0) {
436 SynthesizeGLError(GL_INVALID_VALUE, function_name, "layer out of range"); 444 SynthesizeGLError(GL_INVALID_VALUE, function_name, "layer out of range");
437 return false; 445 return false;
438 } 446 }
439 switch (tex_target) { 447 switch (tex_target) {
(...skipping 5317 matching lines...) Expand 10 before | Expand all | Expand 10 after
5757 5765
5758 void WebGL2RenderingContextBase:: 5766 void WebGL2RenderingContextBase::
5759 DrawingBufferClientRestorePixelUnpackBufferBinding() { 5767 DrawingBufferClientRestorePixelUnpackBufferBinding() {
5760 if (!ContextGL()) 5768 if (!ContextGL())
5761 return; 5769 return;
5762 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 5770 ContextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER,
5763 ObjectOrZero(bound_pixel_unpack_buffer_.Get())); 5771 ObjectOrZero(bound_pixel_unpack_buffer_.Get()));
5764 } 5772 }
5765 5773
5766 } // namespace blink 5774 } // namespace blink
OLDNEW
« 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