diff options
author | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-16 17:54:41 +0000 |
---|---|---|
committer | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-16 17:54:41 +0000 |
commit | ebb179b6167fc95ce8c47b0277fbe1818d449d4d (patch) | |
tree | c1cbb8ac34c1819a265355fa412b6b07611cdfd4 /cc/trees | |
parent | 219643ffa4b91d8bcf5e50d575b656b9431d4feb (diff) | |
download | chromium_src-ebb179b6167fc95ce8c47b0277fbe1818d449d4d.zip chromium_src-ebb179b6167fc95ce8c47b0277fbe1818d449d4d.tar.gz chromium_src-ebb179b6167fc95ce8c47b0277fbe1818d449d4d.tar.bz2 |
Rename composited selection anchor/focus to start/end
Maintain naming consistency with Blink wherein selection start and end indicate
proper and consistent ordering in the document.
BUG=279489
Review URL: https://codereview.chromium.org/379473002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees')
-rw-r--r-- | cc/trees/layer_tree_host.cc | 12 | ||||
-rw-r--r-- | cc/trees/layer_tree_host.h | 8 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 44 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl.cc | 36 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl.h | 12 |
6 files changed, 58 insertions, 58 deletions
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 3618a4b..770c395 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -322,7 +322,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { sync_tree->ClearViewportLayers(); } - sync_tree->RegisterSelection(selection_anchor_, selection_focus_); + sync_tree->RegisterSelection(selection_start_, selection_end_); float page_scale_delta = sync_tree->page_scale_delta() / sync_tree->sent_page_scale_delta(); @@ -1239,13 +1239,13 @@ void LayerTreeHost::RegisterViewportLayers( outer_viewport_scroll_layer_ = outer_viewport_scroll_layer; } -void LayerTreeHost::RegisterSelection(const LayerSelectionBound& anchor, - const LayerSelectionBound& focus) { - if (selection_anchor_ == anchor && selection_focus_ == focus) +void LayerTreeHost::RegisterSelection(const LayerSelectionBound& start, + const LayerSelectionBound& end) { + if (selection_start_ == start && selection_end_ == end) return; - selection_anchor_ = anchor; - selection_focus_ = focus; + selection_start_ = start; + selection_end_ = end; SetNeedsCommit(); } diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 1e977c3..d53140e 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -179,8 +179,8 @@ class CC_EXPORT LayerTreeHost { return outer_viewport_scroll_layer_.get(); } - void RegisterSelection(const LayerSelectionBound& anchor, - const LayerSelectionBound& focus); + void RegisterSelection(const LayerSelectionBound& start, + const LayerSelectionBound& end); const LayerTreeSettings& settings() const { return settings_; } @@ -443,8 +443,8 @@ class CC_EXPORT LayerTreeHost { scoped_refptr<Layer> inner_viewport_scroll_layer_; scoped_refptr<Layer> outer_viewport_scroll_layer_; - LayerSelectionBound selection_anchor_; - LayerSelectionBound selection_focus_; + LayerSelectionBound selection_start_; + LayerSelectionBound selection_end_; SharedBitmapManager* shared_bitmap_manager_; diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 539eac4..f3cf156 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1419,8 +1419,8 @@ CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { metadata.overdraw_bottom_height = overdraw_bottom_height_; } - active_tree_->GetViewportSelection(&metadata.selection_anchor, - &metadata.selection_focus); + active_tree_->GetViewportSelection(&metadata.selection_start, + &metadata.selection_end); if (!InnerViewportScrollLayer()) return metadata; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index d9d3d57..e6f443a 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -6336,21 +6336,21 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) { // Ensure the default frame selection bounds are empty. FakeOutputSurface* fake_output_surface = static_cast<FakeOutputSurface*>(host_impl_->output_surface()); - const ViewportSelectionBound& selection_anchor_before = - fake_output_surface->last_sent_frame().metadata.selection_anchor; - const ViewportSelectionBound& selection_focus_before = - fake_output_surface->last_sent_frame().metadata.selection_focus; - EXPECT_EQ(ViewportSelectionBound(), selection_anchor_before); - EXPECT_EQ(ViewportSelectionBound(), selection_focus_before); + const ViewportSelectionBound& selection_start_before = + fake_output_surface->last_sent_frame().metadata.selection_start; + const ViewportSelectionBound& selection_end_before = + fake_output_surface->last_sent_frame().metadata.selection_end; + EXPECT_EQ(ViewportSelectionBound(), selection_start_before); + EXPECT_EQ(ViewportSelectionBound(), selection_end_before); // Plumb the layer-local selection bounds. gfx::Rect selection_rect(5, 0, 0, 5); - LayerSelectionBound anchor, focus; - anchor.type = SELECTION_BOUND_CENTER; - anchor.layer_id = root_layer_id; - anchor.layer_rect = selection_rect; - focus = anchor; - host_impl_->active_tree()->RegisterSelection(anchor, focus); + LayerSelectionBound start, end; + start.type = SELECTION_BOUND_CENTER; + start.layer_id = root_layer_id; + start.layer_rect = selection_rect; + end = start; + host_impl_->active_tree()->RegisterSelection(start, end); // Trigger a draw-swap sequence. host_impl_->SetNeedsRedraw(); @@ -6363,16 +6363,16 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) { EXPECT_TRUE(host_impl_->SwapBuffers(frame)); // Ensure the selection bounds have propagated to the frame metadata. - const ViewportSelectionBound& selection_anchor_after = - fake_output_surface->last_sent_frame().metadata.selection_anchor; - const ViewportSelectionBound& selection_focus_after = - fake_output_surface->last_sent_frame().metadata.selection_focus; - EXPECT_EQ(anchor.type, selection_anchor_after.type); - EXPECT_EQ(focus.type, selection_focus_after.type); - EXPECT_EQ(selection_rect, selection_anchor_after.viewport_rect); - EXPECT_EQ(selection_rect, selection_anchor_after.viewport_rect); - EXPECT_TRUE(selection_anchor_after.visible); - EXPECT_TRUE(selection_anchor_after.visible); + const ViewportSelectionBound& selection_start_after = + fake_output_surface->last_sent_frame().metadata.selection_start; + const ViewportSelectionBound& selection_end_after = + fake_output_surface->last_sent_frame().metadata.selection_end; + EXPECT_EQ(start.type, selection_start_after.type); + EXPECT_EQ(end.type, selection_end_after.type); + EXPECT_EQ(selection_rect, selection_start_after.viewport_rect); + EXPECT_EQ(selection_rect, selection_start_after.viewport_rect); + EXPECT_TRUE(selection_start_after.visible); + EXPECT_TRUE(selection_start_after.visible); } class SimpleSwapPromiseMonitor : public SwapPromiseMonitor { diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index bf0a996..392e80b 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -211,7 +211,7 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { target_tree->ClearViewportLayers(); } - target_tree->RegisterSelection(selection_anchor_, selection_focus_); + target_tree->RegisterSelection(selection_start_, selection_end_); // This should match the property synchronization in // LayerTreeHost::finishCommitOnImplThread(). @@ -1315,10 +1315,10 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( return data_for_recursion.closest_match; } -void LayerTreeImpl::RegisterSelection(const LayerSelectionBound& anchor, - const LayerSelectionBound& focus) { - selection_anchor_ = anchor; - selection_focus_ = focus; +void LayerTreeImpl::RegisterSelection(const LayerSelectionBound& start, + const LayerSelectionBound& end) { + selection_start_ = start; + selection_end_ = end; } static ViewportSelectionBound ComputeViewportSelection( @@ -1349,22 +1349,22 @@ static ViewportSelectionBound ComputeViewportSelection( return result; } -void LayerTreeImpl::GetViewportSelection(ViewportSelectionBound* anchor, - ViewportSelectionBound* focus) { - DCHECK(anchor); - DCHECK(focus); +void LayerTreeImpl::GetViewportSelection(ViewportSelectionBound* start, + ViewportSelectionBound* end) { + DCHECK(start); + DCHECK(end); - *anchor = ComputeViewportSelection( - selection_anchor_, - selection_anchor_.layer_id ? LayerById(selection_anchor_.layer_id) : NULL, + *start = ComputeViewportSelection( + selection_start_, + selection_start_.layer_id ? LayerById(selection_start_.layer_id) : NULL, device_scale_factor()); - if (anchor->type == SELECTION_BOUND_CENTER || - anchor->type == SELECTION_BOUND_EMPTY) { - *focus = *anchor; + if (start->type == SELECTION_BOUND_CENTER || + start->type == SELECTION_BOUND_EMPTY) { + *end = *start; } else { - *focus = ComputeViewportSelection( - selection_focus_, - selection_focus_.layer_id ? LayerById(selection_focus_.layer_id) : NULL, + *end = ComputeViewportSelection( + selection_end_, + selection_end_.layer_id ? LayerById(selection_end_.layer_id) : NULL, device_scale_factor()); } } diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 13746c3..48c6f47 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h @@ -267,13 +267,13 @@ class CC_EXPORT LayerTreeImpl { LayerImpl* FindLayerThatIsHitByPointInTouchHandlerRegion( const gfx::PointF& screen_space_point); - void RegisterSelection(const LayerSelectionBound& anchor, - const LayerSelectionBound& focus); + void RegisterSelection(const LayerSelectionBound& start, + const LayerSelectionBound& end); // Compute the current selection handle location and visbility with respect to // the viewport. - void GetViewportSelection(ViewportSelectionBound* anchor, - ViewportSelectionBound* focus); + void GetViewportSelection(ViewportSelectionBound* start, + ViewportSelectionBound* end); void RegisterPictureLayerImpl(PictureLayerImpl* layer); void UnregisterPictureLayerImpl(PictureLayerImpl* layer); @@ -299,8 +299,8 @@ class CC_EXPORT LayerTreeImpl { LayerImpl* inner_viewport_scroll_layer_; LayerImpl* outer_viewport_scroll_layer_; - LayerSelectionBound selection_anchor_; - LayerSelectionBound selection_focus_; + LayerSelectionBound selection_start_; + LayerSelectionBound selection_end_; float page_scale_factor_; float page_scale_delta_; |