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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

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 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Whether the target for draw operations has format GL_RGBA, but is 178 // Whether the target for draw operations has format GL_RGBA, but is
179 // emulating format GL_RGB. When the target's storage is first 179 // emulating format GL_RGB. When the target's storage is first
180 // allocated, its alpha channel must be cleared to 1. All future drawing 180 // allocated, its alpha channel must be cleared to 1. All future drawing
181 // operations must use a color mask with alpha=GL_FALSE. 181 // operations must use a color mask with alpha=GL_FALSE.
182 bool RequiresAlphaChannelToBePreserved(); 182 bool RequiresAlphaChannelToBePreserved();
183 183
184 // Similar to requiresAlphaChannelToBePreserved(), but always targets the 184 // Similar to requiresAlphaChannelToBePreserved(), but always targets the
185 // default framebuffer. 185 // default framebuffer.
186 bool DefaultBufferRequiresAlphaChannelToBePreserved(); 186 bool DefaultBufferRequiresAlphaChannelToBePreserved();
187 187
188 // Tells the DrawingBuffer that BlitFramebuffer was used to populate
189 // it this frame. This requires more expensive emulation in some
190 // circumstances.
191 void MarkBlitFramebufferUsedThisFrame();
192
188 WebLayer* PlatformLayer(); 193 WebLayer* PlatformLayer();
189 194
190 gpu::gles2::GLES2Interface* ContextGL(); 195 gpu::gles2::GLES2Interface* ContextGL();
191 WebGraphicsContext3DProvider* ContextProvider(); 196 WebGraphicsContext3DProvider* ContextProvider();
192 197
193 // cc::TextureLayerClient implementation. 198 // cc::TextureLayerClient implementation.
194 bool PrepareTextureMailbox(cc::TextureMailbox* out_mailbox, 199 bool PrepareTextureMailbox(cc::TextureMailbox* out_mailbox,
195 std::unique_ptr<cc::SingleReleaseCallback>* 200 std::unique_ptr<cc::SingleReleaseCallback>*
196 out_release_callback) override; 201 out_release_callback) override;
197 202
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 485
481 // True if our contents have been modified since the last presentation of this 486 // True if our contents have been modified since the last presentation of this
482 // buffer. 487 // buffer.
483 bool contents_changed_ = true; 488 bool contents_changed_ = true;
484 489
485 // True if resolveIfNeeded() has been called since the last time 490 // True if resolveIfNeeded() has been called since the last time
486 // markContentsChanged() had been called. 491 // markContentsChanged() had been called.
487 bool contents_change_resolved_ = false; 492 bool contents_change_resolved_ = false;
488 bool buffer_clear_needed_ = false; 493 bool buffer_clear_needed_ = false;
489 494
495 // True if BlitFramebuffer was used to populate the DrawingBuffer
496 // this past frame.
497 bool blit_framebuffer_used_this_frame_ = false;
498
490 // Whether the client wants a depth or stencil buffer. 499 // Whether the client wants a depth or stencil buffer.
491 const bool want_depth_; 500 const bool want_depth_;
492 const bool want_stencil_; 501 const bool want_stencil_;
493 502
494 // The color space of this buffer. All buffers are assumed to be sRGB until 503 // The color space of this buffer. All buffers are assumed to be sRGB until
495 // a mechanism for creating otherwise is exposed to the web. 504 // a mechanism for creating otherwise is exposed to the web.
496 const gfx::ColorSpace color_space_; 505 const gfx::ColorSpace color_space_;
497 506
498 enum AntialiasingMode { 507 enum AntialiasingMode {
499 kNone, 508 kNone,
(...skipping 28 matching lines...) Expand all
528 // RuntimeEnabledFeatures::webGLImageChromiumEnabled() call with 537 // RuntimeEnabledFeatures::webGLImageChromiumEnabled() call with
529 // shouldUseChromiumImage() calls, and set m_chromiumImageUsage to 538 // shouldUseChromiumImage() calls, and set m_chromiumImageUsage to
530 // DisallowChromiumImage in the case of OffscreenCanvas. 539 // DisallowChromiumImage in the case of OffscreenCanvas.
531 ChromiumImageUsage chromium_image_usage_; 540 ChromiumImageUsage chromium_image_usage_;
532 bool ShouldUseChromiumImage(); 541 bool ShouldUseChromiumImage();
533 }; 542 };
534 543
535 } // namespace blink 544 } // namespace blink
536 545
537 #endif // DrawingBuffer_h 546 #endif // DrawingBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698