Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index 94b8bfa1cfac7e9daaa5cef94a4e41954d7a8880..1b66665b57245c8a2719cdf30c98e2a7f6e79834 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -1345,16 +1345,27 @@ void LayerTreeHostImpl::SetExternalDrawConstraints( |
| const gfx::Transform& transform, |
| const gfx::Rect& viewport, |
| const gfx::Rect& clip, |
| + const gfx::Rect& device_rect_for_tiling, |
| bool resourceless_software_draw) { |
| if (external_transform_ != transform || external_viewport_ != viewport || |
| resourceless_software_draw_ != resourceless_software_draw) { |
| active_tree_->set_needs_update_draw_properties(); |
| } |
| - external_transform_ = transform; |
| external_viewport_ = viewport; |
| external_clip_ = clip; |
| resourceless_software_draw_ = resourceless_software_draw; |
| + |
| + // |external_transform_| for Android WebView child compositor hardware draw |
| + // is an identity matrix. For software draw, |external_transform_| is what's |
| + // passed in. |
| + if (!resourceless_software_draw_) { |
|
boliu
2014/07/16 17:25:10
Yeah I tend to agree with alex that repurposing is
hush (inactive)
2014/07/16 20:45:33
Done.
|
| + external_transform_ = gfx::Transform(); |
| + external_viewport_rect_for_tiling_ = device_rect_for_tiling; |
| + external_transform_for_tiling_ = transform; |
| + } else { |
| + external_transform_ = transform; |
| + } |
| } |
| void LayerTreeHostImpl::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { |
| @@ -2166,6 +2177,18 @@ gfx::Size LayerTreeHostImpl::DrawViewportSize() const { |
| return DeviceViewport().size(); |
| } |
| +gfx::Rect LayerTreeHostImpl::TilingViewportRect() const { |
| + gfx::Rect empty; |
| + if (empty == external_viewport_rect_for_tiling_) |
| + return gfx::Rect(DrawViewportSize()); |
| + |
| + return external_viewport_rect_for_tiling_; |
| +} |
| + |
| +const gfx::Transform& LayerTreeHostImpl::TilingTransform() const { |
| + return external_transform_for_tiling_; |
| +} |
| + |
| gfx::Rect LayerTreeHostImpl::DeviceViewport() const { |
| if (external_viewport_.IsEmpty()) |
| return gfx::Rect(device_viewport_size_); |