diff options
author | bokan <bokan@chromium.org> | 2014-10-08 08:15:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-08 15:15:44 +0000 |
commit | cccfde7dac913451d92e9cd44e3d77a7f913be43 (patch) | |
tree | d83e9cf51df8ba8cce53716591ac7ceafbe8dea8 /cc | |
parent | 6efe7f2e63509864dc9378a7af86721aecd8e15e (diff) | |
download | chromium_src-cccfde7dac913451d92e9cd44e3d77a7f913be43.zip chromium_src-cccfde7dac913451d92e9cd44e3d77a7f913be43.tar.gz chromium_src-cccfde7dac913451d92e9cd44e3d77a7f913be43.tar.bz2 |
Revert of "Converted LayerImpl::bounds() to return SizeF."
Seems this was more contentious than originally anticipated. Reverting
this until we have consensus on how to go forward.
TBR=aelias@chromium.org,enne@chromium.org,danakj@chromium.org
BUG=
Review URL: https://codereview.chromium.org/637913003
Cr-Commit-Position: refs/heads/master@{#298710}
Diffstat (limited to 'cc')
26 files changed, 116 insertions, 208 deletions
diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc index 71611a6..e8792e7 100644 --- a/cc/debug/debug_rect_history.cc +++ b/cc/debug/debug_rect_history.cc @@ -78,9 +78,9 @@ void DebugRectHistory::SavePaintRects(LayerImpl* layer) { if (!layer->update_rect().IsEmpty() && layer->DrawsContent()) { float width_scale = layer->content_bounds().width() / - layer->bounds().width(); + static_cast<float>(layer->bounds().width()); float height_scale = layer->content_bounds().height() / - layer->bounds().height(); + static_cast<float>(layer->bounds().height()); gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect( gfx::ToEnclosingRect(layer->update_rect()), width_scale, height_scale); debug_rects_.push_back( diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc index 7cd4430..86d493a 100644 --- a/cc/layers/delegated_renderer_layer_impl.cc +++ b/cc/layers/delegated_renderer_layer_impl.cc @@ -149,7 +149,7 @@ void DelegatedRendererLayerImpl::SetFrameData( gfx::RectF damage_in_layer = damage_in_frame; damage_in_layer.Scale(inverse_device_scale_factor_); SetUpdateRect(gfx::IntersectRects( - gfx::UnionRects(update_rect(), damage_in_layer), gfx::RectF(bounds()))); + gfx::UnionRects(update_rect(), damage_in_layer), gfx::Rect(bounds()))); SetRenderPasses(&render_pass_list); have_render_passes_to_push_ = true; diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index ecf1dc6..85bb2f1 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc @@ -360,7 +360,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawFPSDisplay( int width = kGraphWidth + kHistogramWidth + 4 * kPadding; int height = kFontHeight + kGraphHeight + 4 * kPadding + 2; - int left = ceil(bounds().width()) - width - right; + int left = bounds().width() - width - right; SkRect area = SkRect::MakeXYWH(left, top, width, height); SkPaint paint = CreatePaint(); @@ -492,7 +492,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas, const int kFontHeight = 13; const int height = 3 * kFontHeight + 4 * kPadding; - const int left = ceil(bounds().width()) - width - right; + const int left = bounds().width() - width - right; const SkRect area = SkRect::MakeXYWH(left, top, width, height); const double megabyte = 1024.0 * 1024.0; @@ -547,7 +547,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawPaintTimeDisplay( const int width = kGraphWidth + 2 * kPadding; const int height = kFontHeight + kGraphHeight + 4 * kPadding + 2 + kFontHeight + kPadding; - const int left = ceil(bounds().width()) - width - right; + const int left = bounds().width() - width - right; const SkRect area = SkRect::MakeXYWH(left, top, width, height); diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 302bda4..6dfec0e 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -622,7 +622,7 @@ gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const { // (w/s',h/s') - (w/s,h/s) = (w,h)(1/s' - 1/s) = (w,h)(1 - ds)/(s ds) // gfx::Vector2dF delta_from_pinch = - gfx::RectF(scroll_clip_layer_->bounds()).bottom_right() - gfx::PointF(); + gfx::Rect(scroll_clip_layer_->bounds()).bottom_right() - gfx::PointF(); delta_from_pinch.Scale((1.f - scale_delta) / (scale * scale_delta)); return delta_from_scroll + delta_from_pinch; @@ -633,8 +633,8 @@ base::DictionaryValue* LayerImpl::LayerTreeAsJson() const { result->SetString("LayerType", LayerTypeAsString()); base::ListValue* list = new base::ListValue; - list->AppendDouble(bounds().width()); - list->AppendDouble(bounds().height()); + list->AppendInteger(bounds().width()); + list->AppendInteger(bounds().height()); result->Set("Bounds", list); list = new base::ListValue; @@ -771,7 +771,8 @@ bool LayerImpl::IsActive() const { return layer_tree_impl_->IsActiveTree(); } -gfx::SizeF LayerImpl::bounds() const { +// TODO(aelias): Convert so that bounds returns SizeF. +gfx::Size LayerImpl::bounds() const { return gfx::ToCeiledSize(gfx::SizeF(bounds_.width() + bounds_delta_.x(), bounds_.height() + bounds_delta_.y())); } diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 54dda06..1e8fa63 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -364,7 +364,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, // them from the other values. void SetBounds(const gfx::Size& bounds); - gfx::SizeF bounds() const; + gfx::Size bounds() const; void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); gfx::Vector2dF bounds_delta() const { return bounds_delta_; } @@ -515,6 +515,9 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, void RemoveScrollbar(ScrollbarLayerImplBase* layer); bool HasScrollbar(ScrollbarOrientation orientation) const; void ScrollbarParametersDidChange(bool on_resize); + int clip_height() { + return scroll_clip_layer_ ? scroll_clip_layer_->bounds().height() : 0; + } gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc index d9cfd92..1d8289f 100644 --- a/cc/layers/layer_impl_unittest.cc +++ b/cc/layers/layer_impl_unittest.cc @@ -682,7 +682,7 @@ TEST_F(LayerImplScrollTest, SetNewScrollbarParameters) { vertical_scrollbar->SetScrollLayerAndClipLayerByIds( layer()->id(), tree()->root_layer()->id()); - float expected_vertical_maximum = + int expected_vertical_maximum = layer()->bounds().height() - tree()->root_layer()->bounds().height(); EXPECT_EQ(expected_vertical_maximum, vertical_scrollbar->maximum()); EXPECT_EQ(scroll_offset.y(), vertical_scrollbar->current_pos()); @@ -692,7 +692,7 @@ TEST_F(LayerImplScrollTest, SetNewScrollbarParameters) { horizontal_scrollbar->SetScrollLayerAndClipLayerByIds( layer()->id(), tree()->root_layer()->id()); - float expected_horizontal_maximum = + int expected_horizontal_maximum = layer()->bounds().width() - tree()->root_layer()->bounds().width(); EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum()); EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos()); diff --git a/cc/layers/painted_scrollbar_layer_impl.cc b/cc/layers/painted_scrollbar_layer_impl.cc index b5de1e1..dcb1e82 100644 --- a/cc/layers/painted_scrollbar_layer_impl.cc +++ b/cc/layers/painted_scrollbar_layer_impl.cc @@ -75,6 +75,7 @@ void PaintedScrollbarLayerImpl::AppendQuads( bool flipped = false; gfx::PointF uv_top_left(0.f, 0.f); gfx::PointF uv_bottom_right(1.f, 1.f); + gfx::Rect bounds_rect(bounds()); gfx::Rect content_bounds_rect(content_bounds()); SharedQuadState* shared_quad_state = diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc index 7e92c0c..5c2ef4e 100644 --- a/cc/layers/picture_image_layer_impl_unittest.cc +++ b/cc/layers/picture_image_layer_impl_unittest.cc @@ -15,7 +15,6 @@ #include "cc/test/test_shared_bitmap_manager.h" #include "cc/trees/layer_tree_impl.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/geometry/size_conversions.h" namespace cc { namespace { @@ -64,9 +63,8 @@ class PictureImageLayerImplTest : public testing::Test { new TestablePictureImageLayerImpl(tree, id); layer->SetBounds(gfx::Size(100, 200)); layer->SetContentBounds(gfx::Size(100, 200)); - layer->tilings_.reset( - new PictureLayerTilingSet(&tiling_client_, - gfx::ToCeiledSize(layer->bounds()))); + layer->tilings_.reset(new PictureLayerTilingSet(&tiling_client_, + layer->bounds())); layer->pile_ = tiling_client_.GetPile(); return make_scoped_ptr(layer); } @@ -147,7 +145,7 @@ TEST_F(PictureImageLayerImplTest, IgnoreIdealContentScale) { // Draw. active_layer->draw_properties().visible_content_rect = - gfx::Rect(gfx::ToCeiledSize(active_layer->bounds())); + gfx::Rect(active_layer->bounds()); scoped_ptr<RenderPass> render_pass = RenderPass::Create(); AppendQuadsData data; active_layer->WillDraw(DRAW_MODE_SOFTWARE, NULL); diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc index d86aef7..68d24ba 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc @@ -9,7 +9,6 @@ #include "cc/layers/picture_layer_impl.h" #include "cc/trees/layer_tree_impl.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -#include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/rect_conversions.h" namespace cc { @@ -47,8 +46,7 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect // is identical to the layer_rect. // If update called, then pile size must match bounds pushed to impl layer. - DCHECK_EQ(gfx::ToCeiledSize(layer_impl->bounds()).ToString(), - pile_->tiling_size().ToString()); + DCHECK_EQ(layer_impl->bounds().ToString(), pile_->tiling_size().ToString()); } // Unlike other properties, invalidation must always be set on layer_impl. diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 8eb8f88..de176c3 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -732,10 +732,7 @@ void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { bool synced_high_res_tiling = false; if (CanHaveTilings()) { synced_high_res_tiling = tilings_->SyncTilings( - *other->tilings_, - gfx::ToCeiledSize(bounds()), - invalidation_, - MinimumContentsScale()); + *other->tilings_, bounds(), invalidation_, MinimumContentsScale()); } else { RemoveAllTilings(); } @@ -953,8 +950,7 @@ void PictureLayerImpl::DoPostCommitInitialization() { DCHECK(layer_tree_impl()->IsPendingTree()); if (!tilings_) - tilings_.reset(new PictureLayerTilingSet(this, - gfx::ToCeiledSize(bounds()))); + tilings_.reset(new PictureLayerTilingSet(this, bounds())); DCHECK(!twin_layer_); twin_layer_ = static_cast<PictureLayerImpl*>( @@ -1295,7 +1291,7 @@ float PictureLayerImpl::MinimumContentsScale() const { // then it will end up having less than one pixel of content in that // dimension. Bump the minimum contents scale up in this case to prevent // this from happening. - float min_dimension = std::min(bounds().width(), bounds().height()); + int min_dimension = std::min(bounds().width(), bounds().height()); if (!min_dimension) return setting_min; diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc index 12e1de3..0e3d8fa 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc @@ -63,7 +63,7 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) { layer->PushPropertiesTo(layer_impl.get()); EXPECT_FALSE(layer_impl->CanHaveTilings()); - EXPECT_TRUE(layer_impl->bounds() == gfx::SizeF(0, 0)); + EXPECT_TRUE(layer_impl->bounds() == gfx::Size(0, 0)); EXPECT_EQ(gfx::Size(), layer_impl->pile()->tiling_size()); EXPECT_FALSE(layer_impl->pile()->HasRecordings()); } diff --git a/cc/layers/ui_resource_layer_impl.cc b/cc/layers/ui_resource_layer_impl.cc index e6c3def..dc08a90 100644 --- a/cc/layers/ui_resource_layer_impl.cc +++ b/cc/layers/ui_resource_layer_impl.cc @@ -10,7 +10,6 @@ #include "cc/quads/texture_draw_quad.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/occlusion.h" -#include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/rect_f.h" namespace cc { @@ -120,7 +119,7 @@ void UIResourceLayerImpl::AppendQuads( bool opaque = layer_tree_impl()->IsUIResourceOpaque(ui_resource_id_) || contents_opaque(); - gfx::Rect quad_rect(gfx::ToCeiledSize(bounds())); + gfx::Rect quad_rect(bounds()); gfx::Rect opaque_rect(opaque ? quad_rect : gfx::Rect()); gfx::Rect visible_quad_rect = occlusion_in_content_space.GetUnoccludedContentRect(quad_rect); diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc index 01338f7..dc24e1d 100644 --- a/cc/layers/ui_resource_layer_impl_unittest.cc +++ b/cc/layers/ui_resource_layer_impl_unittest.cc @@ -15,7 +15,6 @@ #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/transform.h" namespace cc { @@ -121,7 +120,7 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) { layer_size, opaque, uid); - expected_opaque_bounds = gfx::Rect(gfx::ToCeiledSize(layer->bounds())); + expected_opaque_bounds = gfx::Rect(layer->bounds()); OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); } @@ -143,7 +142,7 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnLayer) { layer = GenerateUIResourceLayer( &host_impl, bitmap_size, layer_size, skbitmap_opaque, uid); layer->SetContentsOpaque(true); - expected_opaque_bounds = gfx::Rect(gfx::ToCeiledSize(layer->bounds())); + expected_opaque_bounds = gfx::Rect(layer->bounds()); OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); } diff --git a/cc/test/layer_tree_json_parser.cc b/cc/test/layer_tree_json_parser.cc index b9fba49..1514d83 100644 --- a/cc/test/layer_tree_json_parser.cc +++ b/cc/test/layer_tree_json_parser.cc @@ -26,9 +26,9 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val, success &= dict->GetString("LayerType", &layer_type); base::ListValue* list; success &= dict->GetList("Bounds", &list); - double width, height; - success &= list->GetDouble(0, &width); - success &= list->GetDouble(1, &height); + int width, height; + success &= list->GetInteger(0, &width); + success &= list->GetInteger(1, &height); success &= dict->GetList("Position", &list); double position_x, position_y; success &= list->GetDouble(0, &position_x); diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc index 2b80c4c..866f09d 100644 --- a/cc/trees/damage_tracker.cc +++ b/cc/trees/damage_tracker.cc @@ -14,7 +14,6 @@ #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" #include "ui/gfx/geometry/rect_conversions.h" -#include "ui/gfx/geometry/size_conversions.h" namespace cc { @@ -210,8 +209,7 @@ gfx::Rect DamageTracker::TrackDamageFromSurfaceMask( // expected to be a common case. if (target_surface_mask_layer->LayerPropertyChanged() || !target_surface_mask_layer->update_rect().IsEmpty()) { - damage_rect = gfx::Rect( - gfx::ToCeiledSize(target_surface_mask_layer->bounds())); + damage_rect = gfx::Rect(target_surface_mask_layer->bounds()); } return damage_rect; @@ -380,8 +378,7 @@ void DamageTracker::ExtendDamageForRenderSurface( const gfx::Transform& replica_draw_transform = render_surface->replica_draw_transform(); gfx::Rect replica_mask_layer_rect = MathUtil::MapEnclosingClippedRect( - replica_draw_transform, - gfx::Rect(gfx::ToCeiledSize(replica_mask_layer->bounds()))); + replica_draw_transform, gfx::Rect(replica_mask_layer->bounds())); data.Update(replica_mask_layer_rect, mailboxId_); // In the current implementation, a change in the replica mask damages the diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc index 56d990e..b6a4409 100644 --- a/cc/trees/damage_tracker_unittest.cc +++ b/cc/trees/damage_tracker_unittest.cc @@ -18,7 +18,6 @@ #include "third_party/skia/include/effects/SkBlurImageFilter.h" #include "ui/gfx/geometry/quad_f.h" #include "ui/gfx/geometry/rect_conversions.h" -#include "ui/gfx/geometry/size_conversions.h" namespace cc { namespace { @@ -33,7 +32,7 @@ void ExecuteCalculateDrawProperties(LayerImpl* root, FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root, gfx::ToCeiledSize(root->bounds()), render_surface_layer_list); + root, root->bounds(), render_surface_layer_list); LayerTreeHostCommon::CalculateDrawProperties(&inputs); } @@ -1138,8 +1137,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) { scoped_ptr<LayerImpl> mask_layer = LayerImpl::Create(host_impl_.active_tree(), 3); mask_layer->SetPosition(child->position()); - mask_layer->SetBounds(gfx::ToCeiledSize(child->bounds())); - mask_layer->SetContentBounds(gfx::ToCeiledSize(child->bounds())); + mask_layer->SetBounds(child->bounds()); + mask_layer->SetContentBounds(child->bounds()); child->SetMaskLayer(mask_layer.Pass()); } LayerImpl* mask_layer = child->mask_layer(); @@ -1242,9 +1241,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) { scoped_ptr<LayerImpl> replica_mask_layer = LayerImpl::Create(host_impl_.active_tree(), 7); replica_mask_layer->SetPosition(gfx::PointF()); - replica_mask_layer->SetBounds(gfx::ToCeiledSize(grand_child1->bounds())); - replica_mask_layer->SetContentBounds( - gfx::ToCeiledSize(grand_child1->bounds())); + replica_mask_layer->SetBounds(grand_child1->bounds()); + replica_mask_layer->SetContentBounds(grand_child1->bounds()); grand_child1_replica->SetMaskLayer(replica_mask_layer.Pass()); } LayerImpl* replica_mask_layer = grand_child1_replica->mask_layer(); @@ -1321,9 +1319,8 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) { LayerImpl::Create(host_impl_.active_tree(), 7); replica_mask_layer->SetPosition(gfx::PointF()); // Note: this is not the transform origin being tested. - replica_mask_layer->SetBounds(gfx::ToCeiledSize(grand_child1->bounds())); - replica_mask_layer->SetContentBounds( - gfx::ToCeiledSize(grand_child1->bounds())); + replica_mask_layer->SetBounds(grand_child1->bounds()); + replica_mask_layer->SetContentBounds(grand_child1->bounds()); grand_child1_replica->SetMaskLayer(replica_mask_layer.Pass()); } LayerImpl* replica_mask_layer = grand_child1_replica->mask_layer(); diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 2157210..9efcaea 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -30,7 +30,6 @@ #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/quad_f.h" #include "ui/gfx/transform.h" @@ -1159,10 +1158,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - translate, - &render_surface_layer_list); + root.get(), root->bounds(), translate, &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_EQ(translate, root->draw_properties().target_space_transform); @@ -1177,10 +1173,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - scale, - &render_surface_layer_list); + root.get(), root->bounds(), scale, &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_EQ(scale, root->draw_properties().target_space_transform); @@ -1195,10 +1188,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - rotate, - &render_surface_layer_list); + root.get(), root->bounds(), rotate, &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_EQ(rotate, root->draw_properties().target_space_transform); @@ -1215,10 +1205,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - composite, - &render_surface_layer_list); + root.get(), root->bounds(), composite, &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_EQ(composite, root->draw_properties().target_space_transform); @@ -1232,10 +1219,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - translate, - &render_surface_layer_list); + root.get(), root->bounds(), translate, &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -1257,10 +1241,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - translate, - &render_surface_layer_list); + root.get(), root->bounds(), translate, &render_surface_layer_list); inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); inputs.can_adjust_raster_scales = true; @@ -1281,10 +1262,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - composite, - &render_surface_layer_list); + root.get(), root->bounds(), composite, &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); gfx::Transform compositeSquared = composite; @@ -4493,9 +4471,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -4538,9 +4514,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -4568,9 +4542,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -4595,9 +4567,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScale) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -4685,9 +4655,7 @@ TEST_F(LayerTreeHostCommonTest, float page_scale_factor = 1.f; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(), @@ -4769,9 +4737,7 @@ TEST_F(LayerTreeHostCommonTest, SmallContentsScale) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -4797,9 +4763,7 @@ TEST_F(LayerTreeHostCommonTest, SmallContentsScale) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -4920,9 +4884,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForSurfaces) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -5123,9 +5085,7 @@ TEST_F(LayerTreeHostCommonTest, SkMScalar device_scale_factor = 5.0; SkMScalar page_scale_factor = 7.0; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.device_scale_factor = device_scale_factor; inputs.page_scale_factor = page_scale_factor; inputs.page_scale_application_layer = root.get(); @@ -5270,9 +5230,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForAnimatingLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -5288,9 +5246,7 @@ TEST_F(LayerTreeHostCommonTest, ContentsScaleForAnimatingLayer) { { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -5701,9 +5657,7 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -5913,9 +5867,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -5971,9 +5923,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6031,9 +5981,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6088,9 +6036,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6202,9 +6148,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6313,9 +6257,7 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6375,9 +6317,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -7006,9 +6946,7 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) { LayerImplList render_surface_layer_list; FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root.get()); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_render_to_separate_surface = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -7018,9 +6956,7 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) { { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); inputs.can_render_to_separate_surface = false; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -7565,7 +7501,7 @@ TEST_F(LayerTreeHostCommonTest, OutOfOrderClippingRequiresRSLLSorting) { RenderSurfaceLayerList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( root.get(), - gfx::ToCeiledSize(root->bounds()), + root->bounds(), identity_transform, &render_surface_layer_list); @@ -7701,9 +7637,7 @@ TEST_F(LayerTreeHostCommonTest, DoNotClobberSorting) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -7798,9 +7732,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_TRANSFORMATION_MATRIX_EQ( @@ -7823,9 +7755,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_TRANSFORMATION_MATRIX_EQ( @@ -7850,9 +7780,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_TRANSFORMATION_MATRIX_EQ( @@ -7876,9 +7804,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) { LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root.get(), - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list); + root.get(), root->bounds(), &render_surface_layer_list); LayerTreeHostCommon::CalculateDrawProperties(&inputs); EXPECT_VECTOR_EQ( diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index e0d2e26..4d2f5a7 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -2660,9 +2660,7 @@ bool LayerTreeHostImpl::ScrollVerticallyByPage(const gfx::Point& viewport_point, if (!layer_impl->HasScrollbar(VERTICAL)) continue; - float height = layer_impl->scroll_clip_layer() - ? layer_impl->scroll_clip_layer()->bounds().height() - : 0; + float height = layer_impl->clip_height(); // These magical values match WebKit and are designed to scroll nearly the // entire visible content height but leave a bit of overlap. diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 06bf669..2972a7c 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -898,7 +898,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) { EXPECT_EQ(scroll_layer, host_impl_->InnerViewportScrollLayer()); LayerImpl* container_layer = scroll_layer->scroll_clip_layer(); - EXPECT_EQ(gfx::SizeF(50, 50), container_layer->bounds()); + EXPECT_EQ(gfx::Size(50, 50), container_layer->bounds()); float min_page_scale = 1.f, max_page_scale = 4.f; float page_scale_factor = 1.f; @@ -929,7 +929,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) { EXPECT_FALSE(did_request_animate_); EXPECT_TRUE(did_request_redraw_); EXPECT_TRUE(did_request_commit_); - EXPECT_EQ(gfx::SizeF(50, 50), container_layer->bounds()); + EXPECT_EQ(gfx::Size(50, 50), container_layer->bounds()); scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas(); @@ -3819,7 +3819,7 @@ TEST_F(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) { scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1); root->SetBounds(gfx::Size(10, 10)); - root->SetContentBounds(gfx::ToCeiledSize(root->bounds())); + root->SetContentBounds(root->bounds()); root->SetDrawsContent(false); host_impl_->active_tree()->SetRootLayer(root.Pass()); } @@ -4735,7 +4735,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity( root->CreateRenderSurface(); root->SetPosition(root_rect.origin()); root->SetBounds(root_rect.size()); - root->SetContentBounds(gfx::ToCeiledSize(root->bounds())); + root->SetContentBounds(root->bounds()); root->draw_properties().visible_content_rect = root_rect; root->SetDrawsContent(false); root->render_surface()->SetContentRect(gfx::Rect(root_rect.size())); @@ -4743,14 +4743,14 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity( child->SetPosition(gfx::PointF(child_rect.x(), child_rect.y())); child->SetOpacity(0.5f); child->SetBounds(gfx::Size(child_rect.width(), child_rect.height())); - child->SetContentBounds(gfx::ToCeiledSize(child->bounds())); + child->SetContentBounds(child->bounds()); child->draw_properties().visible_content_rect = child_rect; child->SetDrawsContent(false); child->SetForceRenderSurface(true); grand_child->SetPosition(grand_child_rect.origin()); grand_child->SetBounds(grand_child_rect.size()); - grand_child->SetContentBounds(gfx::ToCeiledSize(grand_child->bounds())); + grand_child->SetContentBounds(grand_child->bounds()); grand_child->draw_properties().visible_content_rect = grand_child_rect; grand_child->SetDrawsContent(true); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index d608b91..be5967c 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -200,7 +200,7 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest { case DONE: break; case BOUNDS: - EXPECT_EQ(gfx::SizeF(20, 20).ToString(), layer->bounds().ToString()); + EXPECT_EQ(gfx::Size(20, 20).ToString(), layer->bounds().ToString()); break; case HIDE_LAYER_AND_SUBTREE: EXPECT_TRUE(layer->hide_layer_and_subtree()); @@ -2423,10 +2423,10 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents num_commits_++; if (num_commits_ == 1) { LayerImpl* root_layer = host_impl->active_tree()->root_layer(); - EXPECT_SIZE_EQ(gfx::SizeF(1, 1), root_layer->bounds()); + EXPECT_SIZE_EQ(gfx::Size(1, 1), root_layer->bounds()); } else { LayerImpl* root_layer = host_impl->active_tree()->root_layer(); - EXPECT_SIZE_EQ(gfx::SizeF(2, 2), root_layer->bounds()); + EXPECT_SIZE_EQ(gfx::Size(2, 2), root_layer->bounds()); EndTest(); } } @@ -4070,7 +4070,7 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { switch (impl->active_tree()->source_frame_number()) { case 1: - EXPECT_EQ(gfx::SizeF(5, 5).ToString(), child->bounds().ToString()); + EXPECT_EQ(gfx::Size(5, 5).ToString(), child->bounds().ToString()); break; } } diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index a185391..82cee89 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -1055,7 +1055,7 @@ class LayerTreeHostScrollTestScrollZeroMaxScrollOffset InputHandler::Gesture)); // Set max_scroll_offset = (0, 0). - scroll_layer->SetBounds(gfx::ToCeiledSize(root->bounds())); + scroll_layer->SetBounds(root->bounds()); EXPECT_EQ(InputHandler::ScrollIgnored, scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), InputHandler::Gesture)); diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 180458e..f5dda6e 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -570,12 +570,12 @@ const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { return render_surface_layer_list_; } -gfx::SizeF LayerTreeImpl::ScrollableSize() const { +gfx::Size LayerTreeImpl::ScrollableSize() const { LayerImpl* root_scroll_layer = OuterViewportScrollLayer() ? OuterViewportScrollLayer() : InnerViewportScrollLayer(); if (!root_scroll_layer || root_scroll_layer->children().empty()) - return gfx::SizeF(); + return gfx::Size(); return root_scroll_layer->children()[0]->bounds(); } diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 51ae456..95a9bac 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h @@ -209,7 +209,7 @@ class CC_EXPORT LayerTreeImpl { // These return the size of the root scrollable area and the size of // the user-visible scrolling viewport, in CSS layout coordinates. - gfx::SizeF ScrollableSize() const; + gfx::Size ScrollableSize() const; gfx::SizeF ScrollableViewportSize() const; gfx::Rect RootScrollLayerDeviceViewportBounds() const; diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 211262c..7fc1645 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -59,7 +59,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -183,7 +183,7 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -249,7 +249,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -305,7 +305,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -374,7 +374,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -454,7 +454,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) { root->AddChild(test_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -545,7 +545,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) { root->AddChild(clipping_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -670,7 +670,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { root->AddChild(child.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -793,7 +793,7 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { root->AddChild(intermediate_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -901,7 +901,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { LayerImpl* child2 = root->children()[1]; LayerImpl* grand_child1 = child1->children()[0]; - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1049,7 +1049,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { LayerImpl* child2 = root->children()[1]; LayerImpl* grand_child1 = child1->children()[0]; - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1167,7 +1167,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { root->AddChild(child.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1242,7 +1242,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { root->AddChild(child.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1335,7 +1335,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { LayerImpl* child2 = root->children()[1]; LayerImpl* grand_child1 = child1->children()[0]; - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1425,7 +1425,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1514,7 +1514,7 @@ TEST_F(LayerTreeImplTest, root->SetDrawsContent(true); root->SetTouchEventHandlerRegion(touch_handler_region); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1592,7 +1592,7 @@ TEST_F(LayerTreeImplTest, root->SetDrawsContent(true); root->SetTouchEventHandlerRegion(touch_handler_region); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1688,7 +1688,7 @@ TEST_F(LayerTreeImplTest, root->AddChild(test_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1927,7 +1927,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { root->AddChild(clipping_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -2025,7 +2025,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { root->AddChild(notouch_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -2087,7 +2087,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { false); root->SetDrawsContent(true); - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -2194,7 +2194,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { root->AddChild(clipping_layer.Pass()); } - host_impl().SetViewportSize(gfx::ToCeiledSize(root->bounds())); + host_impl().SetViewportSize(root->bounds()); host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index 007226d..6ab3397 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -22,7 +22,6 @@ #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/transform.h" namespace cc { @@ -310,9 +309,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { Types::RecursiveUpdateNumChildren(root); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root, - gfx::ToCeiledSize(root->bounds()), - &render_surface_layer_list_impl_); + root, root->bounds(), &render_surface_layer_list_impl_); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -326,9 +323,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { render_surface_layer_list_.reset(new RenderSurfaceLayerList); LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - root, - gfx::ToCeiledSize(root->bounds()), - render_surface_layer_list_.get()); + root, root->bounds(), render_surface_layer_list_.get()); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -418,7 +413,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { const gfx::Size& bounds) { SetBaseProperties(layer, transform, position, bounds); - layer->SetContentBounds(gfx::ToCeiledSize(layer->bounds())); + layer->SetContentBounds(layer->bounds()); } void SetReplica(Layer* owning_layer, scoped_refptr<Layer> layer) { diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index fcc7cd6..faa86ce 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc @@ -361,7 +361,7 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndProperties) { EXPECT_EQ(first_child_opacity, layer_impl_tree_root->children()[0]->opacity()); - gfx::SizeF second_layer_impl_child_bounds = + gfx::Size second_layer_impl_child_bounds = layer_impl_tree_root->children()[1]->bounds(); EXPECT_EQ(second_child_bounds.width(), second_layer_impl_child_bounds.width()); |