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

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

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none Created 4 years 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
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 "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/test/fake_compositor_frame_sink.h" 10 #include "cc/test/fake_compositor_frame_sink.h"
(...skipping 16 matching lines...) Expand all
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 #include <memory> 28 #include <memory>
29 29
30 namespace blink { 30 namespace blink {
31 namespace { 31 namespace {
32 32
33 using ::blink::testing::createOpacityOnlyEffect; 33 using ::blink::testing::createOpacityOnlyEffect;
34 using ::testing::Pointee; 34 using ::testing::Pointee;
35 35
36 PaintChunkProperties defaultPaintChunkProperties() { 36 PaintChunkProperties defaultPaintChunkProperties() {
37 PaintChunkProperties properties; 37 PropertyTreeState propertyTreeState(
38 properties.transform = TransformPaintPropertyNode::root(); 38 TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(),
39 properties.clip = ClipPaintPropertyNode::root(); 39 EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root());
40 properties.effect = EffectPaintPropertyNode::root(); 40 PaintChunkProperties properties(propertyTreeState);
41 properties.scroll = ScrollPaintPropertyNode::root(); 41
42 return properties; 42 return properties;
Xianzhu 2016/12/13 18:26:20 Nit: return PaintChunkProperties(propertyTreeStat
chrishtr 2016/12/13 21:03:40 Done.
43 } 43 }
44 44
45 gfx::Transform translation(SkMScalar x, SkMScalar y) { 45 gfx::Transform translation(SkMScalar x, SkMScalar y) {
46 gfx::Transform transform; 46 gfx::Transform transform;
47 transform.Translate(x, y); 47 transform.Translate(x, y);
48 return transform; 48 return transform;
49 } 49 }
50 50
51 class WebLayerTreeViewWithCompositorFrameSink 51 class WebLayerTreeViewWithCompositorFrameSink
52 : public WebLayerTreeViewImplForTesting { 52 : public WebLayerTreeViewImplForTesting {
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 scrollTree.current_scroll_offset(contentLayerAt(1)->id())); 717 scrollTree.current_scroll_offset(contentLayerAt(1)->id()));
718 718
719 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & 719 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons &
720 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); 720 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
721 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons & 721 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons &
722 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); 722 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
723 } 723 }
724 724
725 } // namespace 725 } // namespace
726 } // namespace blink 726 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698