summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authorbokan <bokan@chromium.org>2014-10-08 08:15:22 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-08 15:15:44 +0000
commitcccfde7dac913451d92e9cd44e3d77a7f913be43 (patch)
treed83e9cf51df8ba8cce53716591ac7ceafbe8dea8 /cc/trees
parent6efe7f2e63509864dc9378a7af86721aecd8e15e (diff)
downloadchromium_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/trees')
-rw-r--r--cc/trees/damage_tracker.cc7
-rw-r--r--cc/trees/damage_tracker_unittest.cc17
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc142
-rw-r--r--cc/trees/layer_tree_host_impl.cc4
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc12
-rw-r--r--cc/trees/layer_tree_host_unittest.cc8
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc2
-rw-r--r--cc/trees/layer_tree_impl.cc4
-rw-r--r--cc/trees/layer_tree_impl.h2
-rw-r--r--cc/trees/layer_tree_impl_unittest.cc44
-rw-r--r--cc/trees/occlusion_tracker_unittest.cc11
-rw-r--r--cc/trees/tree_synchronizer_unittest.cc2
12 files changed, 84 insertions, 171 deletions
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());