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

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

Issue 2380683006: SPv2: Add support for tracking raster paint invalidations in testing. (Closed)
Patch Set: none Created 4 years, 2 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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return *m_webLayerTreeView->layerTreeHost() 84 return *m_webLayerTreeView->layerTreeHost()
85 ->GetLayerTree() 85 ->GetLayerTree()
86 ->property_trees(); 86 ->property_trees();
87 } 87 }
88 88
89 const cc::TransformNode& transformNode(const cc::Layer* layer) { 89 const cc::TransformNode& transformNode(const cc::Layer* layer) {
90 return *propertyTrees().transform_tree.Node(layer->transform_tree_index()); 90 return *propertyTrees().transform_tree.Node(layer->transform_tree_index());
91 } 91 }
92 92
93 void update(const PaintArtifact& artifact) { 93 void update(const PaintArtifact& artifact) {
94 m_paintArtifactCompositor->update(artifact); 94 m_paintArtifactCompositor->update(artifact, nullptr);
95 m_webLayerTreeView->layerTreeHost()->LayoutAndUpdateLayers(); 95 m_webLayerTreeView->layerTreeHost()->LayoutAndUpdateLayers();
96 } 96 }
97 97
98 cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); } 98 cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); }
99 99
100 size_t contentLayerCount() { 100 size_t contentLayerCount() {
101 return m_paintArtifactCompositor->getExtraDataForTesting() 101 return m_paintArtifactCompositor->getExtraDataForTesting()
102 ->contentLayers.size(); 102 ->contentLayers.size();
103 } 103 }
104 104
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 scrollTree.current_scroll_offset(contentLayerAt(1)->id())); 652 scrollTree.current_scroll_offset(contentLayerAt(1)->id()));
653 653
654 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & 654 EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons &
655 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); 655 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
656 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons & 656 EXPECT_FALSE(scrollNodeB.main_thread_scrolling_reasons &
657 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects); 657 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
658 } 658 }
659 659
660 } // namespace 660 } // namespace
661 } // namespace blink 661 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698