| OLD | NEW |
| 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 Loading... |
| 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 return PaintChunkProperties(propertyTreeState); |
| 41 properties.scroll = ScrollPaintPropertyNode::root(); | |
| 42 return properties; | |
| 43 } | 41 } |
| 44 | 42 |
| 45 gfx::Transform translation(SkMScalar x, SkMScalar y) { | 43 gfx::Transform translation(SkMScalar x, SkMScalar y) { |
| 46 gfx::Transform transform; | 44 gfx::Transform transform; |
| 47 transform.Translate(x, y); | 45 transform.Translate(x, y); |
| 48 return transform; | 46 return transform; |
| 49 } | 47 } |
| 50 | 48 |
| 51 class WebLayerTreeViewWithCompositorFrameSink | 49 class WebLayerTreeViewWithCompositorFrameSink |
| 52 : public WebLayerTreeViewImplForTesting { | 50 : public WebLayerTreeViewImplForTesting { |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 scrollTree.current_scroll_offset(contentLayerAt(1)->id())); | 715 scrollTree.current_scroll_offset(contentLayerAt(1)->id())); |
| 718 | 716 |
| 719 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & | 717 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & |
| 720 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); | 718 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); |
| 721 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons & | 719 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons & |
| 722 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); | 720 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); |
| 723 } | 721 } |
| 724 | 722 |
| 725 } // namespace | 723 } // namespace |
| 726 } // namespace blink | 724 } // namespace blink |
| OLD | NEW |