diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/input/pinch_zoom_scrollbar.cc | 10 | ||||
-rw-r--r-- | cc/layers/delegated_renderer_layer_impl_unittest.cc | 8 | ||||
-rw-r--r-- | cc/layers/texture_layer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/layers/tiled_layer_unittest.cc | 26 | ||||
-rw-r--r-- | cc/test/layer_tree_test.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host.cc | 42 | ||||
-rw-r--r-- | cc/trees/layer_tree_host.h | 8 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 7 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.h | 5 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 105 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_perftest.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 42 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_damage.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_delegated.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl.h | 1 |
17 files changed, 126 insertions, 146 deletions
diff --git a/cc/input/pinch_zoom_scrollbar.cc b/cc/input/pinch_zoom_scrollbar.cc index e287810..1fb1019 100644 --- a/cc/input/pinch_zoom_scrollbar.cc +++ b/cc/input/pinch_zoom_scrollbar.cc @@ -7,6 +7,7 @@ #include "cc/input/pinch_zoom_scrollbar_geometry.h" #include "cc/layers/layer.h" #include "cc/trees/layer_tree_host.h" +#include "ui/gfx/size_conversions.h" namespace cc { @@ -39,14 +40,7 @@ WebKit::WebPoint PinchZoomScrollbar::location() const { } WebKit::WebSize PinchZoomScrollbar::size() const { - gfx::Size viewport_size = owner_->layout_viewport_size(); - gfx::Size size; - int track_width = PinchZoomScrollbarGeometry::kTrackWidth; - if (orientation_ == WebKit::WebScrollbar::Horizontal) - size = gfx::Size(viewport_size.width() - track_width, track_width); - else - size = gfx::Size(track_width, viewport_size.height() - track_width); - return WebKit::WebSize(size); + return owner_->PinchZoomScrollbarSize(orientation_); } bool PinchZoomScrollbar::enabled() const { diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc index a97d83c..222dc43 100644 --- a/cc/layers/delegated_renderer_layer_impl_unittest.cc +++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc @@ -43,7 +43,7 @@ class DelegatedRendererLayerImplTest : public testing::Test { &proxy_, &stats_instrumentation_); host_impl_->InitializeRenderer(CreateFakeOutputSurface()); - host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + host_impl_->SetViewportSize(gfx::Size(10, 10)); } protected: @@ -69,7 +69,7 @@ class DelegatedRendererLayerImplTestSimple scoped_ptr<FakeDelegatedRendererLayerImpl> delegated_renderer_layer = FakeDelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 4); - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); root_layer->SetBounds(gfx::Size(100, 100)); layer_before->SetPosition(gfx::Point(20, 20)); @@ -466,7 +466,7 @@ class DelegatedRendererLayerImplTestTransform scoped_ptr<FakeDelegatedRendererLayerImpl> delegated_renderer_layer = FakeDelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 2); - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); root_layer->SetBounds(gfx::Size(100, 100)); delegated_renderer_layer->SetPosition(gfx::Point(20, 20)); @@ -869,7 +869,7 @@ class DelegatedRendererLayerImplTestClip scoped_ptr<LayerImpl> origin_layer = LayerImpl::Create(host_impl_->active_tree(), 4); - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); root_layer->SetBounds(gfx::Size(100, 100)); delegated_renderer_layer->SetPosition(gfx::Point(20, 20)); diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc index a6d1e07..1d40bc3 100644 --- a/cc/layers/texture_layer_unittest.cc +++ b/cc/layers/texture_layer_unittest.cc @@ -301,7 +301,7 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { root_->AddChild(layer_); layer_tree_host()->SetRootLayer(root_); - layer_tree_host()->SetViewportSize(bounds, bounds); + layer_tree_host()->SetViewportSize(bounds); SetMailbox('1'); EXPECT_EQ(0, callback_count_); diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc index 0f64d3c..65df844 100644 --- a/cc/layers/tiled_layer_unittest.cc +++ b/cc/layers/tiled_layer_unittest.cc @@ -229,8 +229,7 @@ TEST_F(TiledLayerTest, PushOccludedDirtyTiles) { make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); TestOcclusionTracker occluded; occlusion_ = &occluded; - layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000), - gfx::Size(1000, 1000)); + layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000)); // The tile size is 100x100, so this invalidates and then paints two tiles. layer->SetBounds(gfx::Size(100, 200)); @@ -579,7 +578,6 @@ TEST_F(TiledLayerTest, PaintSmallAnimatedLayersImmediately) { int layer_height = 5 * FakeTiledLayer::tile_size().height(); int memory_for_layer = layer_width * layer_height * 4; layer_tree_host_->SetViewportSize( - gfx::Size(viewport_width, viewport_height), gfx::Size(viewport_width, viewport_height)); // Use 10x5 tiles to run out of memory. @@ -881,7 +879,7 @@ TEST_F(TiledLayerTest, SkipsDrawGetsReset) { child_layer->InvalidateContentRect(content_rect); layer_tree_host_->SetRootLayer(root_layer); - layer_tree_host_->SetViewportSize(gfx::Size(300, 300), gfx::Size(300, 300)); + layer_tree_host_->SetViewportSize(gfx::Size(300, 300)); layer_tree_host_->UpdateLayers(queue_.get(), memory_limit); @@ -951,7 +949,7 @@ TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { layer->InvalidateContentRect(content_rect); layer_tree_host_->SetRootLayer(layer); - layer_tree_host_->SetViewportSize(gfx::Size(300, 200), gfx::Size(300, 200)); + layer_tree_host_->SetViewportSize(gfx::Size(300, 200)); // Full update of all 6 tiles. layer_tree_host_->UpdateLayers(queue_.get(), @@ -1073,7 +1071,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) { // The tile size is 100x100. - layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); + layer_tree_host_->SetViewportSize(gfx::Size(600, 600)); layer->SetBounds(gfx::Size(600, 600)); CalcDrawProps(layer); @@ -1133,7 +1131,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) { // The tile size is 100x100. - layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); + layer_tree_host_->SetViewportSize(gfx::Size(600, 600)); layer->SetBounds(gfx::Size(600, 600)); CalcDrawProps(layer); @@ -1201,7 +1199,7 @@ TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) { // The tile size is 100x100. - layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); + layer_tree_host_->SetViewportSize(gfx::Size(600, 600)); layer->SetBounds(gfx::Size(600, 600)); CalcDrawProps(layer); @@ -1245,7 +1243,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndTransforms) { // This makes sure the painting works when the occluded region (in screen // space) is transformed differently than the layer. - layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); + layer_tree_host_->SetViewportSize(gfx::Size(600, 600)); layer->SetBounds(gfx::Size(600, 600)); CalcDrawProps(layer); gfx::Transform screen_transform; @@ -1281,7 +1279,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) { // This makes sure the painting works when the content space is scaled to // a different layer space. In this case tiles are scaled to be 200x200 // pixels, which means none should be occluded. - layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); + layer_tree_host_->SetViewportSize(gfx::Size(600, 600)); layer->SetBounds(gfx::Size(600, 600)); layer->SetRasterScale(0.5); CalcDrawProps(layer); @@ -1366,8 +1364,7 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { make_scoped_refptr(new FakeTiledLayer(resource_manager_.get())); TestOcclusionTracker occluded; occlusion_ = &occluded; - layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000), - gfx::Size(1000, 1000)); + layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000)); // The tile size is 100x100, so this invalidates and then paints two tiles in // various ways. @@ -1482,8 +1479,7 @@ TEST_F(TiledLayerTest, Pixels_paintedMetrics) { make_scoped_refptr(new FakeTiledLayer(resource_manager_.get())); TestOcclusionTracker occluded; occlusion_ = &occluded; - layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000), - gfx::Size(1000, 1000)); + layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000)); // The tile size is 100x100, so this invalidates and then paints two tiles in // various ways. @@ -1575,7 +1571,7 @@ TEST_F(TiledLayerTest, DontAllocateContentsWhenTargetSurfaceCantBeAllocated) { child2->draw_properties().drawable_content_rect = root_rect; layer_tree_host_->SetRootLayer(root); - layer_tree_host_->SetViewportSize(root_rect.size(), root_rect.size()); + layer_tree_host_->SetViewportSize(root_rect.size()); // With a huge memory limit, all layers should update and push their textures. root->InvalidateContentRect(root_rect); diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index f1bad56..61c9a04 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -421,7 +421,7 @@ void LayerTreeTest::SetupTree() { gfx::Size root_bounds = layer_tree_host_->root_layer()->bounds(); gfx::Size device_root_bounds = gfx::ToCeiledSize( gfx::ScaleSize(root_bounds, layer_tree_host_->device_scale_factor())); - layer_tree_host_->SetViewportSize(root_bounds, device_root_bounds); + layer_tree_host_->SetViewportSize(device_root_bounds); } void LayerTreeTest::Timeout() { diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 1dd29a9..cca8c67 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -37,6 +37,7 @@ #include "cc/trees/single_thread_proxy.h" #include "cc/trees/thread_proxy.h" #include "cc/trees/tree_synchronizer.h" +#include "ui/gfx/size_conversions.h" namespace { static int s_num_layer_tree_instances; @@ -342,7 +343,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { max_page_scale_factor_); sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); - host_impl->SetViewportSize(layout_viewport_size_, device_viewport_size_); + host_impl->SetViewportSize(device_viewport_size_); host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); host_impl->SetDeviceScaleFactor(device_scale_factor_); host_impl->SetDebugState(debug_state_); @@ -380,22 +381,34 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { commit_number_++; } +gfx::Size LayerTreeHost::PinchZoomScrollbarSize( + WebKit::WebScrollbar::Orientation orientation) const { + gfx::Size viewport_size = gfx::ToCeiledSize( + gfx::ScaleSize(device_viewport_size(), 1.f / device_scale_factor())); + gfx::Size size; + int track_width = PinchZoomScrollbarGeometry::kTrackWidth; + if (orientation == WebKit::WebScrollbar::Horizontal) + size = gfx::Size(viewport_size.width() - track_width, track_width); + else + size = gfx::Size(track_width, viewport_size.height() - track_width); + return size; +} + void LayerTreeHost::SetPinchZoomScrollbarsBoundsAndPosition() { if (!pinch_zoom_scrollbar_horizontal_ || !pinch_zoom_scrollbar_vertical_) return; - gfx::Size size = layout_viewport_size(); - int track_width = PinchZoomScrollbarGeometry::kTrackWidth; + gfx::Size horizontal_size = + PinchZoomScrollbarSize(WebKit::WebScrollbar::Horizontal); + gfx::Size vertical_size = + PinchZoomScrollbarSize(WebKit::WebScrollbar::Vertical); - pinch_zoom_scrollbar_horizontal_->SetBounds( - gfx::Size(size.width() - track_width, track_width)); + pinch_zoom_scrollbar_horizontal_->SetBounds(horizontal_size); pinch_zoom_scrollbar_horizontal_->SetPosition( - gfx::PointF(0, size.height() - track_width)); - - pinch_zoom_scrollbar_vertical_->SetBounds( - gfx::Size(track_width, size.height() - track_width)); + gfx::PointF(0, vertical_size.height())); + pinch_zoom_scrollbar_vertical_->SetBounds(vertical_size); pinch_zoom_scrollbar_vertical_->SetPosition( - gfx::PointF(size.width() - track_width, 0)); + gfx::PointF(horizontal_size.width(), 0)); } static scoped_refptr<ScrollbarLayer> CreatePinchZoomScrollbar( @@ -623,13 +636,10 @@ void LayerTreeHost::SetDebugState(const LayerTreeDebugState& debug_state) { SetNeedsCommit(); } -void LayerTreeHost::SetViewportSize(gfx::Size layout_viewport_size, - gfx::Size device_viewport_size) { - if (layout_viewport_size == layout_viewport_size_ && - device_viewport_size == device_viewport_size_) +void LayerTreeHost::SetViewportSize(gfx::Size device_viewport_size) { + if (device_viewport_size == device_viewport_size_) return; - layout_viewport_size_ = layout_viewport_size; device_viewport_size_ = device_viewport_size; SetPinchZoomScrollbarsBoundsAndPosition(); @@ -712,7 +722,7 @@ void LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue, if (!root_layer()) return; - if (layout_viewport_size().IsEmpty()) + if (device_viewport_size().IsEmpty()) return; if (memory_allocation_limit_bytes) { diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 270e8eb..bd2298c 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -27,6 +27,7 @@ #include "cc/trees/occlusion_tracker.h" #include "cc/trees/proxy.h" #include "skia/ext/refptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkPicture.h" #include "ui/gfx/rect.h" @@ -104,6 +105,8 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) { void Layout(); void BeginCommitOnImplThread(LayerTreeHostImpl* host_impl); void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); + gfx::Size PinchZoomScrollbarSize( + WebKit::WebScrollbar::Orientation orientation) const; void SetPinchZoomScrollbarsBoundsAndPosition(); void CreateAndAddPinchZoomScrollbars(); void WillCommit(); @@ -176,11 +179,9 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) { void SetDebugState(const LayerTreeDebugState& debug_state); const LayerTreeDebugState& debug_state() const { return debug_state_; } - void SetViewportSize(gfx::Size layout_viewport_size, - gfx::Size device_viewport_size); + void SetViewportSize(gfx::Size device_viewport_size); void SetOverdrawBottomHeight(float overdraw_bottom_height); - gfx::Size layout_viewport_size() const { return layout_viewport_size_; } gfx::Size device_viewport_size() const { return device_viewport_size_; } float overdraw_bottom_height() const { return overdraw_bottom_height_; } @@ -301,7 +302,6 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) { LayerTreeSettings settings_; LayerTreeDebugState debug_state_; - gfx::Size layout_viewport_size_; gfx::Size device_viewport_size_; float overdraw_bottom_height_; float device_scale_factor_; diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 4eeaf46..5eb97ec 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1365,16 +1365,13 @@ bool LayerTreeHostImpl::InitializeRenderer( return true; } -void LayerTreeHostImpl::SetViewportSize(gfx::Size layout_viewport_size, - gfx::Size device_viewport_size) { - if (layout_viewport_size == layout_viewport_size_ && - device_viewport_size == device_viewport_size_) +void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { + if (device_viewport_size == device_viewport_size_) return; if (pending_tree_ && device_viewport_size_ != device_viewport_size) active_tree_->SetViewportSizeInvalid(); - layout_viewport_size_ = layout_viewport_size; device_viewport_size_ = device_viewport_size; UpdateMaxScrollOffset(); diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 4ad081a..ffdfb5f 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -238,9 +238,7 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, return managed_memory_policy_.bytes_limit_when_visible; } - void SetViewportSize(gfx::Size layout_viewport_size, - gfx::Size device_viewport_size); - gfx::Size layout_viewport_size() const { return layout_viewport_size_; } + void SetViewportSize(gfx::Size device_viewport_size); gfx::Size device_viewport_size() const { return device_viewport_size_; } void SetOverdrawBottomHeight(float overdraw_bottom_height); @@ -430,7 +428,6 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, bool wheel_scrolling_; LayerTreeSettings settings_; LayerTreeDebugState debug_state_; - gfx::Size layout_viewport_size_; gfx::Size device_viewport_size_; float overdraw_bottom_height_; float device_scale_factor_; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 49c9b0b..301bf27 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -83,7 +83,7 @@ class LayerTreeHostImplTest : public testing::Test, &proxy_, &stats_instrumentation_); host_impl_->InitializeRenderer(CreateOutputSurface()); - host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + host_impl_->SetViewportSize(gfx::Size(10, 10)); } virtual void TearDown() OVERRIDE {} @@ -139,7 +139,7 @@ class LayerTreeHostImplTest : public testing::Test, &stats_instrumentation_); host_impl_->InitializeRenderer(output_surface.Pass()); - host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + host_impl_->SetViewportSize(gfx::Size(10, 10)); } void SetupRootLayerImpl(scoped_ptr<LayerImpl> root) { @@ -290,12 +290,12 @@ TEST_F(LayerTreeHostImplTest, NotifyIfCanDrawChanged) { on_can_draw_state_changed_called_ = false; // Toggle the device viewport size to make sure it toggles can_draw. - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size()); + host_impl_->SetViewportSize(gfx::Size()); EXPECT_FALSE(host_impl_->CanDraw()); EXPECT_TRUE(on_can_draw_state_changed_called_); on_can_draw_state_changed_called_ = false; - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); EXPECT_TRUE(host_impl_->CanDraw()); EXPECT_TRUE(on_can_draw_state_changed_called_); on_can_draw_state_changed_called_ = false; @@ -394,7 +394,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDeltaRepeatedScrolls) { TEST_F(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); EXPECT_EQ(InputHandlerClient::ScrollStarted, @@ -423,7 +423,7 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) { scoped_ptr<WebKit::WebGraphicsContext3D>( new TestWebGraphicsContext3DMakeCurrentFails)) .PassAs<OutputSurface>()); - host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + host_impl_->SetViewportSize(gfx::Size(10, 10)); SetupScrollAndContentsLayers(gfx::Size(100, 100)); @@ -437,7 +437,7 @@ TEST_F(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) { int scroll_layer_id = 1; SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); // We should not crash if the tree is replaced while we are scrolling. @@ -458,7 +458,7 @@ TEST_F(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) { TEST_F(LayerTreeHostImplTest, ClearRootRenderSurfaceAndScroll) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); // We should be able to scroll even if the root layer loses its render surface @@ -472,7 +472,7 @@ TEST_F(LayerTreeHostImplTest, ClearRootRenderSurfaceAndScroll) { TEST_F(LayerTreeHostImplTest, WheelEventHandlers) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); LayerImpl* root = host_impl_->active_tree()->root_layer(); @@ -490,7 +490,7 @@ TEST_F(LayerTreeHostImplTest, WheelEventHandlers) { TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); LayerImpl* root = host_impl_->active_tree()->root_layer(); @@ -504,7 +504,7 @@ TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) { TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) { SetupScrollAndContentsLayers(gfx::Size(200, 200)); - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); LayerImpl* root = host_impl_->active_tree()->root_layer(); root->SetContentsScale(2.f, 2.f); @@ -535,7 +535,7 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) { TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionWithOffset) { SetupScrollAndContentsLayers(gfx::Size(200, 200)); - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); LayerImpl* root = host_impl_->active_tree()->root_layer(); root->SetContentsScale(2.f, 2.f); @@ -560,7 +560,7 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionWithOffset) { TEST_F(LayerTreeHostImplTest, ScrollByReturnsCorrectValue) { SetupScrollAndContentsLayers(gfx::Size(200, 200)); - host_impl_->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + host_impl_->SetViewportSize(gfx::Size(100, 100)); InitializeRendererAndDrawFrame(); @@ -593,7 +593,7 @@ TEST_F(LayerTreeHostImplTest, ScrollByReturnsCorrectValue) { TEST_F(LayerTreeHostImplTest, ScrollVerticallyByPageReturnsCorrectValue) { SetupScrollAndContentsLayers(gfx::Size(200, 2000)); - host_impl_->SetViewportSize(gfx::Size(100, 1000), gfx::Size(100, 1000)); + host_impl_->SetViewportSize(gfx::Size(100, 1000)); InitializeRendererAndDrawFrame(); @@ -627,7 +627,7 @@ TEST_F(LayerTreeHostImplTest, ScrollVerticallyByPageReturnsCorrectValue) { TEST_F(LayerTreeHostImplTest, ClearRootRenderSurfaceAndHitTestTouchHandlerRegion) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); // We should be able to hit test for touch event handlers even if the root @@ -640,7 +640,7 @@ TEST_F(LayerTreeHostImplTest, TEST_F(LayerTreeHostImplTest, ImplPinchZoom) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); LayerImpl* scroll_layer = host_impl_->RootScrollLayer(); @@ -705,7 +705,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) { TEST_F(LayerTreeHostImplTest, PinchGesture) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); LayerImpl* scroll_layer = host_impl_->RootScrollLayer(); @@ -822,7 +822,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) { TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); LayerImpl* scroll_layer = host_impl_->RootScrollLayer(); @@ -887,7 +887,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { TEST_F(LayerTreeHostImplTest, PageScaleAnimationNoOp) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); InitializeRendererAndDrawFrame(); LayerImpl* scroll_layer = host_impl_->RootScrollLayer(); @@ -929,7 +929,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationNoOp) { TEST_F(LayerTreeHostImplTest, CompositorFrameMetadata) { SetupScrollAndContentsLayers(gfx::Size(100, 100)); - host_impl_->SetViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + host_impl_->SetViewportSize(gfx::Size(50, 50)); host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f); InitializeRendererAndDrawFrame(); { @@ -1085,7 +1085,7 @@ TEST_F(LayerTreeHostImplTest, DidDrawNotCalledOnHiddenLayer) { TEST_F(LayerTreeHostImplTest, WillDrawNotCalledOnOccludedLayer) { gfx::Size big_size(1000, 1000); - host_impl_->SetViewportSize(big_size, big_size); + host_impl_->SetViewportSize(big_size); host_impl_->active_tree()->SetRootLayer( DidDrawCheckLayer::Create(host_impl_->active_tree(), 1)); @@ -1297,7 +1297,7 @@ TEST_F(LayerTreeHostImplTest, ScrollNonScrollableRootWithTopControls) { &proxy_, &stats_instrumentation_); host_impl_->InitializeRenderer(CreateOutputSurface()); - host_impl_->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + host_impl_->SetViewportSize(gfx::Size(10, 10)); gfx::Size layer_size(5, 5); scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1); @@ -1353,7 +1353,7 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) { scroll_layer->AddChild(content_layer.Pass()); host_impl_->active_tree()->SetRootLayer(scroll_layer.Pass()); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); EXPECT_EQ(InputHandlerClient::ScrollStarted, @@ -1372,7 +1372,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildCallsCommitAndRedraw) { root->SetContentBounds(surface_size); root->AddChild(CreateScrollableLayer(2, surface_size)); host_impl_->active_tree()->SetRootLayer(root.Pass()); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); EXPECT_EQ(InputHandlerClient::ScrollStarted, @@ -1389,7 +1389,7 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesChild) { scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1); root->AddChild(CreateScrollableLayer(2, surface_size)); host_impl_->active_tree()->SetRootLayer(root.Pass()); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); // Scroll event is ignored because the input coordinate is outside the layer @@ -1405,7 +1405,7 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesBackfacingChild) { gfx::Size surface_size(10, 10); scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1); scoped_ptr<LayerImpl> child = CreateScrollableLayer(2, surface_size); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); gfx::Transform matrix; matrix.RotateAboutXAxis(180.0); @@ -1435,7 +1435,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlockedByContentLayer) { scroll_layer->AddChild(content_layer.Pass()); host_impl_->active_tree()->SetRootLayer(scroll_layer.Pass()); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); // Scrolling fails because the content layer is asking to be scrolled on the @@ -1451,7 +1451,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) { scoped_ptr<LayerImpl> root = CreateScrollableLayer(1, surface_size); host_impl_->active_tree()->SetRootLayer(root.Pass()); host_impl_->active_tree()->DidBecomeActive(); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); gfx::Vector2d scroll_delta(0, 10); @@ -1540,7 +1540,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) { scoped_ptr<LayerImpl> root = CreateScrollableLayer(1, surface_size); host_impl_->active_tree()->SetRootLayer(root.Pass()); host_impl_->active_tree()->DidBecomeActive(); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 1.f, page_scale); InitializeRendererAndDrawFrame(); @@ -1636,7 +1636,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildAndChangePageScaleOnMainThread) { root->AddChild(CreateScrollableLayer(scroll_layer_id, surface_size)); host_impl_->active_tree()->SetRootLayer(root.Pass()); host_impl_->active_tree()->DidBecomeActive(); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); LayerImpl* child = host_impl_->active_tree()->root_layer()->children()[0]; @@ -1686,7 +1686,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildBeyondLimit) { root->AddChild(child.Pass()); host_impl_->active_tree()->SetRootLayer(root.Pass()); host_impl_->active_tree()->DidBecomeActive(); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); { gfx::Vector2d scroll_delta(-8, -7); @@ -1725,7 +1725,7 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) { root->AddChild(child.Pass()); host_impl_->active_tree()->SetRootLayer(root.Pass()); host_impl_->active_tree()->DidBecomeActive(); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); { gfx::Vector2d scroll_delta(0, -10); @@ -1817,7 +1817,7 @@ TEST_F(LayerTreeHostImplTest, ScrollEventBubbling) { child->SetScrollable(false); root->AddChild(child.Pass()); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); host_impl_->active_tree()->SetRootLayer(root.Pass()); host_impl_->active_tree()->DidBecomeActive(); InitializeRendererAndDrawFrame(); @@ -1845,7 +1845,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) { host_impl_->active_tree()->SetRootLayer( CreateScrollableLayer(1, surface_size)); host_impl_->active_tree()->DidBecomeActive(); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); // Draw one frame and then immediately rebuild the layer tree to mimic a tree // synchronization. @@ -1870,7 +1870,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) { host_impl_->active_tree()->root_layer()->SetTransform(rotate_transform); gfx::Size surface_size(50, 50); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); // Scroll to the right in screen coordinates with a gesture. @@ -1923,7 +1923,7 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) { host_impl_->active_tree()->root_layer()->AddChild(child.Pass()); gfx::Size surface_size(50, 50); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); { // Scroll down in screen coordinates with a gesture. @@ -1991,7 +1991,7 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) { host_impl_->active_tree()->root_layer()->SetTransform(scale_transform); gfx::Size surface_size(50, 50); - host_impl_->SetViewportSize(surface_size, surface_size); + host_impl_->SetViewportSize(surface_size); InitializeRendererAndDrawFrame(); // Scroll down in screen coordinates with a gesture. @@ -2351,7 +2351,7 @@ TEST_F(LayerTreeHostImplTest, ViewportCovered) { host_impl_->active_tree()->set_background_color(SK_ColorGRAY); gfx::Size viewport_size(1000, 1000); - host_impl_->SetViewportSize(viewport_size, viewport_size); + host_impl_->SetViewportSize(viewport_size); host_impl_->active_tree()->SetRootLayer( LayerImpl::Create(host_impl_->active_tree(), 1)); @@ -2533,8 +2533,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) { &proxy_, &stats_instrumentation_); layer_tree_host_impl->InitializeRenderer(output_surface.Pass()); - layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500), - gfx::Size(500, 500)); + layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500)); scoped_ptr<LayerImpl> root = FakeDrawableLayerImpl::Create(layer_tree_host_impl->active_tree(), 1); @@ -2586,7 +2585,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) { // Make sure that partial swap is constrained to the viewport dimensions // expected damage rect: gfx::Rect(500, 500); // expected swap rect: flipped damage rect, but also clamped to viewport - layer_tree_host_impl->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + layer_tree_host_impl->SetViewportSize(gfx::Size(10, 10)); // This will damage everything. layer_tree_host_impl->active_tree()->root_layer()->SetOpacity(0.7f); EXPECT_TRUE(layer_tree_host_impl->PrepareToDraw(&frame, gfx::Rect())); @@ -2859,7 +2858,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity( scoped_ptr<LayerTreeHostImpl> my_host_impl = LayerTreeHostImpl::Create(settings, client, proxy, stats_instrumentation); my_host_impl->InitializeRenderer(output_surface.Pass()); - my_host_impl->SetViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); + my_host_impl->SetViewportSize(gfx::Size(100, 100)); /* Layers are created as follows: @@ -3130,7 +3129,7 @@ static void SetupLayersForTextureCaching( new PartialSwapContext)).PassAs<OutputSurface>(); layer_tree_host_impl->InitializeRenderer(output_surface.Pass()); - layer_tree_host_impl->SetViewportSize(root_size, root_size); + layer_tree_host_impl->SetViewportSize(root_size); scoped_ptr<LayerImpl> root = LayerImpl::Create(layer_tree_host_impl->active_tree(), 1); @@ -3211,7 +3210,7 @@ TEST_F(LayerTreeHostImplTest, TextureCachingWithOcclusion) { gfx::Size root_size(1000, 1000); my_host_impl->InitializeRenderer(output_surface.Pass()); - my_host_impl->SetViewportSize(root_size, root_size); + my_host_impl->SetViewportSize(root_size); scoped_ptr<LayerImpl> root = LayerImpl::Create(my_host_impl->active_tree(), 1); @@ -3330,7 +3329,7 @@ TEST_F(LayerTreeHostImplTest, TextureCachingWithOcclusionEarlyOut) { gfx::Size root_size(1000, 1000); my_host_impl->InitializeRenderer(output_surface.Pass()); - my_host_impl->SetViewportSize(root_size, root_size); + my_host_impl->SetViewportSize(root_size); scoped_ptr<LayerImpl> root = LayerImpl::Create(my_host_impl->active_tree(), 1); @@ -3451,7 +3450,7 @@ TEST_F(LayerTreeHostImplTest, TextureCachingWithOcclusionExternalOverInternal) { gfx::Size root_size(1000, 1000); my_host_impl->InitializeRenderer(output_surface.Pass()); - my_host_impl->SetViewportSize(root_size, root_size); + my_host_impl->SetViewportSize(root_size); scoped_ptr<LayerImpl> root = LayerImpl::Create(my_host_impl->active_tree(), 1); @@ -3541,7 +3540,7 @@ TEST_F(LayerTreeHostImplTest, TextureCachingWithOcclusionExternalNotAligned) { gfx::Size root_size(1000, 1000); my_host_impl->InitializeRenderer(output_surface.Pass()); - my_host_impl->SetViewportSize(root_size, root_size); + my_host_impl->SetViewportSize(root_size); scoped_ptr<LayerImpl> root = LayerImpl::Create(my_host_impl->active_tree(), 1); @@ -3632,7 +3631,7 @@ TEST_F(LayerTreeHostImplTest, TextureCachingWithOcclusionPartialSwap) { gfx::Size root_size(1000, 1000); my_host_impl->InitializeRenderer(output_surface.Pass()); - my_host_impl->SetViewportSize(root_size, root_size); + my_host_impl->SetViewportSize(root_size); scoped_ptr<LayerImpl> root = LayerImpl::Create(my_host_impl->active_tree(), 1); @@ -3794,7 +3793,7 @@ TEST_F(LayerTreeHostImplTest, TextureCachingWithScissor) { child->AddChild(grand_child.Pass()); root->AddChild(child.PassAs<LayerImpl>()); my_host_impl->active_tree()->SetRootLayer(root.Pass()); - my_host_impl->SetViewportSize(root_rect.size(), root_rect.size()); + my_host_impl->SetViewportSize(root_rect.size()); EXPECT_FALSE(my_host_impl->renderer()->HaveCachedResourcesForRenderPassId( child_pass_id)); @@ -4821,7 +4820,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) { // Check that the tree scaling is correctly taken into account for the mask, // that should fully map onto the quad. float device_scale_factor = 1.f; - host_impl_->SetViewportSize(root_size, root_size); + host_impl_->SetViewportSize(root_size); host_impl_->SetDeviceScaleFactor(device_scale_factor); { LayerTreeHostImpl::FrameData frame; @@ -4848,7 +4847,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) { device_scale_factor = 2.f; gfx::Size device_viewport = gfx::ToFlooredSize(gfx::ScaleSize(root_size, device_scale_factor)); - host_impl_->SetViewportSize(root_size, device_viewport); + host_impl_->SetViewportSize(device_viewport); host_impl_->SetDeviceScaleFactor(device_scale_factor); host_impl_->active_tree()->set_needs_update_draw_properties(); { @@ -4943,7 +4942,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithDifferentBounds) { // Check that the mask fills the surface. float device_scale_factor = 1.f; - host_impl_->SetViewportSize(root_size, root_size); + host_impl_->SetViewportSize(root_size); host_impl_->SetDeviceScaleFactor(device_scale_factor); { LayerTreeHostImpl::FrameData frame; @@ -4970,7 +4969,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithDifferentBounds) { device_scale_factor = 2.f; gfx::Size device_viewport = gfx::ToFlooredSize(gfx::ScaleSize(root_size, device_scale_factor)); - host_impl_->SetViewportSize(root_size, device_viewport); + host_impl_->SetViewportSize(device_viewport); host_impl_->SetDeviceScaleFactor(device_scale_factor); host_impl_->active_tree()->set_needs_update_draw_properties(); { diff --git a/cc/trees/layer_tree_host_perftest.cc b/cc/trees/layer_tree_host_perftest.cc index ff4b8ca..a3ee7a6 100644 --- a/cc/trees/layer_tree_host_perftest.cc +++ b/cc/trees/layer_tree_host_perftest.cc @@ -89,7 +89,7 @@ class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest { virtual void BuildTree() OVERRIDE { gfx::Size viewport = gfx::Size(720, 1038); - layer_tree_host()->SetViewportSize(viewport, viewport); + layer_tree_host()->SetViewportSize(viewport); scoped_refptr<Layer> root = ParseTreeFromJson(json_, &fake_content_layer_client_); ASSERT_TRUE(root.get()); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index f53a618..96c6b11 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -303,13 +303,13 @@ class LayerTreeHostTestCanDrawBlocksDrawing : public LayerTreeHostTest { num_commits_++; if (num_commits_ == 1) { // Make the viewport empty so the host says it can't draw. - layer_tree_host()->SetViewportSize(gfx::Size(0, 0), gfx::Size(0, 0)); + layer_tree_host()->SetViewportSize(gfx::Size(0, 0)); } else if (num_commits_ == 2) { char pixels[4]; layer_tree_host()->CompositeAndReadback(&pixels, gfx::Rect(0, 0, 1, 1)); } else if (num_commits_ == 3) { // Let it draw so we go idle and end the test. - layer_tree_host()->SetViewportSize(gfx::Size(1, 1), gfx::Size(1, 1)); + layer_tree_host()->SetViewportSize(gfx::Size(1, 1)); done_ = true; EndTest(); } @@ -449,7 +449,7 @@ class LayerTreeHostTestCommit : public LayerTreeHostTest { LayerTreeHostTestCommit() {} virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(20, 20), gfx::Size(20, 20)); + layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); layer_tree_host()->set_background_color(SK_ColorGRAY); layer_tree_host()->SetPageScaleFactorAndLimits(5.f, 5.f, 5.f); @@ -457,7 +457,7 @@ class LayerTreeHostTestCommit : public LayerTreeHostTest { } virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { - EXPECT_EQ(gfx::Size(20, 20), impl->layout_viewport_size()); + EXPECT_EQ(gfx::Size(20, 20), impl->device_viewport_size()); EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); EXPECT_EQ(5.f, impl->active_tree()->page_scale_factor()); @@ -594,7 +594,7 @@ class LayerTreeHostTestOpacityChange : public LayerTreeHostTest { } virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); layer_tree_host()->root_layer()->AddChild(update_check_layer_); PostSetNeedsCommitToMainThread(); @@ -649,9 +649,8 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers child_layer_(ContentLayer::Create(&client_)) {} virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(40, 40), gfx::Size(60, 60)); + layer_tree_host()->SetViewportSize(gfx::Size(60, 60)); layer_tree_host()->SetDeviceScaleFactor(1.5); - EXPECT_EQ(gfx::Size(40, 40), layer_tree_host()->layout_viewport_size()); EXPECT_EQ(gfx::Size(60, 60), layer_tree_host()->device_viewport_size()); root_layer_->AddChild(child_layer_); @@ -683,7 +682,6 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers ASSERT_EQ(1u, impl->active_tree()->root_layer()->children().size()); // Device viewport is scaled. - EXPECT_EQ(gfx::Size(40, 40), impl->layout_viewport_size()); EXPECT_EQ(gfx::Size(60, 60), impl->device_viewport_size()); LayerImpl* root = impl->active_tree()->root_layer(); @@ -1031,12 +1029,10 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate child_->SetNeedsDisplay(); scrollbar_with_paints_->SetNeedsDisplay(); scrollbar_without_paints_->SetNeedsDisplay(); - layer_tree_host()->SetViewportSize(gfx::Size(10, 10), - gfx::Size(10, 10)); + layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); break; case 4: - layer_tree_host()->SetViewportSize(gfx::Size(10, 20), - gfx::Size(10, 20)); + layer_tree_host()->SetViewportSize(gfx::Size(10, 20)); break; case 5: break; @@ -1140,8 +1136,7 @@ class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit } virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(100, 100), - gfx::Size(100, 100)); + layer_tree_host()->SetViewportSize(gfx::Size(100, 100)); root_layer_->SetBounds(gfx::Size(100, 100)); surface_layer1_->SetBounds(gfx::Size(100, 100)); @@ -1319,7 +1314,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { virtual void BeginTest() OVERRIDE { layer_tree_host()->SetRootLayer(layer_); - layer_tree_host()->SetViewportSize(gfx::Size(10, 20), gfx::Size(10, 20)); + layer_tree_host()->SetViewportSize(gfx::Size(10, 20)); gfx::Transform identity_matrix; SetLayerPropertiesForTesting(layer_.get(), @@ -1446,7 +1441,7 @@ class LayerTreeHostTestContinuousCommit : public LayerTreeHostTest { : num_commit_complete_(0), num_draw_layers_(0) {} virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10)); PostSetNeedsCommitToMainThread(); @@ -1487,7 +1482,7 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest { : num_commit_complete_(0), num_draw_layers_(0) {} virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); + layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10)); content_layer_ = ContentLayer::Create(&client_); @@ -1720,7 +1715,7 @@ class LayerTreeHostTestCapturePicture : public LayerTreeHostTest { layer_->SetBounds(bounds_); // Outside viewport so tiles don't have to be initialized for commit. layer_->SetPosition(gfx::Point(100, 100)); - layer_tree_host()->SetViewportSize(bounds_, bounds_); + layer_tree_host()->SetViewportSize(bounds_); layer_tree_host()->SetRootLayer(layer_); EXPECT_TRUE(layer_tree_host()->InitializeRendererIfNeeded()); @@ -1810,8 +1805,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted num_commits_(0) {} virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(100, 100), - gfx::Size(100, 100)); + layer_tree_host()->SetViewportSize(gfx::Size(100, 100)); root_layer_->SetBounds(gfx::Size(100, 100)); child_layer1_->SetBounds(gfx::Size(100, 100)); child_layer2_->SetBounds(gfx::Size(100, 100)); @@ -1941,8 +1935,7 @@ class LayerTreeHostTestPinchZoomScrollbarResize : public LayerTreeHostTest { root_layer_->SetIsDrawable(true); root_layer_->SetBounds(gfx::Size(100, 100)); layer_tree_host()->SetRootLayer(root_layer_); - layer_tree_host()->SetViewportSize(gfx::Size(100, 100), - gfx::Size(100, 100)); + layer_tree_host()->SetViewportSize(gfx::Size(100, 100)); PostSetNeedsCommitToMainThread(); } @@ -1960,15 +1953,14 @@ class LayerTreeHostTestPinchZoomScrollbarResize : public LayerTreeHostTest { if (!layer1->Orientation() == WebKit::WebScrollbar::Horizontal) std::swap(layer1, layer2); - gfx::Size viewport_size = layer_tree_host()->layout_viewport_size(); + gfx::Size viewport_size = layer_tree_host()->device_viewport_size(); EXPECT_EQ(viewport_size.width() - thickness, layer1->bounds().width()); EXPECT_EQ(viewport_size.height() - thickness, layer2->bounds().height()); switch (num_commits_) { case 1: // Resizing the viewport should also resize the pinch-zoom scrollbars. - layer_tree_host()->SetViewportSize(gfx::Size(120, 150), - gfx::Size(120, 150)); + layer_tree_host()->SetViewportSize(gfx::Size(120, 150)); break; default: EndTest(); diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 0197051..4234621 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -600,7 +600,7 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw } virtual void BeginTest() OVERRIDE { - layer_tree_host()->SetViewportSize(gfx::Size(), gfx::Size()); + layer_tree_host()->SetViewportSize(gfx::Size()); PostAddAnimationToMainThread(content_); } diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc index a66b798a..beed63c 100644 --- a/cc/trees/layer_tree_host_unittest_damage.cc +++ b/cc/trees/layer_tree_host_unittest_damage.cc @@ -82,7 +82,7 @@ class LayerTreeHostDamageTestNoDamageDoesNotSwap case 2: // Cause visible damage. content_->SetNeedsDisplayRect( - gfx::Rect(layer_tree_host()->layout_viewport_size())); + gfx::Rect(layer_tree_host()->device_viewport_size())); break; case 3: // Cause non-visible damage. diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc index a44509c..f16b2ef 100644 --- a/cc/trees/layer_tree_host_unittest_delegated.cc +++ b/cc/trees/layer_tree_host_unittest_delegated.cc @@ -1033,7 +1033,7 @@ class LayerTreeHostDelegatedTestResourceSentToParent public: virtual void BeginTest() OVERRIDE { // Prevent drawing with resources that are sent to the grandparent. - layer_tree_host()->SetViewportSize(gfx::Size(10, 10), gfx::Size()); + layer_tree_host()->SetViewportSize(gfx::Size()); PostSetNeedsCommitToMainThread(); } @@ -1148,7 +1148,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake public: virtual void BeginTest() OVERRIDE { // Prevent drawing with resources that are sent to the grandparent. - layer_tree_host()->SetViewportSize(gfx::Size(10, 10), gfx::Size()); + layer_tree_host()->SetViewportSize(gfx::Size()); PostSetNeedsCommitToMainThread(); } diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 95308cb..e4ec3c9 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -523,10 +523,6 @@ gfx::Size LayerTreeImpl::device_viewport_size() const { return layer_tree_host_impl_->device_viewport_size(); } -gfx::Size LayerTreeImpl::layout_viewport_size() const { - return layer_tree_host_impl_->layout_viewport_size(); -} - std::string LayerTreeImpl::layer_tree_as_text() const { return layer_tree_host_impl_->LayerTreeAsText(); } diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 34fbe99..41b6f65 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h @@ -78,7 +78,6 @@ class CC_EXPORT LayerTreeImpl { const LayerTreeDebugState& debug_state() const; float device_scale_factor() const; gfx::Size device_viewport_size() const; - gfx::Size layout_viewport_size() const; std::string layer_tree_as_text() const; DebugRectHistory* debug_rect_history() const; scoped_ptr<base::Value> AsValue() const; |