Commit f9b3f619 authored by Saman Sami's avatar Saman Sami Committed by Commit Bot

content: Ack resize after commit

After resize once commit happens eventually a CompositorFrame will be
submitted with the right size, so just ack the resize after commit
instead of draw.

Change-Id: I9ab712dc325ad77cd704123d93d94ba74eaf63d2
Reviewed-on: https://chromium-review.googlesource.com/984598Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Saman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546716}
parent d8867a7b
...@@ -1065,11 +1065,6 @@ void RenderWidget::DidCommitAndDrawCompositorFrame() { ...@@ -1065,11 +1065,6 @@ void RenderWidget::DidCommitAndDrawCompositorFrame() {
// tab_capture_performancetest.cc. // tab_capture_performancetest.cc.
TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame");
// If we haven't commited yet, then this method was called as a response to a
// previous commit and should not be used to ack the resize.
if (did_commit_after_resize_)
DidResizeOrRepaintAck();
for (auto& observer : render_frames_) for (auto& observer : render_frames_)
observer.DidCommitAndDrawCompositorFrame(); observer.DidCommitAndDrawCompositorFrame();
...@@ -1078,7 +1073,7 @@ void RenderWidget::DidCommitAndDrawCompositorFrame() { ...@@ -1078,7 +1073,7 @@ void RenderWidget::DidCommitAndDrawCompositorFrame() {
} }
void RenderWidget::DidCommitCompositorFrame() { void RenderWidget::DidCommitCompositorFrame() {
did_commit_after_resize_ = true; DidResizeOrRepaintAck();
} }
void RenderWidget::DidCompletePageScaleAnimation() {} void RenderWidget::DidCompletePageScaleAnimation() {}
...@@ -1368,12 +1363,6 @@ void RenderWidget::Resize(const ResizeParams& params) { ...@@ -1368,12 +1363,6 @@ void RenderWidget::Resize(const ResizeParams& params) {
// |current_content_source_id_|. // |current_content_source_id_|.
DCHECK_GE(1u << 30, current_content_source_id_ - params.content_source_id); DCHECK_GE(1u << 30, current_content_source_id_ - params.content_source_id);
// If this resize needs to be acked, make sure we ack it only after we commit.
// It is possible to get DidCommitAndDraw calls that belong to the previous
// commit, in which case we should not ack this resize.
if (params.needs_resize_ack)
did_commit_after_resize_ = false;
// Inform the rendering thread of the color space indicate the presence of HDR // Inform the rendering thread of the color space indicate the presence of HDR
// capabilities. // capabilities.
RenderThreadImpl* render_thread = RenderThreadImpl::current(); RenderThreadImpl* render_thread = RenderThreadImpl::current();
......
...@@ -980,11 +980,6 @@ class CONTENT_EXPORT RenderWidget ...@@ -980,11 +980,6 @@ class CONTENT_EXPORT RenderWidget
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
// Keep track of whether we committed after the latest resize that needs to be
// acked was received. This helps us make sure we don't ack a resize before
// it's committed.
bool did_commit_after_resize_ = false;
gfx::Rect viewport_intersection_; gfx::Rect viewport_intersection_;
gfx::Rect compositor_visible_rect_; gfx::Rect compositor_visible_rect_;
......
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