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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp

Issue 2877673002: Rewrite Layer::SetScrollOffset{FromImplSide} property tree fast-path (Closed)
Patch Set: Suppress bug in PaintArtifactCompositor 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 unified diff | Download patch
« cc/layers/layer.cc ('K') | « cc/layers/scrollbar_layer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/test/test_simple_task_runner.h" 9 #include "base/test/test_simple_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 // Only one content layer, and the first child layer is the dummy layer for 763 // Only one content layer, and the first child layer is the dummy layer for
764 // the transform node. 764 // the transform node.
765 const cc::Layer* transform_node_layer = RootLayer()->children()[0].get(); 765 const cc::Layer* transform_node_layer = RootLayer()->children()[0].get();
766 EXPECT_EQ(transform_node_layer->id(), transform_node.owning_layer_id); 766 EXPECT_EQ(transform_node_layer->id(), transform_node.owning_layer_id);
767 auto transform_node_index = 767 auto transform_node_index =
768 GetPropertyTrees().transform_tree.FindNodeIndexFromOwningLayerId( 768 GetPropertyTrees().transform_tree.FindNodeIndexFromOwningLayerId(
769 transform_node_layer->id()); 769 transform_node_layer->id());
770 EXPECT_EQ(transform_node_index, transform_node.id); 770 EXPECT_EQ(transform_node_index, transform_node.id);
771 771
772 EXPECT_EQ(0u, scroll_client.did_scroll_count); 772 EXPECT_EQ(0u, scroll_client.did_scroll_count);
773 // TODO(pdr): The PaintArtifactCompositor should set the scroll clip layer id
774 // so the Layer is scrollable. This call should be removed.
775 layer->SetScrollClipLayerId(layer->id());
773 layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(1, 2)); 776 layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(1, 2));
774 EXPECT_EQ(1u, scroll_client.did_scroll_count); 777 EXPECT_EQ(1u, scroll_client.did_scroll_count);
775 EXPECT_EQ(gfx::ScrollOffset(1, 2), scroll_client.last_scroll_offset); 778 EXPECT_EQ(gfx::ScrollOffset(1, 2), scroll_client.last_scroll_offset);
776 } 779 }
777 780
778 TEST_F(PaintArtifactCompositorTestWithPropertyTrees, TransformUnderScrollNode) { 781 TEST_F(PaintArtifactCompositorTestWithPropertyTrees, TransformUnderScrollNode) {
779 RefPtr<TransformPaintPropertyNode> scroll_translation = 782 RefPtr<TransformPaintPropertyNode> scroll_translation =
780 TransformPaintPropertyNode::CreateScrollTranslation( 783 TransformPaintPropertyNode::CreateScrollTranslation(
781 TransformPaintPropertyNode::Root(), 784 TransformPaintPropertyNode::Root(),
782 TransformationMatrix().Translate(7, 9), FloatPoint3D(), false, 0, 785 TransformationMatrix().Translate(7, 9), FloatPoint3D(), false, 0,
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 TestPaintArtifact artifact; 2260 TestPaintArtifact artifact;
2258 artifact 2261 artifact
2259 .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(), 2262 .Chunk(TransformPaintPropertyNode::Root(), ClipPaintPropertyNode::Root(),
2260 visibleEffect) 2263 visibleEffect)
2261 .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack); 2264 .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);
2262 Update(artifact.Build()); 2265 Update(artifact.Build());
2263 ASSERT_EQ(0u, ContentLayerCount()); 2266 ASSERT_EQ(0u, ContentLayerCount());
2264 } 2267 }
2265 2268
2266 } // namespace blink 2269 } // namespace blink
OLDNEW
« cc/layers/layer.cc ('K') | « cc/layers/scrollbar_layer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698