Commit 6f970dc9 authored by W. James MacLean's avatar W. James MacLean Committed by Commit Bot

Don't pass viewport origin in OnDraw in Android.

This modifies the viewport rect passed to OnDraw() to exclude the origin
if it's non-zero, since otherwise this adversely affects the compositor
clip rect. The non-zero value of the origin is captured in the adjusted
transform.

Bug: 1007012
Change-Id: I614b8ea3f14219d3dba54ad0a552b3e34145500e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827639Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700396}
parent 3a459d4d
...@@ -483,14 +483,13 @@ void SynchronousLayerTreeFrameSink::InvokeComposite( ...@@ -483,14 +483,13 @@ void SynchronousLayerTreeFrameSink::InvokeComposite(
did_submit_frame_ = false; did_submit_frame_ = false;
// Adjust transform so that the layer compositor draws the |viewport| rect // Adjust transform so that the layer compositor draws the |viewport| rect
// at its origin. The offset of the |viewport| we pass to the layer compositor // at its origin. The offset of the |viewport| we pass to the layer compositor
// is ignored for drawing, so its okay to not match the transform. // must also be zero, since the rect needs to be in the coordinates of the
// TODO(danakj): Why do we pass a viewport origin and then not really use it // layer compositor.
// (only for comparing to the viewport passed in
// SetExternalTilePriorityConstraints), surely this could be more clear?
gfx::Transform adjusted_transform = transform; gfx::Transform adjusted_transform = transform;
adjusted_transform.matrix().postTranslate(-viewport.x(), -viewport.y(), 0); adjusted_transform.matrix().postTranslate(-viewport.x(), -viewport.y(), 0);
client_->OnDraw(adjusted_transform, viewport, in_software_draw_, // Don't propagate the viewport origin, as it will affect the clip rect.
false /*skip_draw*/); client_->OnDraw(adjusted_transform, gfx::Rect(viewport.size()),
in_software_draw_, false /*skip_draw*/);
if (did_submit_frame_) { if (did_submit_frame_) {
// This must happen after unwinding the stack and leaving the compositor. // This must happen after unwinding the stack and leaving the compositor.
......
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