Commit af7a33d9 authored by Fritz Koenig's avatar Fritz Koenig Committed by Commit Bot

webgl: Resolve MSAA buffer for low latency

When using low latency MSAA resolve was gated by
swap chains.  ChromeOS does not use swap
chains.  Move the resolve to before checking
for swap chains.

Test: https://codepen.io/miguelao/pen/WKZaqd

Bug: 1025747
Change-Id: I344c8576c16277348950836a3fc28a58f787a256
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003073
Auto-Submit: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732882}
parent 6b6260a7
......@@ -662,7 +662,7 @@ DrawingBuffer::ScopedRGBEmulationForBlitFramebuffer::
scoped_refptr<CanvasResource> DrawingBuffer::AsCanvasResource(
base::WeakPtr<CanvasResourceProvider> resource_provider) {
// Swap chain must be presented before resource is exported.
PresentSwapChainIfNeeded();
ResolveAndPresentSwapChainIfNeeded();
scoped_refptr<ColorBuffer> canvas_resource_buffer =
UsingSwapChain() ? front_color_buffer_ : back_color_buffer_;
......@@ -1497,15 +1497,18 @@ void DrawingBuffer::FlipVertically(uint8_t* framebuffer,
}
}
void DrawingBuffer::PresentSwapChainIfNeeded() {
if (!UsingSwapChain() || !contents_changed_)
void DrawingBuffer::ResolveAndPresentSwapChainIfNeeded() {
if (!contents_changed_)
return;
DCHECK_EQ(texture_target_, static_cast<unsigned>(GL_TEXTURE_2D));
ScopedStateRestorer scoped_state_restorer(this);
ResolveIfNeeded();
if (!UsingSwapChain())
return;
DCHECK_EQ(texture_target_, static_cast<unsigned>(GL_TEXTURE_2D));
if (premultiplied_alpha_false_texture_) {
// The rendering results are in |premultiplied_alpha_false_texture_| rather
// than the |back_color_buffer_|'s texture. Copy them in, multiplying the
......
......@@ -500,7 +500,7 @@ class PLATFORM_EXPORT DrawingBuffer : public cc::TextureLayerClient,
bool ReallocateMultisampleRenderbuffer(const IntSize&);
// Presents swap chain if swap chain is being used and contents have changed.
void PresentSwapChainIfNeeded();
void ResolveAndPresentSwapChainIfNeeded();
// Weak, reset by beginDestruction.
Client* client_ = nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment