| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return *m_webLayerTreeView->layerTreeHost()->GetLayerTree()->property_tr
ees(); | 91 return *m_webLayerTreeView->layerTreeHost()->GetLayerTree()->property_tr
ees(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 const cc::TransformNode& transformNode(const cc::Layer* layer) | 94 const cc::TransformNode& transformNode(const cc::Layer* layer) |
| 95 { | 95 { |
| 96 return *propertyTrees().transform_tree.Node(layer->transform_tree_index(
)); | 96 return *propertyTrees().transform_tree.Node(layer->transform_tree_index(
)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void update(const PaintArtifact& artifact) | 99 void update(const PaintArtifact& artifact) |
| 100 { | 100 { |
| 101 m_paintArtifactCompositor->update(artifact); | 101 m_paintArtifactCompositor->update(artifact, nullptr); |
| 102 m_webLayerTreeView->layerTreeHost()->LayoutAndUpdateLayers(); | 102 m_webLayerTreeView->layerTreeHost()->LayoutAndUpdateLayers(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); } | 105 cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); } |
| 106 | 106 |
| 107 size_t contentLayerCount() | 107 size_t contentLayerCount() |
| 108 { | 108 { |
| 109 return m_paintArtifactCompositor->getExtraDataForTesting()->contentLayer
s.size(); | 109 return m_paintArtifactCompositor->getExtraDataForTesting()->contentLayer
s.size(); |
| 110 } | 110 } |
| 111 | 111 |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 | 617 |
| 618 EXPECT_EQ(gfx::ScrollOffset(-11, -13), scrollTree.current_scroll_offset(cont
entLayerAt(0)->id())); | 618 EXPECT_EQ(gfx::ScrollOffset(-11, -13), scrollTree.current_scroll_offset(cont
entLayerAt(0)->id())); |
| 619 EXPECT_EQ(gfx::ScrollOffset(-37, -41), scrollTree.current_scroll_offset(cont
entLayerAt(1)->id())); | 619 EXPECT_EQ(gfx::ScrollOffset(-37, -41), scrollTree.current_scroll_offset(cont
entLayerAt(1)->id())); |
| 620 | 620 |
| 621 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & MainThreadScrollingR
eason::kHasBackgroundAttachmentFixedObjects); | 621 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & MainThreadScrollingR
eason::kHasBackgroundAttachmentFixedObjects); |
| 622 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons & MainThreadScrolling
Reason::kHasBackgroundAttachmentFixedObjects); | 622 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons & MainThreadScrolling
Reason::kHasBackgroundAttachmentFixedObjects); |
| 623 } | 623 } |
| 624 | 624 |
| 625 } // namespace | 625 } // namespace |
| 626 } // namespace blink | 626 } // namespace blink |
| OLD | NEW |