Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2971)

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2860293002: Change cc::ElementId to be a uint64_t (Closed)
Patch Set: none Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index bf60a074e87f600b6c33f21f251f9e3be1c06bb7..1e507d868e4ef989a5682856b498e496c0493326 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -339,8 +339,9 @@ class LayerTreeHostImplTest : public testing::Test,
LayerImpl::Create(layer_tree_impl, kPageScaleLayerId);
inner_scroll->SetScrollClipLayer(inner_clip->id());
- inner_scroll->SetElementId(
- LayerIdToElementIdForTesting(inner_scroll->id()));
+ ElementId element_id;
+ element_id.id = inner_scroll->id();
+ inner_scroll->SetElementId(element_id);
inner_scroll->SetBounds(content_size);
inner_scroll->SetPosition(gfx::PointF());
@@ -353,8 +354,8 @@ class LayerTreeHostImplTest : public testing::Test,
std::unique_ptr<LayerImpl> outer_scroll =
LayerImpl::Create(layer_tree_impl, kOuterViewportScrollLayerId);
outer_scroll->SetScrollClipLayer(outer_clip->id());
- outer_scroll->SetElementId(
- LayerIdToElementIdForTesting(outer_scroll->id()));
+ element_id.id = outer_scroll->id();
+ outer_scroll->SetElementId(element_id);
outer_scroll->layer_tree_impl()
->property_trees()
->scroll_tree.UpdateScrollOffsetBaseForTesting(outer_scroll->id(),
@@ -434,7 +435,9 @@ class LayerTreeHostImplTest : public testing::Test,
std::unique_ptr<LayerImpl> layer =
LayerImpl::Create(host_impl_->active_tree(), id);
layer->SetScrollClipLayer(clip_layer->id());
- layer->SetElementId(LayerIdToElementIdForTesting(layer->id()));
+ ElementId element_id;
+ element_id.id = layer->id();
+ layer->SetElementId(element_id);
layer->SetDrawsContent(true);
layer->SetBounds(size);
clip_layer->SetBounds(gfx::Size(size.width() / 2, size.height() / 2));
@@ -728,7 +731,9 @@ TEST_F(LayerTreeHostImplTest, ScrollDeltaRepeatedScrolls) {
root_clip->test_properties()->AddChild(std::move(root_owned));
root->SetBounds(gfx::Size(110, 110));
root->SetScrollClipLayer(root_clip->id());
- root->SetElementId(LayerIdToElementIdForTesting(root->id()));
+ ElementId element_id;
+ element_id.id = root->id();
+ root->SetElementId(element_id);
root->layer_tree_impl()
->property_trees()
->scroll_tree.UpdateScrollOffsetBaseForTesting(root->id(), scroll_offset);
@@ -771,7 +776,9 @@ TEST_F(LayerTreeHostImplTest, ScrollerSizeOfCCScrollingHistogramRecordingTest) {
child_clip->SetBounds(gfx::Size(100, 100));
child->SetScrollClipLayer(child_clip->id());
- child->SetElementId(LayerIdToElementIdForTesting(child->id()));
+ ElementId element_id;
+ element_id.id = child->id();
+ child->SetElementId(element_id);
child->SetBounds(gfx::Size(100, 400));
child->SetPosition(gfx::PointF());
child->SetDrawsContent(true);
@@ -1094,7 +1101,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithOverlappingNonScrollableLayer) {
std::unique_ptr<LayerImpl> scroll = LayerImpl::Create(layer_tree_impl, 3);
scroll->SetBounds(scroll_content_size);
scroll->SetScrollClipLayer(clip->id());
- scroll->SetElementId(LayerIdToElementIdForTesting(scroll->id()));
+ ElementId element_id;
+ element_id.id = scroll->id();
+ scroll->SetElementId(element_id);
scroll->SetDrawsContent(true);
std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar =
@@ -1166,7 +1175,9 @@ TEST_F(LayerTreeHostImplTest, ScrolledOverlappingDrawnScrollbarLayer) {
std::unique_ptr<LayerImpl> scroll = LayerImpl::Create(layer_tree_impl, 3);
scroll->SetBounds(scroll_content_size);
scroll->SetScrollClipLayer(clip->id());
- scroll->SetElementId(LayerIdToElementIdForTesting(scroll->id()));
+ ElementId element_id;
+ element_id.id = scroll->id();
+ scroll->SetElementId(element_id);
scroll->SetDrawsContent(true);
std::unique_ptr<SolidColorScrollbarLayerImpl> drawn_scrollbar =
@@ -1411,7 +1422,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) {
overflow->SetBounds(overflow_size);
overflow->SetScrollClipLayer(
scroll_layer->test_properties()->parent->test_properties()->parent->id());
- overflow->SetElementId(LayerIdToElementIdForTesting(overflow->id()));
+ ElementId element_id;
+ element_id.id = overflow->id();
+ overflow->SetElementId(element_id);
overflow->layer_tree_impl()
->property_trees()
->scroll_tree.UpdateScrollOffsetBaseForTesting(overflow->id(),
@@ -3374,7 +3387,9 @@ TEST_F(LayerTreeHostImplTest, ScrollbarRegistration) {
// Check scrollbar registration on a sublayer.
child->SetScrollClipLayer(child_clip->id());
- child->SetElementId(LayerIdToElementIdForTesting(child->id()));
+ ElementId element_id;
+ element_id.id = child->id();
+ child->SetElementId(element_id);
ElementId child_scroll_element_id = child->element_id();
child_clip->test_properties()->AddChild(std::move(child));
root_scroll->test_properties()->AddChild(std::move(child_clip));
@@ -3950,7 +3965,9 @@ class MissingTextureAnimatingLayer : public DidDrawCheckLayer {
tile_missing_(tile_missing),
had_incomplete_tile_(had_incomplete_tile) {
if (animating) {
- this->SetElementId(LayerIdToElementIdForTesting(id));
+ ElementId element_id;
+ element_id.id = id;
+ this->SetElementId(element_id);
AddAnimatedTransformToElementWithPlayer(this->element_id(), timeline,
10.0, 3, 0);
}
@@ -4266,7 +4283,9 @@ class LayerTreeHostImplBrowserControlsTest : public LayerTreeHostImplTest {
root_clip->SetBounds(inner_viewport_size);
root->SetScrollClipLayer(root_clip->id());
- root->SetElementId(LayerIdToElementIdForTesting(root->id()));
+ ElementId element_id;
+ element_id.id = root->id();
+ root->SetElementId(element_id);
root->SetBounds(outer_viewport_size);
root->SetPosition(gfx::PointF());
root->SetDrawsContent(false);
@@ -4274,8 +4293,8 @@ class LayerTreeHostImplBrowserControlsTest : public LayerTreeHostImplTest {
root->test_properties()->is_container_for_fixed_position_layers = true;
outer_clip->SetBounds(outer_viewport_size);
outer_scroll->SetScrollClipLayer(outer_clip->id());
- outer_scroll->SetElementId(
- LayerIdToElementIdForTesting(outer_scroll->id()));
+ element_id.id = outer_scroll->id();
+ outer_scroll->SetElementId(element_id);
outer_scroll->SetBounds(scroll_layer_size);
outer_scroll->SetPosition(gfx::PointF());
outer_scroll->SetDrawsContent(false);
@@ -4626,7 +4645,9 @@ TEST_F(LayerTreeHostImplBrowserControlsTest,
child_clip->SetBounds(sub_content_layer_size);
child->SetScrollClipLayer(child_clip->id());
- child->SetElementId(LayerIdToElementIdForTesting(child->id()));
+ ElementId element_id;
+ element_id.id = child->id();
+ child->SetElementId(element_id);
child->SetBounds(sub_content_size);
child->SetPosition(gfx::PointF());
child->SetDrawsContent(true);
@@ -5175,7 +5196,9 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
std::unique_ptr<LayerImpl> scroll_layer =
LayerImpl::Create(host_impl_->active_tree(), 12);
scroll_layer->SetScrollClipLayer(scroll_clip_layer->id());
- scroll_layer->SetElementId(LayerIdToElementIdForTesting(scroll_layer->id()));
+ ElementId element_id;
+ element_id.id = scroll_layer->id();
+ scroll_layer->SetElementId(element_id);
scroll_layer->SetBounds(contents_size);
scroll_layer->SetPosition(gfx::PointF());
scroll_layer->test_properties()->AddChild(std::move(content_layer));
@@ -6807,7 +6830,9 @@ TEST_F(LayerTreeHostImplTest, ScrollFromOuterViewportSibling) {
std::unique_ptr<LayerImpl> scroll = LayerImpl::Create(layer_tree_impl, 11);
scroll->SetBounds(gfx::Size(400, 400));
scroll->SetScrollClipLayer(clip->id());
- scroll->SetElementId(LayerIdToElementIdForTesting(scroll->id()));
+ ElementId element_id;
+ element_id.id = scroll->id();
+ scroll->SetElementId(element_id);
scroll->SetDrawsContent(true);
scroll_layer = scroll.get();
@@ -6898,7 +6923,9 @@ TEST_F(LayerTreeHostImplTest, ScrollChainingWithReplacedOuterViewport) {
std::unique_ptr<LayerImpl> scroll = LayerImpl::Create(layer_tree_impl, 11);
scroll->SetBounds(gfx::Size(400, 400));
scroll->SetScrollClipLayer(clip->id());
- scroll->SetElementId(LayerIdToElementIdForTesting(scroll->id()));
+ ElementId element_id;
+ element_id.id = scroll->id();
+ scroll->SetElementId(element_id);
scroll->SetDrawsContent(true);
std::unique_ptr<LayerImpl> clip2 = LayerImpl::Create(layer_tree_impl, 12);
@@ -6909,7 +6936,8 @@ TEST_F(LayerTreeHostImplTest, ScrollChainingWithReplacedOuterViewport) {
std::unique_ptr<LayerImpl> scroll2 = LayerImpl::Create(layer_tree_impl, 13);
scroll2->SetBounds(gfx::Size(500, 500));
scroll2->SetScrollClipLayer(clip2->id());
- scroll2->SetElementId(LayerIdToElementIdForTesting(scroll2->id()));
+ element_id.id = scroll2->id();
+ scroll2->SetElementId(element_id);
scroll2->SetDrawsContent(true);
scroll_layer = scroll.get();
@@ -7031,7 +7059,9 @@ TEST_F(LayerTreeHostImplTest, RootScrollerScrollNonDescendant) {
std::unique_ptr<LayerImpl> scroll = LayerImpl::Create(layer_tree_impl, 11);
scroll->SetBounds(gfx::Size(1200, 1200));
scroll->SetScrollClipLayer(clip->id());
- scroll->SetElementId(LayerIdToElementIdForTesting(scroll->id()));
+ ElementId element_id;
+ element_id.id = scroll->id();
+ scroll->SetElementId(element_id);
scroll->SetDrawsContent(true);
outer_scroll_layer = scroll.get();
@@ -7047,7 +7077,8 @@ TEST_F(LayerTreeHostImplTest, RootScrollerScrollNonDescendant) {
std::unique_ptr<LayerImpl> scroll2 = LayerImpl::Create(layer_tree_impl, 15);
scroll2->SetBounds(gfx::Size(1200, 1200));
scroll2->SetScrollClipLayer(clip2->id());
- scroll2->SetElementId(LayerIdToElementIdForTesting(scroll2->id()));
+ element_id.id = scroll2->id();
+ scroll2->SetElementId(element_id);
scroll2->SetDrawsContent(true);
sibling_scroll_layer = scroll2.get();
@@ -8385,8 +8416,9 @@ TEST_F(LayerTreeHostImplTest, FarAwayQuadsDontNeedAA) {
gfx::ScrollOffset scroll_offset(100000, 0);
scrolling_layer->SetScrollClipLayer(root->id());
- scrolling_layer->SetElementId(
- LayerIdToElementIdForTesting(scrolling_layer->id()));
+ ElementId element_id;
+ element_id.id = scrolling_layer->id();
+ scrolling_layer->SetElementId(element_id);
host_impl_->pending_tree()->BuildPropertyTreesForTesting();
scrolling_layer->layer_tree_impl()
@@ -9840,7 +9872,9 @@ TEST_F(LayerTreeHostImplBrowserControlsTest,
std::unique_ptr<LayerImpl> scroll = LayerImpl::Create(layer_tree_impl, 11);
scroll->SetBounds(scroll_content_size);
scroll->SetScrollClipLayer(clip->id());
- scroll->SetElementId(LayerIdToElementIdForTesting(scroll->id()));
+ ElementId element_id;
+ element_id.id = scroll->id();
+ scroll->SetElementId(element_id);
scroll->SetDrawsContent(true);
scroll_layer = scroll.get();
@@ -9902,8 +9936,9 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest {
LayerImpl::Create(layer_tree_impl, kPageScaleLayerId);
inner_scroll->SetScrollClipLayer(inner_clip->id());
- inner_scroll->SetElementId(
- LayerIdToElementIdForTesting(inner_scroll->id()));
+ ElementId element_id;
+ element_id.id = inner_scroll->id();
+ inner_scroll->SetElementId(element_id);
inner_scroll->SetBounds(outer_viewport);
inner_scroll->SetPosition(gfx::PointF());
@@ -9916,8 +9951,8 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest {
std::unique_ptr<LayerImpl> outer_scroll =
LayerImpl::Create(layer_tree_impl, kOuterViewportScrollLayerId);
outer_scroll->SetScrollClipLayer(outer_clip->id());
- outer_scroll->SetElementId(
- LayerIdToElementIdForTesting(outer_scroll->id()));
+ element_id.id = outer_scroll->id();
+ outer_scroll->SetElementId(element_id);
outer_scroll->layer_tree_impl()
->property_trees()
->scroll_tree.UpdateScrollOffsetBaseForTesting(outer_scroll->id(),
@@ -12180,8 +12215,10 @@ void LayerTreeHostImplTest::SetupMouseMoveAtTestScrollbarStates(
child->SetBounds(child_layer_size);
child->SetDrawsContent(true);
child->SetScrollClipLayer(child_clip_id);
- child->SetElementId(LayerIdToElementIdForTesting(child->id()));
- ElementId child_element_id = child->element_id();
+ ElementId child_element_id;
+ child_element_id.id = child->id();
+ child->SetElementId(child_element_id);
+ child_element_id = child->element_id();
if (main_thread_scrolling) {
child->set_main_thread_scrolling_reasons(

Powered by Google App Engine
This is Rietveld 408576698