Commit 87ff6dd9 authored by xinghua.cao's avatar xinghua.cao Committed by Commit bot

Avoid to resolve CMAA for read and draw without content changed or with content committed.

CMAA will be triggered by every readPixels call, even content does not be  changed or committed.

BUG=535198

TEST=conformance/readinging/fbo-remains-unchanged-after-read-pixels.html

Review-Url: https://codereview.chromium.org/2597933002
Cr-Commit-Position: refs/heads/master@{#467915}
parent 840f5cbd
...@@ -992,7 +992,7 @@ void DrawingBuffer::ResolveAndBindForReadAndDraw() { ...@@ -992,7 +992,7 @@ void DrawingBuffer::ResolveAndBindForReadAndDraw() {
void DrawingBuffer::ResolveMultisampleFramebufferInternal() { void DrawingBuffer::ResolveMultisampleFramebufferInternal() {
DCHECK(state_restorer_); DCHECK(state_restorer_);
state_restorer_->SetFramebufferBindingDirty(); state_restorer_->SetFramebufferBindingDirty();
if (WantExplicitResolve() && !contents_change_resolved_) { if (WantExplicitResolve()) {
state_restorer_->SetClearStateDirty(); state_restorer_->SetClearStateDirty();
gl_->BindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, multisample_fbo_); gl_->BindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, multisample_fbo_);
gl_->BindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, fbo_); gl_->BindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, fbo_);
...@@ -1025,7 +1025,7 @@ void DrawingBuffer::ResolveMultisampleFramebufferInternal() { ...@@ -1025,7 +1025,7 @@ void DrawingBuffer::ResolveMultisampleFramebufferInternal() {
} }
void DrawingBuffer::ResolveIfNeeded() { void DrawingBuffer::ResolveIfNeeded() {
if (anti_aliasing_mode_ != kNone) if (anti_aliasing_mode_ != kNone && !contents_change_resolved_)
ResolveMultisampleFramebufferInternal(); ResolveMultisampleFramebufferInternal();
contents_change_resolved_ = true; contents_change_resolved_ = true;
} }
......
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