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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy()); 1028 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy());
1029 } else { 1029 } else {
1030 DCHECK(proxy_->IsImplThread()); 1030 DCHECK(proxy_->IsImplThread());
1031 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy()); 1031 EnforceManagedMemoryPolicy(ActualManagedMemoryPolicy());
1032 } 1032 }
1033 1033
1034 if (needs_commit) 1034 if (needs_commit)
1035 client_->SetNeedsCommitOnImplThread(); 1035 client_->SetNeedsCommitOnImplThread();
1036 } 1036 }
1037 1037
1038 void LayerTreeHostImpl::SetDeviceTransformAndClip(gfx::Transform transform,
1039 gfx::Rect clip) {
1040 device_transform_ = transform;
1041 device_clip_ = clip;
1042 }
1043
1038 void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) { 1044 void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) {
1039 client_->SetNeedsRedrawRectOnImplThread(damage_rect); 1045 client_->SetNeedsRedrawRectOnImplThread(damage_rect);
1040 } 1046 }
1041 1047
1042 void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase, 1048 void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase,
1043 base::TimeDelta interval) { 1049 base::TimeDelta interval) {
1044 client_->OnVSyncParametersChanged(timebase, interval); 1050 client_->OnVSyncParametersChanged(timebase, interval);
1045 } 1051 }
1046 1052
1047 void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) { 1053 void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 1515
1510 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { 1516 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) {
1511 if (device_scale_factor == device_scale_factor_) 1517 if (device_scale_factor == device_scale_factor_)
1512 return; 1518 return;
1513 device_scale_factor_ = device_scale_factor; 1519 device_scale_factor_ = device_scale_factor;
1514 1520
1515 UpdateMaxScrollOffset(); 1521 UpdateMaxScrollOffset();
1516 SetFullRootLayerDamage(); 1522 SetFullRootLayerDamage();
1517 } 1523 }
1518 1524
1525 gfx::Rect LayerTreeHostImpl::DeviceClip() const {
1526 if (device_clip_.IsEmpty())
1527 return gfx::Rect(device_viewport_size_);
1528
1529 return device_clip_;
1530 }
1531
1532 gfx::Transform LayerTreeHostImpl::DeviceTransform() const {
1533 gfx::Transform device_transform = device_transform_;
1534 device_transform.Scale(device_scale_factor_, device_scale_factor_);
1535 return device_transform;
1536 }
1537
1538 gfx::Vector2d LayerTreeHostImpl::DeviceViewportOffset() const {
1539 return gfx::Vector2d(device_clip_.x(), device_clip_.y());
1540 }
1541
1519 void LayerTreeHostImpl::UpdateMaxScrollOffset() { 1542 void LayerTreeHostImpl::UpdateMaxScrollOffset() {
1520 active_tree_->UpdateMaxScrollOffset(); 1543 active_tree_->UpdateMaxScrollOffset();
1521 } 1544 }
1522 1545
1523 void LayerTreeHostImpl::DidChangeTopControlsPosition() { 1546 void LayerTreeHostImpl::DidChangeTopControlsPosition() {
1524 client_->SetNeedsRedrawOnImplThread(); 1547 client_->SetNeedsRedrawOnImplThread();
1525 active_tree_->set_needs_update_draw_properties(); 1548 active_tree_->set_needs_update_draw_properties();
1526 SetFullRootLayerDamage(); 1549 SetFullRootLayerDamage();
1527 } 1550 }
1528 1551
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 } 2259 }
2237 2260
2238 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2261 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2239 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2262 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2240 paint_time_counter_->ClearHistory(); 2263 paint_time_counter_->ClearHistory();
2241 2264
2242 debug_state_ = debug_state; 2265 debug_state_ = debug_state;
2243 } 2266 }
2244 2267
2245 } // namespace cc 2268 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698