diff options
Diffstat (limited to 'cc')
25 files changed, 293 insertions, 273 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc index 6e5ac0b..fa7eccf 100644 --- a/cc/base/math_util.cc +++ b/cc/base/math_util.cc @@ -779,6 +779,15 @@ void MathUtil::AddToTracedValue(const char* name, } void MathUtil::AddToTracedValue(const char* name, + const gfx::Point& pt, + base::trace_event::TracedValue* res) { + res->BeginArray(name); + res->AppendInteger(pt.x()); + res->AppendInteger(pt.y()); + res->EndArray(); +} + +void MathUtil::AddToTracedValue(const char* name, const gfx::PointF& pt, base::trace_event::TracedValue* res) { res->BeginArray(name); diff --git a/cc/base/math_util.h b/cc/base/math_util.h index a83ab4f..c596348 100644 --- a/cc/base/math_util.h +++ b/cc/base/math_util.h @@ -269,6 +269,9 @@ class CC_EXPORT MathUtil { const gfx::Rect& r, base::trace_event::TracedValue* res); static void AddToTracedValue(const char* name, + const gfx::Point& q, + base::trace_event::TracedValue* res); + static void AddToTracedValue(const char* name, const gfx::PointF& q, base::trace_event::TracedValue* res); static void AddToTracedValue(const char* name, diff --git a/cc/input/layer_selection_bound.h b/cc/input/layer_selection_bound.h index 10b14d9..dece32b 100644 --- a/cc/input/layer_selection_bound.h +++ b/cc/input/layer_selection_bound.h @@ -8,7 +8,7 @@ #include "cc/base/cc_export.h" #include "cc/input/selection.h" #include "cc/input/selection_bound_type.h" -#include "ui/gfx/geometry/point_f.h" +#include "ui/gfx/geometry/point.h" namespace cc { @@ -18,8 +18,8 @@ struct CC_EXPORT LayerSelectionBound { ~LayerSelectionBound(); SelectionBoundType type; - gfx::PointF edge_top; - gfx::PointF edge_bottom; + gfx::Point edge_top; + gfx::Point edge_bottom; int layer_id; }; diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc index 11a0ed3..c5e33303 100644 --- a/cc/layers/delegated_renderer_layer_impl_unittest.cc +++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc @@ -72,17 +72,17 @@ class DelegatedRendererLayerImplTestSimple root_layer->SetBounds(gfx::Size(100, 100)); root_layer->SetHasRenderSurface(true); - layer_before->SetPosition(gfx::Point(20, 20)); + layer_before->SetPosition(gfx::PointF(20.f, 20.f)); layer_before->SetBounds(gfx::Size(14, 14)); layer_before->SetDrawsContent(true); layer_before->SetHasRenderSurface(true); - layer_after->SetPosition(gfx::Point(5, 5)); + layer_after->SetPosition(gfx::PointF(5.f, 5.f)); layer_after->SetBounds(gfx::Size(15, 15)); layer_after->SetDrawsContent(true); layer_after->SetHasRenderSurface(true); - delegated_renderer_layer->SetPosition(gfx::Point(3, 3)); + delegated_renderer_layer->SetPosition(gfx::PointF(3.f, 3.f)); delegated_renderer_layer->SetBounds(gfx::Size(10, 10)); delegated_renderer_layer->SetDrawsContent(true); gfx::Transform transform; @@ -142,7 +142,7 @@ TEST_F(DelegatedRendererLayerImplTest, root_layer->SetBounds(gfx::Size(100, 100)); root_layer->SetHasRenderSurface(true); - delegated_renderer_layer->SetPosition(gfx::Point(3, 3)); + delegated_renderer_layer->SetPosition(gfx::PointF(3.f, 3.f)); delegated_renderer_layer->SetBounds(gfx::Size(10, 10)); delegated_renderer_layer->SetDrawsContent(true); delegated_renderer_layer->SetHasRenderSurface(true); @@ -221,7 +221,7 @@ TEST_F(DelegatedRendererLayerImplTest, root_layer->SetBounds(gfx::Size(100, 100)); root_layer->SetHasRenderSurface(true); - delegated_renderer_layer->SetPosition(gfx::Point(3, 3)); + delegated_renderer_layer->SetPosition(gfx::PointF(3.f, 3.f)); delegated_renderer_layer->SetBounds(gfx::Size(10, 10)); delegated_renderer_layer->SetDrawsContent(true); delegated_renderer_layer->SetHasRenderSurface(true); @@ -625,7 +625,7 @@ class DelegatedRendererLayerImplTestTransform root_layer->SetBounds(gfx::Size(100, 100)); root_layer->SetHasRenderSurface(true); - delegated_renderer_layer->SetPosition(gfx::Point(20, 20)); + delegated_renderer_layer->SetPosition(gfx::PointF(20.f, 20.f)); delegated_renderer_layer->SetBounds(gfx::Size(75, 75)); delegated_renderer_layer->SetDrawsContent(true); gfx::Transform transform; @@ -1051,7 +1051,7 @@ class DelegatedRendererLayerImplTestClip root_layer->SetBounds(gfx::Size(100, 100)); root_layer->SetHasRenderSurface(true); - delegated_renderer_layer->SetPosition(gfx::Point(20, 20)); + delegated_renderer_layer->SetPosition(gfx::PointF(20.f, 20.f)); delegated_renderer_layer->SetBounds(gfx::Size(50, 50)); delegated_renderer_layer->SetDrawsContent(true); @@ -1154,14 +1154,15 @@ class DelegatedRendererLayerImplTestClip delegated_renderer_layer_ = delegated_renderer_layer.get(); if (clip_delegated_renderer_layer_) { - gfx::Rect clip_rect(21, 27, 23, 21); + gfx::PointF clip_origin(21.f, 27.f); + gfx::Size clip_size(23, 21); - clip_layer->SetPosition(clip_rect.origin()); - clip_layer->SetBounds(clip_rect.size()); + clip_layer->SetPosition(clip_origin); + clip_layer->SetBounds(clip_size); clip_layer->SetMasksToBounds(true); origin_layer->SetPosition( - gfx::PointAtOffsetFromOrigin(-clip_rect.OffsetFromOrigin())); + gfx::PointF(-clip_origin.x(), -clip_origin.y())); origin_layer->AddChild(delegated_renderer_layer.Pass()); clip_layer->AddChild(origin_layer.Pass()); diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc index 01815f9..ee429a2 100644 --- a/cc/layers/layer_iterator_unittest.cc +++ b/cc/layers/layer_iterator_unittest.cc @@ -40,7 +40,7 @@ class TestLayerImpl : public LayerImpl { count_representing_contributing_surface_(-1), count_representing_itself_(-1) { SetBounds(gfx::Size(100, 100)); - SetPosition(gfx::Point()); + SetPosition(gfx::PointF()); SetDrawsContent(true); } }; diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 642ef2e..10c916f 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -3935,7 +3935,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, gfx::Size tile_size(102, 102); gfx::Size layer_bounds(1000, 1000); gfx::Size viewport_size(500, 500); - gfx::Point occluding_layer_position(310, 0); + gfx::PointF occluding_layer_position(310.f, 0.f); host_impl_.SetViewportSize(viewport_size); @@ -3994,7 +3994,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, EXPECT_EQ(20, unoccluded_tile_count); // Full occlusion. - layer1->SetPosition(gfx::Point(0, 0)); + layer1->SetPosition(gfx::PointF()); host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); @@ -4024,7 +4024,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, gfx::Size tile_size(102, 102); gfx::Size layer_bounds(1000, 1000); gfx::Size viewport_size(500, 500); - gfx::Point occluding_layer_position(310, 0); + gfx::PointF occluding_layer_position(310.f, 0.f); host_impl_.SetViewportSize(viewport_size); @@ -4099,7 +4099,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, } // Full occlusion. - layer1->SetPosition(gfx::PointF(0, 0)); + layer1->SetPosition(gfx::PointF()); host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); @@ -4141,7 +4141,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, OcclusionForDifferentScales) { gfx::Size tile_size(102, 102); gfx::Size layer_bounds(1000, 1000); gfx::Size viewport_size(500, 500); - gfx::Point occluding_layer_position(310, 0); + gfx::PointF occluding_layer_position(310.f, 0.f); scoped_refptr<FakeDisplayListRasterSource> pending_raster_source = FakeDisplayListRasterSource::CreateFilled(layer_bounds); @@ -4213,7 +4213,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, OcclusionForDifferentScales) { TEST_F(OcclusionTrackingPictureLayerImplTest, DifferentOcclusionOnTrees) { gfx::Size layer_bounds(1000, 1000); gfx::Size viewport_size(1000, 1000); - gfx::Point occluding_layer_position(310, 0); + gfx::PointF occluding_layer_position(310.f, 0.f); gfx::Rect invalidation_rect(230, 230, 102, 102); scoped_refptr<FakeDisplayListRasterSource> pending_raster_source = @@ -4303,8 +4303,8 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, gfx::Size tile_size(102, 102); gfx::Size layer_bounds(1000, 1000); gfx::Size viewport_size(1000, 1000); - gfx::Point pending_occluding_layer_position(310, 0); - gfx::Point active_occluding_layer_position(0, 310); + gfx::PointF pending_occluding_layer_position(310.f, 0.f); + gfx::PointF active_occluding_layer_position(0.f, 310.f); gfx::Rect invalidation_rect(230, 230, 152, 152); host_impl_.SetViewportSize(viewport_size); diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 14c1449..2574b98 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -158,10 +158,9 @@ TEST_F(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { // When the scrollbar is not an overlay scrollbar, the scroll should be // responded to on the main thread as the compositor does not yet implement // scrollbar scrolling. - EXPECT_EQ( - InputHandler::SCROLL_ON_MAIN_THREAD, - scrollbar_layer_impl->TryScroll(gfx::Point(0, 0), InputHandler::GESTURE, - SCROLL_BLOCKS_ON_NONE)); + EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, + scrollbar_layer_impl->TryScroll( + gfx::PointF(), InputHandler::GESTURE, SCROLL_BLOCKS_ON_NONE)); // Create and attach an overlay scrollbar. scrollbar.reset(new FakeScrollbar(false, false, true)); @@ -174,10 +173,9 @@ TEST_F(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { // The user shouldn't be able to drag an overlay scrollbar and the scroll // may be handled in the compositor. - EXPECT_EQ( - InputHandler::SCROLL_IGNORED, - scrollbar_layer_impl->TryScroll(gfx::Point(0, 0), InputHandler::GESTURE, - SCROLL_BLOCKS_ON_NONE)); + EXPECT_EQ(InputHandler::SCROLL_IGNORED, + scrollbar_layer_impl->TryScroll( + gfx::PointF(), InputHandler::GESTURE, SCROLL_BLOCKS_ON_NONE)); } TEST_F(ScrollbarLayerTest, ScrollOffsetSynchronization) { @@ -732,7 +730,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) { scrollbar_layer->SetIsDrawable(true); scrollbar_layer->SetBounds(gfx::Size(100, 15)); - scrollbar_layer->SetPosition(scrollbar_location); + scrollbar_layer->SetPosition(gfx::PointF(scrollbar_location)); layer_tree_root->SetBounds(gfx::Size(100, 200)); content_layer->SetBounds(gfx::Size(100, 200)); scrollbar_layer->set_visible_layer_rect(gfx::Rect(0, 0, 100, 200)); @@ -875,7 +873,7 @@ class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest { scrollbar_layer->SetIsDrawable(true); scrollbar_layer->SetBounds(gfx::Size(100, 15)); - scrollbar_layer->SetPosition(scrollbar_location); + scrollbar_layer->SetPosition(gfx::PointF(scrollbar_location)); layer_tree_root->SetBounds(gfx::Size(100, 200)); content_layer->SetBounds(gfx::Size(100, 200)); scrollbar_layer->set_visible_layer_rect( @@ -944,7 +942,7 @@ class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest { layer_tree_host_->SetRootLayer(layer_tree_root); scrollbar_layer->SetBounds(scrollbar_rect.size()); - scrollbar_layer->SetPosition(scrollbar_rect.origin()); + scrollbar_layer->SetPosition(gfx::PointF(scrollbar_rect.origin())); scrollbar_layer->fake_scrollbar()->set_location(scrollbar_rect.origin()); scrollbar_layer->fake_scrollbar()->set_track_rect(scrollbar_rect); scrollbar_layer->set_visible_layer_rect(scrollbar_rect); diff --git a/cc/layers/viewport.cc b/cc/layers/viewport.cc index 4b68de5..3483d67 100644 --- a/cc/layers/viewport.cc +++ b/cc/layers/viewport.cc @@ -93,11 +93,11 @@ void Viewport::PinchUpdate(float magnify_delta, const gfx::Point& anchor) { gfx::Point adjusted_anchor = anchor + pinch_anchor_adjustment_; float page_scale = active_tree->current_page_scale_factor(); gfx::PointF previous_scale_anchor = - gfx::ScalePoint(adjusted_anchor, 1.f / page_scale); + gfx::ScalePoint(gfx::PointF(adjusted_anchor), 1.f / page_scale); active_tree->SetPageScaleOnActiveTree(page_scale * magnify_delta); page_scale = active_tree->current_page_scale_factor(); gfx::PointF new_scale_anchor = - gfx::ScalePoint(adjusted_anchor, 1.f / page_scale); + gfx::ScalePoint(gfx::PointF(adjusted_anchor), 1.f / page_scale); gfx::Vector2dF move = previous_scale_anchor - new_scale_anchor; // Scale back to viewport space since that's the coordinate space ScrollBy diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 215ef2e..2636c7e 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -1878,10 +1878,10 @@ void GLRenderer::DrawContentQuadNoAA(const DrawingFrame* frame, // does, then vertices will match the texture mapping in the vertex buffer. // The method SetShaderQuadF() changes the order of vertices and so it's // not used here. - gfx::QuadF tile_quad(gfx::RectF(quad->visible_rect)); + auto tile_quad = gfx::QuadF(gfx::RectF(quad->visible_rect)); float width = quad->visible_rect.width(); float height = quad->visible_rect.height(); - gfx::PointF top_left = quad->visible_rect.origin(); + auto top_left = gfx::PointF(quad->visible_rect.origin()); if (clip_region) { tile_quad = *clip_region; float gl_uv[8] = { diff --git a/cc/test/layer_tree_json_parser_unittest.cc b/cc/test/layer_tree_json_parser_unittest.cc index 4f97945..f1388c0 100644 --- a/cc/test/layer_tree_json_parser_unittest.cc +++ b/cc/test/layer_tree_json_parser_unittest.cc @@ -78,7 +78,7 @@ TEST_F(LayerTreeJsonParserSanityCheck, Basic) { parent->SetBounds(gfx::Size(50, 50)); child->SetBounds(gfx::Size(40, 40)); - parent->SetPosition(gfx::Point(25, 25)); + parent->SetPosition(gfx::PointF(25.f, 25.f)); child->SetHaveWheelEventHandlers(true); child->SetHaveScrollEventHandlers(true); diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc index 50ec17a..a8e3c1c 100644 --- a/cc/test/layer_tree_pixel_test.cc +++ b/cc/test/layer_tree_pixel_test.cc @@ -122,7 +122,7 @@ scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer( SolidColorLayer::Create(layer_settings()); layer->SetIsDrawable(true); layer->SetBounds(rect.size()); - layer->SetPosition(rect.origin()); + layer->SetPosition(gfx::PointF(rect.origin())); layer->SetBackgroundColor(color); return layer; } @@ -180,7 +180,7 @@ scoped_refptr<TextureLayer> LayerTreePixelTest::CreateTextureLayer( TextureLayer::CreateForMailbox(layer_settings(), NULL); layer->SetIsDrawable(true); layer->SetBounds(rect.size()); - layer->SetPosition(rect.origin()); + layer->SetPosition(gfx::PointF(rect.origin())); TextureMailbox texture_mailbox; scoped_ptr<SingleReleaseCallback> release_callback; diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc index 0d51a5d..8d874d9 100644 --- a/cc/tiles/picture_layer_tiling.cc +++ b/cc/tiles/picture_layer_tiling.cc @@ -531,8 +531,8 @@ gfx::Rect PictureLayerTiling::CoverageIterator::geometry_rect() const { } gfx::RectF PictureLayerTiling::CoverageIterator::texture_rect() const { - gfx::PointF tex_origin = - tiling_->tiling_data_.TileBoundsWithBorder(tile_i_, tile_j_).origin(); + auto tex_origin = gfx::PointF( + tiling_->tiling_data_.TileBoundsWithBorder(tile_i_, tile_j_).origin()); // Convert from dest space => content space => texture space. gfx::RectF texture_rect(current_geometry_rect_); diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 7bfe81b..98118cc 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -495,8 +495,8 @@ bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt( if (!scrolling_layer_impl) return false; - gfx::PointF device_viewport_point = - gfx::ScalePoint(viewport_point, active_tree_->device_scale_factor()); + gfx::PointF device_viewport_point = gfx::ScalePoint( + gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); @@ -524,8 +524,8 @@ bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt( bool LayerTreeHostImpl::HaveWheelEventHandlersAt( const gfx::Point& viewport_point) { - gfx::PointF device_viewport_point = - gfx::ScalePoint(viewport_point, active_tree_->device_scale_factor()); + gfx::PointF device_viewport_point = gfx::ScalePoint( + gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerWithWheelHandlerThatIsHitByPoint( @@ -551,8 +551,8 @@ static ScrollBlocksOn EffectiveScrollBlocksOn(LayerImpl* layer) { bool LayerTreeHostImpl::DoTouchEventsBlockScrollAt( const gfx::Point& viewport_point) { - gfx::PointF device_viewport_point = - gfx::ScalePoint(viewport_point, active_tree_->device_scale_factor()); + gfx::PointF device_viewport_point = gfx::ScalePoint( + gfx::PointF(viewport_point), active_tree_->device_scale_factor()); // First check if scrolling at this point is required to block on any // touch event handlers. Note that we must start at the innermost layer @@ -2469,8 +2469,8 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( DCHECK(!CurrentlyScrollingLayer()); ClearCurrentlyScrollingLayer(); - gfx::PointF device_viewport_point = - gfx::ScalePoint(viewport_point, active_tree_->device_scale_factor()); + gfx::PointF device_viewport_point = gfx::ScalePoint( + gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); @@ -2627,6 +2627,8 @@ static gfx::Vector2dF ScrollLayerWithLocalDelta( return consumed_scroll; } +// TODO(danakj): Make this into two functions, one with delta, one with +// viewport_point, no bool required. gfx::Vector2dF LayerTreeHostImpl::ScrollLayer(LayerImpl* layer_impl, const gfx::Vector2dF& delta, const gfx::Point& viewport_point, @@ -2638,8 +2640,10 @@ gfx::Vector2dF LayerTreeHostImpl::ScrollLayer(LayerImpl* layer_impl, // screen (such as wheel events) represent a fixed amount of scrolling so we // can just apply them directly, but the page scale factor is applied to the // scroll delta. - if (is_direct_manipulation) - return ScrollLayerWithViewportSpaceDelta(layer_impl, viewport_point, delta); + if (is_direct_manipulation) { + return ScrollLayerWithViewportSpaceDelta( + layer_impl, gfx::PointF(viewport_point), delta); + } float scale_factor = active_tree()->current_page_scale_factor(); return ScrollLayerWithLocalDelta(layer_impl, delta, scale_factor); } @@ -2870,8 +2874,8 @@ float LayerTreeHostImpl::DeviceSpaceDistanceToLayer( } void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) { - gfx::PointF device_viewport_point = - gfx::ScalePoint(viewport_point, active_tree_->device_scale_factor()); + gfx::PointF device_viewport_point = gfx::ScalePoint( + gfx::PointF(viewport_point), active_tree_->device_scale_factor()); LayerImpl* layer_impl = active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); HandleMouseOverScrollbar(layer_impl); diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 3523e3d..3824186 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -751,7 +751,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnLayerTopology) { scoped_ptr<LayerImpl> scrollable_child_1 = CreateScrollableLayer( 7, gfx::Size(10, 10), scrollable_child_clip_1.get()); child1 = scrollable_child_1.get(); - scrollable_child_1->SetPosition(gfx::Point(5, 5)); + scrollable_child_1->SetPosition(gfx::PointF(5.f, 5.f)); scrollable_child_1->SetHaveWheelEventHandlers(true); scrollable_child_1->SetHaveScrollEventHandlers(true); scrollable_child_clip_1->AddChild(scrollable_child_1.Pass()); @@ -766,7 +766,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnLayerTopology) { scoped_ptr<LayerImpl> scrollable_child_2 = CreateScrollableLayer( 9, gfx::Size(10, 10), scrollable_child_clip_2.get()); child2 = scrollable_child_2.get(); - scrollable_child_2->SetPosition(gfx::Point(5, 20)); + scrollable_child_2->SetPosition(gfx::PointF(5.f, 20.f)); scrollable_child_2->SetHaveWheelEventHandlers(true); scrollable_child_2->SetHaveScrollEventHandlers(true); scrollable_child_clip_2->AddChild(scrollable_child_2.Pass()); @@ -1596,7 +1596,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDoesntBubble) { scoped_ptr<LayerImpl> scroll_child = CreateScrollableLayer( 9, gfx::Size(10, 10), scroll_child_clip.get()); child = scroll_child.get(); - scroll_child->SetPosition(gfx::Point(20, 20)); + scroll_child->SetPosition(gfx::PointF(20.f, 20.f)); scroll_child_clip->AddChild(scroll_child.Pass()); child_clip = scroll_child_clip.get(); @@ -5556,7 +5556,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { // Expect no gutter rects. void TestLayerCoversFullViewport() { gfx::Rect layer_rect(viewport_size_); - child_->SetPosition(layer_rect.origin()); + child_->SetPosition(gfx::PointF(layer_rect.origin())); child_->SetBounds(layer_rect.size()); child_->SetQuadRect(gfx::Rect(layer_rect.size())); child_->SetQuadVisibleRect(gfx::Rect(layer_rect.size())); @@ -5576,7 +5576,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { // Expect fullscreen gutter rect. void TestEmptyLayer() { gfx::Rect layer_rect(0, 0, 0, 0); - child_->SetPosition(layer_rect.origin()); + child_->SetPosition(gfx::PointF(layer_rect.origin())); child_->SetBounds(layer_rect.size()); child_->SetQuadRect(gfx::Rect(layer_rect.size())); child_->SetQuadVisibleRect(gfx::Rect(layer_rect.size())); @@ -5596,7 +5596,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { // Expect four surrounding gutter rects. void TestLayerInMiddleOfViewport() { gfx::Rect layer_rect(500, 500, 200, 200); - child_->SetPosition(layer_rect.origin()); + child_->SetPosition(gfx::PointF(layer_rect.origin())); child_->SetBounds(layer_rect.size()); child_->SetQuadRect(gfx::Rect(layer_rect.size())); child_->SetQuadVisibleRect(gfx::Rect(layer_rect.size())); @@ -5617,7 +5617,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { void TestLayerIsLargerThanViewport() { gfx::Rect layer_rect(viewport_size_.width() + 10, viewport_size_.height() + 10); - child_->SetPosition(layer_rect.origin()); + child_->SetPosition(gfx::PointF(layer_rect.origin())); child_->SetBounds(layer_rect.size()); child_->SetQuadRect(gfx::Rect(layer_rect.size())); child_->SetQuadVisibleRect(gfx::Rect(layer_rect.size())); @@ -6164,7 +6164,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity( gfx::Rect grand_child_rect(5, 5, 150, 150); root->SetHasRenderSurface(true); - root->SetPosition(root_rect.origin()); + root->SetPosition(gfx::PointF(root_rect.origin())); root->SetBounds(root_rect.size()); root->draw_properties().visible_layer_rect = root_rect; root->SetDrawsContent(false); @@ -6177,7 +6177,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity( child->SetDrawsContent(false); child->SetHasRenderSurface(true); - grand_child->SetPosition(grand_child_rect.origin()); + grand_child->SetPosition(gfx::PointF(grand_child_rect.origin())); grand_child->SetBounds(grand_child_rect.size()); grand_child->draw_properties().visible_layer_rect = grand_child_rect; grand_child->SetDrawsContent(true); @@ -7240,8 +7240,8 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) { EXPECT_EQ(ViewportSelectionBound(), selection_before.end); // Plumb the layer-local selection bounds. - gfx::PointF selection_top(5, 0); - gfx::PointF selection_bottom(5, 5); + gfx::Point selection_top(5, 0); + gfx::Point selection_bottom(5, 5); LayerSelection selection; selection.start.type = SELECTION_BOUND_CENTER; selection.start.layer_id = root_layer_id; @@ -7265,8 +7265,8 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) { fake_output_surface->last_sent_frame().metadata.selection; EXPECT_EQ(selection.start.type, selection_after.start.type); EXPECT_EQ(selection.end.type, selection_after.end.type); - EXPECT_EQ(selection_bottom, selection_after.start.edge_bottom); - EXPECT_EQ(selection_top, selection_after.start.edge_top); + EXPECT_EQ(gfx::PointF(selection_bottom), selection_after.start.edge_bottom); + EXPECT_EQ(gfx::PointF(selection_top), selection_after.start.edge_top); EXPECT_TRUE(selection_after.start.visible); EXPECT_TRUE(selection_after.start.visible); } diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc index 929d8c0..1e395ab 100644 --- a/cc/trees/layer_tree_host_pixeltest_masks.cc +++ b/cc/trees/layer_tree_host_pixeltest_masks.cc @@ -132,7 +132,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskOfClippedLayer) { // Clip to the top half of the green layer. scoped_refptr<Layer> clip = Layer::Create(layer_settings()); - clip->SetPosition(gfx::Point(0, 0)); + clip->SetPosition(gfx::PointF()); clip->SetBounds(gfx::Size(100, 50)); clip->SetMasksToBounds(true); background->AddChild(clip); @@ -177,7 +177,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskWithReplica) { scoped_refptr<Layer> replica = Layer::Create(layer_settings()); replica->SetTransformOrigin(gfx::Point3F(25.f, 25.f, 0.f)); - replica->SetPosition(gfx::Point(50, 50)); + replica->SetPosition(gfx::PointF(50.f, 50.f)); replica->SetTransform(replica_transform); green->SetReplicaLayer(replica.get()); @@ -200,7 +200,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskWithReplicaOfClippedLayer) { // Clip to the bottom half of the green layer, and the left half of the // replica. scoped_refptr<Layer> clip = Layer::Create(layer_settings()); - clip->SetPosition(gfx::Point(0, 25)); + clip->SetPosition(gfx::PointF(0.f, 25.f)); clip->SetBounds(gfx::Size(75, 75)); clip->SetMasksToBounds(true); background->AddChild(clip); @@ -215,7 +215,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskWithReplicaOfClippedLayer) { scoped_refptr<Layer> replica = Layer::Create(layer_settings()); replica->SetTransformOrigin(gfx::Point3F(25.f, 25.f, 0.f)); - replica->SetPosition(gfx::Point(50, 50)); + replica->SetPosition(gfx::PointF(50.f, 50.f)); replica->SetTransform(replica_transform); green->SetReplicaLayer(replica.get()); @@ -250,7 +250,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskOfReplica) { scoped_refptr<Layer> replica = Layer::Create(layer_settings()); replica->SetTransformOrigin(gfx::Point3F(50.f, 50.f, 0.f)); - replica->SetPosition(gfx::Point()); + replica->SetPosition(gfx::PointF()); replica->SetTransform(replica_transform); replica->SetMaskLayer(mask.get()); green->SetReplicaLayer(replica.get()); @@ -273,7 +273,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskOfReplicaOfClippedLayer) { // Clip to the bottom 3/4 of the green layer, and the top 3/4 of the replica. scoped_refptr<Layer> clip = Layer::Create(layer_settings()); - clip->SetPosition(gfx::Point(0, 12)); + clip->SetPosition(gfx::PointF(0.f, 12.f)); clip->SetBounds(gfx::Size(100, 75)); clip->SetMasksToBounds(true); background->AddChild(clip); @@ -292,7 +292,7 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskOfReplicaOfClippedLayer) { scoped_refptr<Layer> replica = Layer::Create(layer_settings()); replica->SetTransformOrigin(gfx::Point3F(50.f, 50.f, 0.f)); - replica->SetPosition(gfx::Point()); + replica->SetPosition(gfx::PointF()); replica->SetTransform(replica_transform); replica->SetMaskLayer(mask.get()); green->SetReplicaLayer(replica.get()); diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc index 6af0bb2..b65fecc 100644 --- a/cc/trees/layer_tree_host_pixeltest_readback.cc +++ b/cc/trees/layer_tree_host_pixeltest_readback.cc @@ -391,7 +391,7 @@ TEST_P(LayerTreeHostReadbackPixelTest, ReadbackNonRootLayerOutsideViewport) { CreateSolidColorLayer(gfx::Rect(200, 200), SK_ColorGREEN); // Only the top left quarter of the layer is inside the viewport, so the // blue layer is entirely outside. - green->SetPosition(gfx::Point(100, 100)); + green->SetPosition(gfx::PointF(100.f, 100.f)); background->AddChild(green); scoped_refptr<SolidColorLayer> blue = @@ -497,7 +497,7 @@ TEST_P(LayerTreeHostReadbackDeviceScalePixelTest, ReadbackSubrect) { scoped_refptr<FakePictureLayer> blue = FakePictureLayer::Create(layer_settings(), &blue_client_); - blue->SetPosition(gfx::Point(50, 50)); + blue->SetPosition(gfx::PointF(50.f, 50.f)); blue->SetBounds(gfx::Size(25, 25)); blue->SetIsDrawable(true); green->AddChild(blue); @@ -518,14 +518,14 @@ TEST_P(LayerTreeHostReadbackDeviceScalePixelTest, ReadbackNonRootLayerSubrect) { scoped_refptr<FakePictureLayer> green = FakePictureLayer::Create(layer_settings(), &green_client_); - green->SetPosition(gfx::Point(10, 20)); + green->SetPosition(gfx::PointF(10.f, 20.f)); green->SetBounds(gfx::Size(90, 80)); green->SetIsDrawable(true); background->AddChild(green); scoped_refptr<FakePictureLayer> blue = FakePictureLayer::Create(layer_settings(), &blue_client_); - blue->SetPosition(gfx::Point(50, 50)); + blue->SetPosition(gfx::PointF(50.f, 50.f)); blue->SetBounds(gfx::Size(25, 25)); blue->SetIsDrawable(true); green->AddChild(blue); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index e75b3e9..b01c7711 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -915,7 +915,7 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate bool has_thumb = false; scrollbar_ = FakePaintedScrollbarLayer::Create( layer_settings(), paint_scrollbar, has_thumb, root_layer_->id()); - scrollbar_->SetPosition(gfx::Point(0, 10)); + scrollbar_->SetPosition(gfx::PointF(0.f, 10.f)); scrollbar_->SetBounds(gfx::Size(10, 10)); root_layer_->AddChild(scrollbar_); @@ -1624,7 +1624,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers root_layer_->SetBounds(gfx::Size(30, 30)); child_layer_->SetIsDrawable(true); - child_layer_->SetPosition(gfx::Point(2, 2)); + child_layer_->SetPosition(gfx::PointF(2.f, 2.f)); child_layer_->SetBounds(gfx::Size(10, 10)); layer_tree_host()->SetRootLayer(root_layer_); @@ -1650,8 +1650,8 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers impl->active_tree()->root_layer()->children()[0]); // Positions remain in layout pixels. - EXPECT_EQ(gfx::Point(0, 0), root->position()); - EXPECT_EQ(gfx::Point(2, 2), child->position()); + EXPECT_EQ(gfx::PointF(), root->position()); + EXPECT_EQ(gfx::PointF(2.f, 2.f), child->position()); // Compute all the layer transforms for the frame. LayerTreeHostImpl::FrameData frame_data; @@ -3270,7 +3270,7 @@ class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); grandchild1_->RemoveFromParent(); - grandchild1_->SetPosition(gfx::Point(1, 1)); + grandchild1_->SetPosition(gfx::PointF(1.f, 1.f)); EXPECT_FALSE(root_->needs_push_properties()); EXPECT_FALSE(root_->descendant_needs_push_properties()); @@ -3294,7 +3294,7 @@ class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion EXPECT_FALSE(grandchild3_->needs_push_properties()); EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); - grandchild2_->SetPosition(gfx::Point(1, 1)); + grandchild2_->SetPosition(gfx::PointF(1.f, 1.f)); EXPECT_FALSE(root_->needs_push_properties()); EXPECT_TRUE(root_->descendant_needs_push_properties()); @@ -3402,8 +3402,8 @@ class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree // Change grandchildren while their parent is not in the tree. child_->RemoveFromParent(); - grandchild1_->SetPosition(gfx::Point(1, 1)); - grandchild2_->SetPosition(gfx::Point(1, 1)); + grandchild1_->SetPosition(gfx::PointF(1.f, 1.f)); + grandchild2_->SetPosition(gfx::PointF(1.f, 1.f)); root_->AddChild(child_); EXPECT_FALSE(root_->needs_push_properties()); @@ -3468,9 +3468,9 @@ class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild EXPECT_FALSE(grandchild3_->needs_push_properties()); EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); - child_->SetPosition(gfx::Point(1, 1)); - grandchild1_->SetPosition(gfx::Point(1, 1)); - grandchild2_->SetPosition(gfx::Point(1, 1)); + child_->SetPosition(gfx::PointF(1.f, 1.f)); + grandchild1_->SetPosition(gfx::PointF(1.f, 1.f)); + grandchild2_->SetPosition(gfx::PointF(1.f, 1.f)); EXPECT_FALSE(root_->needs_push_properties()); EXPECT_TRUE(root_->descendant_needs_push_properties()); @@ -3532,9 +3532,9 @@ class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent EXPECT_FALSE(grandchild3_->needs_push_properties()); EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); - grandchild1_->SetPosition(gfx::Point(1, 1)); - grandchild2_->SetPosition(gfx::Point(1, 1)); - child_->SetPosition(gfx::Point(1, 1)); + grandchild1_->SetPosition(gfx::PointF(1.f, 1.f)); + grandchild2_->SetPosition(gfx::PointF(1.f, 1.f)); + child_->SetPosition(gfx::PointF(1.f, 1.f)); EXPECT_FALSE(root_->needs_push_properties()); EXPECT_TRUE(root_->descendant_needs_push_properties()); @@ -3724,17 +3724,17 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { protected: void SetupTree() override { root_layer_ = Layer::Create(layer_settings()); - root_layer_->SetPosition(gfx::Point()); + root_layer_->SetPosition(gfx::PointF()); root_layer_->SetBounds(gfx::Size(10, 10)); parent_layer_ = SolidColorLayer::Create(layer_settings()); - parent_layer_->SetPosition(gfx::Point()); + parent_layer_->SetPosition(gfx::PointF()); parent_layer_->SetBounds(gfx::Size(10, 10)); parent_layer_->SetIsDrawable(true); root_layer_->AddChild(parent_layer_); child_layer_ = SolidColorLayer::Create(layer_settings()); - child_layer_->SetPosition(gfx::Point()); + child_layer_->SetPosition(gfx::PointF()); child_layer_->SetBounds(gfx::Size(10, 10)); child_layer_->SetIsDrawable(true); parent_layer_->AddChild(child_layer_); @@ -5781,18 +5781,20 @@ class LayerTreeTestMaskLayerForSurfaceWithClippedLayer : public LayerTreeTest { gfx::Size root_size(100, 100); root->SetBounds(root_size); - gfx::Rect clipping_rect(20, 10, 10, 20); - clipping_layer->SetBounds(clipping_rect.size()); - clipping_layer->SetPosition(clipping_rect.origin()); + gfx::PointF clipping_origin(20.f, 10.f); + gfx::Size clipping_size(10, 20); + clipping_layer->SetBounds(clipping_size); + clipping_layer->SetPosition(clipping_origin); clipping_layer->SetMasksToBounds(true); gfx::Size layer_size(50, 50); content_layer->SetBounds(layer_size); - content_layer->SetPosition(gfx::Point() - clipping_rect.OffsetFromOrigin()); + content_layer->SetPosition(gfx::PointF() - + clipping_origin.OffsetFromOrigin()); gfx::Size child_size(50, 50); content_child_layer->SetBounds(child_size); - content_child_layer->SetPosition(gfx::Point(20, 0)); + content_child_layer->SetPosition(gfx::PointF(20.f, 0.f)); gfx::Size mask_size(100, 100); mask_layer->SetBounds(mask_size); diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc index 06a7f76..9ca6256 100644 --- a/cc/trees/layer_tree_host_unittest_copyrequest.cc +++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc @@ -456,7 +456,7 @@ class LayerTreeHostCopyRequestTestClippedOut root_->AddChild(parent_layer_); copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_); - copy_layer_->SetPosition(gfx::Point(15, 15)); + copy_layer_->SetPosition(gfx::PointF(15.f, 15.f)); copy_layer_->SetBounds(gfx::Size(10, 10)); parent_layer_->AddChild(copy_layer_); diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc index f626b55..6d2b71b 100644 --- a/cc/trees/layer_tree_host_unittest_damage.cc +++ b/cc/trees/layer_tree_host_unittest_damage.cc @@ -245,7 +245,7 @@ class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest { child_ = FakePictureLayer::Create(layer_settings(), &client_); root_->SetBounds(gfx::Size(500, 500)); - child_->SetPosition(gfx::Point(100, 100)); + child_->SetPosition(gfx::PointF(100.f, 100.f)); child_->SetBounds(gfx::Size(30, 30)); root_->AddChild(child_); @@ -351,7 +351,7 @@ class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest { scoped_refptr<Layer> scrollbar_layer = FakePaintedScrollbarLayer::Create( layer_settings(), false, true, content_layer->id()); - scrollbar_layer->SetPosition(gfx::Point(300, 300)); + scrollbar_layer->SetPosition(gfx::PointF(300.f, 300.f)); scrollbar_layer->SetBounds(gfx::Size(10, 100)); scrollbar_layer->ToScrollbarLayer()->SetScrollLayer(content_layer->id()); root_layer->AddChild(scrollbar_layer); @@ -441,7 +441,7 @@ class LayerTreeHostDamageTestScrollbarDoesDamage Layer* root = layer_tree_host()->root_layer(); Layer* scroll_clip_layer = root->child_at(0); Layer* scroll_layer = scroll_clip_layer->child_at(0); - scroll_layer->SetPosition(gfx::Point(10, 10)); + scroll_layer->SetPosition(gfx::PointF(10.f, 10.f)); } void ResizeScrollLayer() { diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc index f5aafaf..5962fa3 100644 --- a/cc/trees/layer_tree_host_unittest_delegated.cc +++ b/cc/trees/layer_tree_host_unittest_delegated.cc @@ -612,7 +612,7 @@ class LayerTreeHostDelegatedTestLayerUsesFrameDamage // Make another layer that uses the same frame provider. The new layer // should be damaged. delegated_copy_ = CreateDelegatedLayer(frame_provider_.get()); - delegated_copy_->SetPosition(gfx::Point(5, 0)); + delegated_copy_->SetPosition(gfx::PointF(5.f, 0.f)); // Also set a new frame. SetFrameData( diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index 79fde4f..ddd3117 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -462,7 +462,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { root_scroll_layer_ = FakePictureLayer::Create(layer_settings(), &fake_content_layer_client_); root_scroll_layer_->SetBounds(gfx::Size(110, 110)); - root_scroll_layer_->SetPosition(gfx::Point()); + root_scroll_layer_->SetPosition(gfx::PointF()); root_scroll_layer_->SetIsDrawable(true); CreateVirtualViewportLayers(root_layer.get(), @@ -484,10 +484,10 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { // Scrolls on the child layer will happen at 5, 5. If they are treated // like device pixels, and device scale factor is 2, then they will // be considered at 2.5, 2.5 in logical pixels, and will miss this layer. - child_layer_->SetPosition(gfx::Point(5, 5)); + child_layer_->SetPosition(gfx::PointF(5.f, 5.f)); } else { // Adjust the child layer horizontally so that scrolls will never hit it. - child_layer_->SetPosition(gfx::Point(60, 5)); + child_layer_->SetPosition(gfx::PointF(60.f, 5.f)); } scoped_refptr<Layer> outer_container_layer = @@ -1195,7 +1195,7 @@ class LayerTreeHostScrollTestLayerStructureChange scoped_refptr<PictureLayer> scroll_layer = PictureLayer::Create(layer_settings(), &fake_content_layer_client_); scroll_layer->SetBounds(gfx::Size(110, 110)); - scroll_layer->SetPosition(gfx::Point(0, 0)); + scroll_layer->SetPosition(gfx::PointF()); scroll_layer->SetIsDrawable(true); scroll_layer->SetScrollClipLayerId(parent->id()); scroll_layer->SetBounds(gfx::Size(parent->bounds().width() + 100, diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 47c4ee0..73cb9e0 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -1640,8 +1640,8 @@ static ViewportSelectionBound ComputeViewportSelectionBound( if (!layer || layer_bound.type == SELECTION_BOUND_EMPTY) return viewport_bound; - gfx::PointF layer_top = layer_bound.edge_top; - gfx::PointF layer_bottom = layer_bound.edge_bottom; + auto layer_top = gfx::PointF(layer_bound.edge_top); + auto layer_bottom = gfx::PointF(layer_bound.edge_bottom); gfx::Transform screen_space_transform = LayerScreenSpaceTransform(layer, transform_tree, use_property_trees); diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 3c6a453..d95daca 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -69,24 +69,24 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) { ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); // Hit testing for a point outside the layer should return a null pointer. - gfx::Point test_point(101, 101); + gfx::PointF test_point(101.f, 101.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(-1, -1); + test_point = gfx::PointF(-1.f, -1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the root layer. - test_point = gfx::Point(1, 1); + test_point = gfx::PointF(1.f, 1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -128,7 +128,7 @@ TEST_F(LayerTreeImplTest, UpdateViewportAndHitTest) { gfx::Size new_bounds(50, 50); host_impl->SetViewportSize(new_bounds); - gfx::Point test_point(51, 51); + gfx::PointF test_point(51.f, 51.f); host_impl->active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_EQ( gfx::RectF(gfx::SizeF(new_bounds)), @@ -169,25 +169,25 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) { ASSERT_EQ(2u, root_layer()->render_surface()->layer_list().size()); // Hit testing for a point inside HUD, but outside root should return null - gfx::Point test_point(101, 101); + gfx::PointF test_point(101.f, 101.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(-1, -1); + test_point = gfx::PointF(-1.f, -1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the root layer, never the HUD // layer. - test_point = gfx::Point(1, 1); + test_point = gfx::PointF(1.f, 1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -225,37 +225,37 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) { // Hit testing any point should not hit the layer. If the invertible matrix is // accidentally ignored and treated like an identity, then the hit testing // will incorrectly hit the layer when it shouldn't. - gfx::Point test_point(1, 1); + gfx::PointF test_point(1.f, 1.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(10, 10); + test_point = gfx::PointF(10.f, 10.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(10, 30); + test_point = gfx::PointF(10.f, 30.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(50, 50); + test_point = gfx::PointF(50.f, 50.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(67, 48); + test_point = gfx::PointF(67.f, 48.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(-1, -1); + test_point = gfx::PointF(-1.f, -1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); @@ -284,26 +284,26 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) { ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); // Hit testing for a point outside the layer should return a null pointer. - gfx::Point test_point(49, 49); + gfx::PointF test_point(49.f, 49.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Even though the layer exists at (101, 101), it should not be visible there // since the root render surface would clamp it. - test_point = gfx::Point(101, 101); + test_point = gfx::PointF(101.f, 101.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the root layer. - test_point = gfx::Point(51, 51); + test_point = gfx::PointF(51.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -338,18 +338,18 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) { // Hit testing for points outside the layer. // These corners would have been inside the un-transformed layer, but they // should not hit the correctly transformed layer. - gfx::Point test_point(99, 99); + gfx::PointF test_point(99.f, 99.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(1, 1); + test_point = gfx::PointF(1.f, 1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the root layer. - test_point = gfx::Point(1, 50); + test_point = gfx::PointF(1.f, 50.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -357,12 +357,12 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) { // Hit testing the corners that would overlap the unclipped layer, but are // outside the clipped region. - test_point = gfx::Point(50, -1); + test_point = gfx::PointF(50.f, -1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_FALSE(result_layer); - test_point = gfx::Point(-1, 50); + test_point = gfx::PointF(-1.f, 50.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_FALSE(result_layer); @@ -402,24 +402,24 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) { // Hit testing for points outside the layer. // These corners would have been inside the un-transformed layer, but they // should not hit the correctly transformed layer. - gfx::Point test_point(24, 24); + gfx::PointF test_point(24.f, 24.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(76, 76); + test_point = gfx::PointF(76.f, 76.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the root layer. - test_point = gfx::Point(26, 26); + test_point = gfx::PointF(26.f, 26.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(74, 74); + test_point = gfx::PointF(74.f, 74.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -472,26 +472,26 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) { // Hit testing for a point outside the layer should return a null pointer. // Despite the child layer being very large, it should be clipped to the root // layer's bounds. - gfx::Point test_point(24, 24); + gfx::PointF test_point(24.f, 24.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Even though the layer exists at (101, 101), it should not be visible there // since the clipping_layer would clamp it. - test_point = gfx::Point(76, 76); + test_point = gfx::PointF(76.f, 76.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the child layer. - test_point = gfx::Point(26, 26); + test_point = gfx::PointF(26.f, 26.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(456, result_layer->id()); - test_point = gfx::Point(74, 74); + test_point = gfx::PointF(74.f, 74.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -573,13 +573,13 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { // (11, 89) is close to the the bottom left corner within the clip, but it is // not inside the layer. - gfx::Point test_point(11, 89); + gfx::PointF test_point(11.f, 89.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Closer inwards from the bottom left will overlap the layer. - test_point = gfx::Point(25, 75); + test_point = gfx::PointF(25.f, 75.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -590,13 +590,13 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { // blindly uses visible content rect without considering how parent may clip // the layer, then hit testing would accidentally think that the point // successfully hits the layer. - test_point = gfx::Point(4, 50); + test_point = gfx::PointF(4.f, 50.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // (11, 50) is inside the layer and within the clipped area. - test_point = gfx::Point(11, 50); + test_point = gfx::PointF(11.f, 50.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -604,14 +604,14 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { // Around the middle, just to the right and up, would have hit the layer // except that that area should be clipped away by the parent. - test_point = gfx::Point(51, 49); + test_point = gfx::PointF(51.f, 49.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Around the middle, just to the left and down, should successfully hit the // layer. - test_point = gfx::Point(49, 51); + test_point = gfx::PointF(49.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -666,24 +666,24 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { ASSERT_EQ(456, root_layer()->render_surface()->layer_list().at(0)->id()); // Hit testing for a point outside the layer should return a null pointer. - gfx::Point test_point(69, 69); + gfx::PointF test_point(69.f, 69.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(91, 91); + test_point = gfx::PointF(91.f, 91.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); EXPECT_FALSE(result_layer); // Hit testing for a point inside should return the child layer. - test_point = gfx::Point(71, 71); + test_point = gfx::PointF(71.f, 71.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(456, result_layer->id()); - test_point = gfx::Point(89, 89); + test_point = gfx::PointF(89.f, 89.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -766,7 +766,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { // Nothing overlaps the root_layer at (1, 1), so hit testing there should find // the root layer. - gfx::Point test_point = gfx::Point(1, 1); + gfx::PointF test_point = gfx::PointF(1.f, 1.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -774,14 +774,14 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { // At (15, 15), child1 and root are the only layers. child1 is expected to be // on top. - test_point = gfx::Point(15, 15); + test_point = gfx::PointF(15.f, 15.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(2, result_layer->id()); // At (51, 20), child1 and child2 overlap. child2 is expected to be on top. - test_point = gfx::Point(51, 20); + test_point = gfx::PointF(51.f, 20.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -789,7 +789,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { // At (80, 51), child2 and grand_child1 overlap. child2 is expected to be on // top. - test_point = gfx::Point(80, 51); + test_point = gfx::PointF(80.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -797,7 +797,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { // At (51, 51), all layers overlap each other. child2 is expected to be on top // of all other layers. - test_point = gfx::Point(51, 51); + test_point = gfx::PointF(51.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -805,7 +805,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { // At (20, 51), child1 and grand_child1 overlap. grand_child1 is expected to // be on top. - test_point = gfx::Point(20, 51); + test_point = gfx::PointF(20.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -889,7 +889,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // Nothing overlaps the root_layer at (1, 1), so hit testing there should find // the root layer. - gfx::Point test_point = gfx::Point(1, 1); + gfx::PointF test_point = gfx::PointF(1.f, 1.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -897,7 +897,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // At (15, 15), child1 and root are the only layers. child1 is expected to be // on top. - test_point = gfx::Point(15, 15); + test_point = gfx::PointF(15.f, 15.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -905,7 +905,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // At (51, 20), child1 and child2 overlap. child2 is expected to be on top. // (because 3 is transformed to the back). - test_point = gfx::Point(51, 20); + test_point = gfx::PointF(51.f, 20.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -913,7 +913,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // 3 Would have been on top if it hadn't been transformed to the background. // Make sure that it isn't hit. - test_point = gfx::Point(80, 51); + test_point = gfx::PointF(80.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -921,7 +921,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // 3 Would have been on top if it hadn't been transformed to the background. // Make sure that it isn't hit. - test_point = gfx::Point(51, 51); + test_point = gfx::PointF(51.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -929,7 +929,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // At (20, 51), child1 and grand_child1 overlap. grand_child1 is expected to // be on top. - test_point = gfx::Point(20, 51); + test_point = gfx::PointF(20.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -977,7 +977,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); - gfx::Point test_point = gfx::Point(12, 52); + gfx::PointF test_point(12.f, 52.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -1037,7 +1037,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); - gfx::Point test_point = gfx::Point(12, 52); + gfx::PointF test_point(12.f, 52.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); // The |test_point| should have been clipped away by |child|, the scroll @@ -1135,7 +1135,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { // Nothing overlaps the root_layer at (1, 1), so hit testing there should find // the root layer. - gfx::Point test_point = gfx::Point(1, 1); + gfx::PointF test_point(1.f, 1.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -1143,14 +1143,14 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { // At (15, 15), child1 and root are the only layers. child1 is expected to be // on top. - test_point = gfx::Point(15, 15); + test_point = gfx::PointF(15.f, 15.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(2, result_layer->id()); // At (51, 20), child1 and child2 overlap. child2 is expected to be on top. - test_point = gfx::Point(51, 20); + test_point = gfx::PointF(51.f, 20.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -1158,7 +1158,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { // At (80, 51), child2 and grand_child1 overlap. child2 is expected to be on // top. - test_point = gfx::Point(80, 51); + test_point = gfx::PointF(80.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -1166,7 +1166,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { // At (51, 51), all layers overlap each other. child2 is expected to be on top // of all other layers. - test_point = gfx::Point(51, 51); + test_point = gfx::PointF(51.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -1174,7 +1174,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { // At (20, 51), child1 and grand_child1 overlap. grand_child1 is expected to // be on top. - test_point = gfx::Point(20, 51); + test_point = gfx::PointF(20.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); ASSERT_TRUE(result_layer); @@ -1204,7 +1204,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { // Hit checking for any point should return a null pointer for a layer without // any touch event handler regions. - gfx::Point test_point(11, 11); + gfx::PointF test_point(11.f, 11.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1213,13 +1213,13 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { host_impl().active_tree()->root_layer()->SetTouchEventHandlerRegion( touch_handler_region); // Hit checking for a point outside the layer should return a null pointer. - test_point = gfx::Point(101, 101); + test_point = gfx::PointF(101.f, 101.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(-1, -1); + test_point = gfx::PointF(-1.f, -1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1227,13 +1227,13 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { // Hit checking for a point inside the layer, but outside the touch handler // region should return a null pointer. - test_point = gfx::Point(1, 1); + test_point = gfx::PointF(1.f, 1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1241,14 +1241,14 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { // Hit checking for a point inside the touch event handler region should // return the root layer. - test_point = gfx::Point(11, 11); + test_point = gfx::PointF(11.f, 11.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(59, 59); + test_point = gfx::PointF(59.f, 59.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1292,43 +1292,43 @@ TEST_F(LayerTreeImplTest, // layer. If the invertible matrix is accidentally ignored and treated like an // identity, then the hit testing will incorrectly hit the layer when it // shouldn't. - gfx::Point test_point(1, 1); + gfx::PointF test_point(1.f, 1.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(10, 10); + test_point = gfx::PointF(10.f, 10.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(10, 30); + test_point = gfx::PointF(10.f, 30.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(50, 50); + test_point = gfx::PointF(50.f, 50.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(67, 48); + test_point = gfx::PointF(67.f, 48.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(-1, -1); + test_point = gfx::PointF(-1.f, -1.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1361,7 +1361,7 @@ TEST_F(LayerTreeImplTest, ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); // Hit checking for a point outside the layer should return a null pointer. - gfx::Point test_point(49, 49); + gfx::PointF test_point(49.f, 49.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1369,7 +1369,7 @@ TEST_F(LayerTreeImplTest, // Even though the layer has a touch handler region containing (101, 101), it // should not be visible there since the root render surface would clamp it. - test_point = gfx::Point(101, 101); + test_point = gfx::PointF(101.f, 101.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1377,7 +1377,7 @@ TEST_F(LayerTreeImplTest, // Hit checking for a point inside the layer, but outside the touch handler // region should return a null pointer. - test_point = gfx::Point(51, 51); + test_point = gfx::PointF(51.f, 51.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1385,14 +1385,14 @@ TEST_F(LayerTreeImplTest, // Hit checking for a point inside the touch event handler region should // return the root layer. - test_point = gfx::Point(61, 61); + test_point = gfx::PointF(61.f, 61.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(99, 99); + test_point = gfx::PointF(99.f, 99.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1468,7 +1468,7 @@ TEST_F(LayerTreeImplTest, // Hit checking for a point inside the layer, but outside the touch handler // region should return a null pointer. - test_point = gfx::Point(26, 26); + test_point = gfx::PointF(26.f, 26.f); test_point = gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); result_layer = @@ -1476,7 +1476,7 @@ TEST_F(LayerTreeImplTest, test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(34, 34); + test_point = gfx::PointF(34.f, 34.f); test_point = gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); result_layer = @@ -1484,7 +1484,7 @@ TEST_F(LayerTreeImplTest, test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(65, 65); + test_point = gfx::PointF(65.f, 65.f); test_point = gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); result_layer = @@ -1492,7 +1492,7 @@ TEST_F(LayerTreeImplTest, test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(74, 74); + test_point = gfx::PointF(74.f, 74.f); test_point = gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); result_layer = @@ -1502,7 +1502,7 @@ TEST_F(LayerTreeImplTest, // Hit checking for a point inside the touch event handler region should // return the root layer. - test_point = gfx::Point(35, 35); + test_point = gfx::PointF(35.f, 35.f); test_point = gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); result_layer = @@ -1511,7 +1511,7 @@ TEST_F(LayerTreeImplTest, ASSERT_TRUE(result_layer); EXPECT_EQ(12345, result_layer->id()); - test_point = gfx::Point(64, 64); + test_point = gfx::PointF(64.f, 64.f); test_point = gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); result_layer = @@ -1594,7 +1594,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { // Hit checking for a point outside the layer should return a null pointer. // Despite the child layer being very large, it should be clipped to the root // layer's bounds. - gfx::Point test_point(24, 24); + gfx::PointF test_point(24.f, 24.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1602,13 +1602,13 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { // Hit checking for a point inside the layer, but outside the touch handler // region should return a null pointer. - test_point = gfx::Point(35, 35); + test_point = gfx::PointF(35.f, 35.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); EXPECT_FALSE(result_layer); - test_point = gfx::Point(74, 74); + test_point = gfx::PointF(74.f, 74.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1616,14 +1616,14 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { // Hit checking for a point inside the touch event handler region should // return the root layer. - test_point = gfx::Point(25, 25); + test_point = gfx::PointF(25.f, 25.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(456, result_layer->id()); - test_point = gfx::Point(34, 34); + test_point = gfx::PointF(34.f, 34.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1678,7 +1678,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { ASSERT_EQ(123, root_layer()->render_surface()->layer_list().at(0)->id()); ASSERT_EQ(1234, root_layer()->render_surface()->layer_list().at(1)->id()); - gfx::Point test_point(35, 35); + gfx::PointF test_point(35.f, 35.f); LayerImpl* result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1698,14 +1698,14 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { // opaque to hit testing). EXPECT_TRUE(result_layer); - test_point = gfx::Point(35, 15); + test_point = gfx::PointF(35.f, 15.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); ASSERT_TRUE(result_layer); EXPECT_EQ(123, result_layer->id()); - test_point = gfx::Point(35, 65); + test_point = gfx::PointF(35.f, 65.f); result_layer = host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( test_point); @@ -1809,13 +1809,13 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { LayerSelection input; input.start.type = SELECTION_BOUND_LEFT; - input.start.edge_top = gfx::PointF(10, 10); - input.start.edge_bottom = gfx::PointF(10, 20); + input.start.edge_top = gfx::Point(10, 10); + input.start.edge_bottom = gfx::Point(10, 20); input.start.layer_id = root_layer_id; input.end.type = SELECTION_BOUND_RIGHT; - input.end.edge_top = gfx::PointF(50, 10); - input.end.edge_bottom = gfx::PointF(50, 30); + input.end.edge_top = gfx::Point(50, 10); + input.end.edge_bottom = gfx::Point(50, 30); input.end.layer_id = root_layer_id; ViewportSelection output; @@ -1829,12 +1829,12 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { host_impl().active_tree()->RegisterSelection(input); host_impl().active_tree()->GetViewportSelection(&output); EXPECT_EQ(input.start.type, output.start.type); - EXPECT_EQ(input.start.edge_bottom, output.start.edge_bottom); - EXPECT_EQ(input.start.edge_top, output.start.edge_top); + EXPECT_EQ(gfx::PointF(input.start.edge_bottom), output.start.edge_bottom); + EXPECT_EQ(gfx::PointF(input.start.edge_top), output.start.edge_top); EXPECT_TRUE(output.start.visible); EXPECT_EQ(input.end.type, output.end.type); - EXPECT_EQ(input.end.edge_bottom, output.end.edge_bottom); - EXPECT_EQ(input.end.edge_top, output.end.edge_top); + EXPECT_EQ(gfx::PointF(input.end.edge_bottom), output.end.edge_bottom); + EXPECT_EQ(gfx::PointF(input.end.edge_top), output.end.edge_top); EXPECT_TRUE(output.end.visible); EXPECT_EQ(input.is_editable, output.is_editable); EXPECT_EQ(input.is_empty_text_form_control, @@ -1843,8 +1843,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { // Insertion bounds should produce identical left and right bounds. LayerSelection insertion_input; insertion_input.start.type = SELECTION_BOUND_CENTER; - insertion_input.start.edge_top = gfx::PointF(15, 10); - insertion_input.start.edge_bottom = gfx::PointF(15, 30); + insertion_input.start.edge_top = gfx::Point(15, 10); + insertion_input.start.edge_bottom = gfx::Point(15, 30); insertion_input.start.layer_id = root_layer_id; insertion_input.is_editable = true; insertion_input.is_empty_text_form_control = true; @@ -1852,8 +1852,9 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { host_impl().active_tree()->RegisterSelection(insertion_input); host_impl().active_tree()->GetViewportSelection(&output); EXPECT_EQ(insertion_input.start.type, output.start.type); - EXPECT_EQ(insertion_input.start.edge_bottom, output.start.edge_bottom); - EXPECT_EQ(insertion_input.start.edge_top, output.start.edge_top); + EXPECT_EQ(gfx::PointF(insertion_input.start.edge_bottom), + output.start.edge_bottom); + EXPECT_EQ(gfx::PointF(insertion_input.start.edge_top), output.start.edge_top); EXPECT_EQ(insertion_input.is_editable, output.is_editable); EXPECT_EQ(insertion_input.is_empty_text_form_control, output.is_empty_text_form_control); @@ -1909,13 +1910,13 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { LayerSelection input; input.start.type = SELECTION_BOUND_LEFT; - input.start.edge_top = gfx::PointF(25, 10); - input.start.edge_bottom = gfx::PointF(25, 30); + input.start.edge_top = gfx::Point(25, 10); + input.start.edge_bottom = gfx::Point(25, 30); input.start.layer_id = clipped_layer_id; input.end.type = SELECTION_BOUND_RIGHT; - input.end.edge_top = gfx::PointF(75, 10); - input.end.edge_bottom = gfx::PointF(75, 30); + input.end.edge_top = gfx::Point(75, 10); + input.end.edge_bottom = gfx::Point(75, 30); input.end.layer_id = clipped_layer_id; host_impl().active_tree()->RegisterSelection(input); @@ -1923,16 +1924,16 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { ViewportSelection output; host_impl().active_tree()->GetViewportSelection(&output); EXPECT_EQ(input.start.type, output.start.type); - gfx::PointF expected_output_start_top = input.start.edge_top; - gfx::PointF expected_output_edge_botom = input.start.edge_bottom; + auto expected_output_start_top = gfx::PointF(input.start.edge_top); + auto expected_output_edge_botom = gfx::PointF(input.start.edge_bottom); expected_output_start_top.Offset(clipping_offset.x(), clipping_offset.y()); expected_output_edge_botom.Offset(clipping_offset.x(), clipping_offset.y()); EXPECT_EQ(expected_output_start_top, output.start.edge_top); EXPECT_EQ(expected_output_edge_botom, output.start.edge_bottom); EXPECT_TRUE(output.start.visible); EXPECT_EQ(input.end.type, output.end.type); - gfx::PointF expected_output_end_top = input.end.edge_top; - gfx::PointF expected_output_end_bottom = input.end.edge_bottom; + auto expected_output_end_top = gfx::PointF(input.end.edge_top); + auto expected_output_end_bottom = gfx::PointF(input.end.edge_bottom); expected_output_end_bottom.Offset(clipping_offset.x(), clipping_offset.y()); expected_output_end_top.Offset(clipping_offset.x(), clipping_offset.y()); EXPECT_EQ(expected_output_end_top, output.end.edge_top); @@ -1940,21 +1941,21 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { EXPECT_FALSE(output.end.visible); // Handles outside the viewport bounds should be marked invisible. - input.start.edge_top = gfx::PointF(-25, 0); - input.start.edge_bottom = gfx::PointF(-25, 20); + input.start.edge_top = gfx::Point(-25, 0); + input.start.edge_bottom = gfx::Point(-25, 20); host_impl().active_tree()->RegisterSelection(input); host_impl().active_tree()->GetViewportSelection(&output); EXPECT_FALSE(output.start.visible); - input.start.edge_top = gfx::PointF(0, -25); - input.start.edge_bottom = gfx::PointF(0, -5); + input.start.edge_top = gfx::Point(0, -25); + input.start.edge_bottom = gfx::Point(0, -5); host_impl().active_tree()->RegisterSelection(input); host_impl().active_tree()->GetViewportSelection(&output); EXPECT_FALSE(output.start.visible); // If the handle bottom is partially visible, the handle is marked visible. - input.start.edge_top = gfx::PointF(0, -20); - input.start.edge_bottom = gfx::PointF(0, 1); + input.start.edge_top = gfx::Point(0, -20); + input.start.edge_bottom = gfx::Point(0, 1); host_impl().active_tree()->RegisterSelection(input); host_impl().active_tree()->GetViewportSelection(&output); EXPECT_TRUE(output.start.visible); @@ -2007,13 +2008,13 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { LayerSelection input; input.start.type = SELECTION_BOUND_LEFT; - input.start.edge_top = gfx::PointF(10, 10); - input.start.edge_bottom = gfx::PointF(10, 30); + input.start.edge_top = gfx::Point(10, 10); + input.start.edge_bottom = gfx::Point(10, 30); input.start.layer_id = root_layer_id; input.end.type = SELECTION_BOUND_RIGHT; - input.end.edge_top = gfx::PointF(0, 0); - input.end.edge_bottom = gfx::PointF(0, 20); + input.end.edge_top = gfx::Point(0, 0); + input.end.edge_bottom = gfx::Point(0, 20); input.end.layer_id = sub_layer_id; host_impl().active_tree()->RegisterSelection(input); @@ -2022,8 +2023,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { ViewportSelection output; host_impl().active_tree()->GetViewportSelection(&output); EXPECT_EQ(input.start.type, output.start.type); - gfx::PointF expected_output_start_top = input.start.edge_top; - gfx::PointF expected_output_edge_bottom = input.start.edge_bottom; + auto expected_output_start_top = gfx::PointF(input.start.edge_top); + auto expected_output_edge_bottom = gfx::PointF(input.start.edge_bottom); expected_output_start_top.Scale(page_scale_factor); expected_output_edge_bottom.Scale(page_scale_factor); EXPECT_EQ(expected_output_start_top, output.start.edge_top); @@ -2031,8 +2032,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { EXPECT_TRUE(output.start.visible); EXPECT_EQ(input.end.type, output.end.type); - gfx::PointF expected_output_end_top = input.end.edge_top; - gfx::PointF expected_output_end_bottom = input.end.edge_bottom; + auto expected_output_end_top = gfx::PointF(input.end.edge_top); + auto expected_output_end_bottom = gfx::PointF(input.end.edge_bottom); expected_output_end_top.Offset(sub_layer_offset.x(), sub_layer_offset.y()); expected_output_end_bottom.Offset(sub_layer_offset.x(), sub_layer_offset.y()); expected_output_end_top.Scale(page_scale_factor); @@ -2085,13 +2086,13 @@ TEST_F(LayerTreeImplTest, SelectionBoundsWithLargeTransforms) { LayerSelection input; input.start.type = SELECTION_BOUND_LEFT; - input.start.edge_top = gfx::PointF(10, 10); - input.start.edge_bottom = gfx::PointF(10, 20); + input.start.edge_top = gfx::Point(10, 10); + input.start.edge_bottom = gfx::Point(10, 20); input.start.layer_id = grand_child_id; input.end.type = SELECTION_BOUND_RIGHT; - input.end.edge_top = gfx::PointF(50, 10); - input.end.edge_bottom = gfx::PointF(50, 30); + input.end.edge_top = gfx::Point(50, 10); + input.end.edge_bottom = gfx::Point(50, 30); input.end.layer_id = grand_child_id; host_impl().active_tree()->RegisterSelection(input); diff --git a/cc/trees/occlusion_tracker_perftest.cc b/cc/trees/occlusion_tracker_perftest.cc index d29765a..5472bba 100644 --- a/cc/trees/occlusion_tracker_perftest.cc +++ b/cc/trees/occlusion_tracker_perftest.cc @@ -160,7 +160,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_10OpaqueLayers) { opaque_layer->SetDrawsContent(true); opaque_layer->SetBounds( gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2)); - opaque_layer->SetPosition(gfx::Point(i, i)); + opaque_layer->SetPosition(gfx::PointF(i, i)); active_tree()->root_layer()->AddChild(opaque_layer.Pass()); } diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index 88779d0..dd3c028 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -375,7 +375,7 @@ class OcclusionTrackerTestRotatedChild : public OcclusionTrackerTest { layer_transform.Translate(-250.0, -250.0); TestContentLayerImpl* root = this->CreateRoot( - this->identity_matrix, gfx::Point(0, 0), gfx::Size(200, 200)); + this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); TestContentLayerImpl* parent = this->CreateDrawingLayer( root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); TestContentLayerImpl* layer = this->CreateDrawingLayer( @@ -1476,7 +1476,7 @@ class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter } LayerImpl* occluding_layer = this->CreateDrawingLayer( - parent, this->identity_matrix, occlusion_rect.origin(), + parent, this->identity_matrix, gfx::PointF(occlusion_rect.origin()), occlusion_rect.size(), true); this->CalcDrawEtc(parent); @@ -2005,11 +2005,12 @@ class OcclusionTrackerTestCopyRequestDoesOcclude : public OcclusionTrackerTest { : OcclusionTrackerTest(opaque_layers) {} void RunMyTest() override { TestContentLayerImpl* root = this->CreateRoot( - this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); + this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); TestContentLayerImpl* parent = this->CreateDrawingLayer( - root, this->identity_matrix, gfx::Point(), gfx::Size(400, 400), true); - LayerImpl* copy = this->CreateLayer( - parent, this->identity_matrix, gfx::Point(100, 0), gfx::Size(200, 400)); + root, this->identity_matrix, gfx::PointF(), gfx::Size(400, 400), true); + LayerImpl* copy = + this->CreateLayer(parent, this->identity_matrix, gfx::PointF(100, 0), + gfx::Size(200, 400)); this->AddCopyRequest(copy); LayerImpl* copy_child = this->CreateDrawingLayer( copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); @@ -2054,13 +2055,14 @@ class OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude : OcclusionTrackerTest(opaque_layers) {} void RunMyTest() override { TestContentLayerImpl* root = this->CreateRoot( - this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); + this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); TestContentLayerImpl* parent = this->CreateDrawingLayer( - root, this->identity_matrix, gfx::Point(), gfx::Size(400, 400), true); + root, this->identity_matrix, gfx::PointF(), gfx::Size(400, 400), true); LayerImpl* hide = this->CreateLayer(parent, this->identity_matrix, - gfx::Point(), gfx::Size()); - LayerImpl* copy = this->CreateLayer( - hide, this->identity_matrix, gfx::Point(100, 0), gfx::Size(200, 400)); + gfx::PointF(), gfx::Size()); + LayerImpl* copy = + this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), + gfx::Size(200, 400)); this->AddCopyRequest(copy); LayerImpl* copy_child = this->CreateDrawingLayer( copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); @@ -2100,13 +2102,13 @@ class OcclusionTrackerTestOccludedLayer : public OcclusionTrackerTest { gfx::Transform translate; translate.Translate(10.0, 20.0); TestContentLayerImpl* root = this->CreateRoot( - this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); - LayerImpl* surface = this->CreateSurface(root, this->identity_matrix, - gfx::Point(), gfx::Size(200, 200)); + this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); + LayerImpl* surface = this->CreateSurface( + root, this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); LayerImpl* layer = this->CreateDrawingLayer( - surface, translate, gfx::Point(), gfx::Size(200, 200), false); + surface, translate, gfx::PointF(), gfx::Size(200, 200), false); TestContentLayerImpl* outside_layer = this->CreateDrawingLayer( - root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); + root, this->identity_matrix, gfx::PointF(), gfx::Size(200, 200), false); this->CalcDrawEtc(root); TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 200, 200)); @@ -2188,13 +2190,13 @@ class OcclusionTrackerTestUnoccludedLayerQuery : public OcclusionTrackerTest { gfx::Transform translate; translate.Translate(10.0, 20.0); TestContentLayerImpl* root = this->CreateRoot( - this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); - LayerImpl* surface = this->CreateSurface(root, this->identity_matrix, - gfx::Point(), gfx::Size(200, 200)); + this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); + LayerImpl* surface = this->CreateSurface( + root, this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); LayerImpl* layer = this->CreateDrawingLayer( - surface, translate, gfx::Point(), gfx::Size(200, 200), false); + surface, translate, gfx::PointF(), gfx::Size(200, 200), false); TestContentLayerImpl* outside_layer = this->CreateDrawingLayer( - root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); + root, this->identity_matrix, gfx::PointF(), gfx::Size(200, 200), false); this->CalcDrawEtc(root); TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 200, 200)); @@ -2351,14 +2353,14 @@ class OcclusionTrackerTestUnoccludedSurfaceQuery : public OcclusionTrackerTest { gfx::Transform translate; translate.Translate(10.0, 20.0); TestContentLayerImpl* root = this->CreateRoot( - this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); - LayerImpl* surface = - this->CreateSurface(root, translate, gfx::Point(), gfx::Size(200, 200)); + this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); + LayerImpl* surface = this->CreateSurface(root, translate, gfx::PointF(), + gfx::Size(200, 200)); LayerImpl* layer = - this->CreateDrawingLayer(surface, this->identity_matrix, gfx::Point(), + this->CreateDrawingLayer(surface, this->identity_matrix, gfx::PointF(), gfx::Size(200, 200), false); TestContentLayerImpl* outside_layer = this->CreateDrawingLayer( - root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); + root, this->identity_matrix, gfx::PointF(), gfx::Size(200, 200), false); this->CalcDrawEtc(root); TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 200, 200)); |