Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1007)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 15579002: Implement transform/clip support for Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GL support and clean up Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f58f3c2d7add8598fe445712494c94050ceaebcd..c1221d0d6fa32bed43981e4420d4d65e131d2649 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1035,6 +1035,12 @@ void LayerTreeHostImpl::SetManagedMemoryPolicy(
client_->SetNeedsCommitOnImplThread();
}
+void LayerTreeHostImpl::SetDeviceTransformAndClip(gfx::Transform transform,
+ gfx::Rect clip) {
+ device_transform_ = transform;
+ device_clip_ = clip;
+}
+
void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) {
client_->SetNeedsRedrawRectOnImplThread(damage_rect);
}
@@ -1516,6 +1522,23 @@ void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) {
SetFullRootLayerDamage();
}
+gfx::Rect LayerTreeHostImpl::DeviceClip() const {
+ if (device_clip_.IsEmpty())
+ return gfx::Rect(device_viewport_size_);
+
+ return device_clip_;
+}
+
+gfx::Transform LayerTreeHostImpl::DeviceTransform() const {
+ gfx::Transform device_transform = device_transform_;
+ device_transform.Scale(device_scale_factor_, device_scale_factor_);
+ return device_transform;
+}
+
+gfx::Vector2d LayerTreeHostImpl::DeviceViewportOffset() const {
+ return gfx::Vector2d(device_clip_.x(), device_clip_.y());
+}
+
void LayerTreeHostImpl::UpdateMaxScrollOffset() {
active_tree_->UpdateMaxScrollOffset();
}

Powered by Google App Engine
This is Rietveld 408576698