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

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

Issue 2342103002: Refactor the way PaintArtifactCompositor is attached and used. (Closed)
Patch Set: none Created 4 years, 3 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 : m_taskRunner(new base::TestSimpleTaskRunner) 63 : m_taskRunner(new base::TestSimpleTaskRunner)
64 , m_taskRunnerHandle(m_taskRunner) 64 , m_taskRunnerHandle(m_taskRunner)
65 { 65 {
66 } 66 }
67 67
68 void SetUp() override 68 void SetUp() override
69 { 69 {
70 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true); 70 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
71 71
72 // Delay constructing the compositor until after the feature is set. 72 // Delay constructing the compositor until after the feature is set.
73 m_paintArtifactCompositor = wrapUnique(new PaintArtifactCompositor); 73 m_paintArtifactCompositor = PaintArtifactCompositor::create();
74 m_paintArtifactCompositor->enableExtraDataForTesting(); 74 m_paintArtifactCompositor->enableExtraDataForTesting();
75 75
76 cc::LayerTreeSettings settings = WebLayerTreeViewImplForTesting::default LayerTreeSettings(); 76 cc::LayerTreeSettings settings = WebLayerTreeViewImplForTesting::default LayerTreeSettings();
77 settings.single_thread_proxy_scheduler = false; 77 settings.single_thread_proxy_scheduler = false;
78 settings.use_layer_lists = true; 78 settings.use_layer_lists = true;
79 m_webLayerTreeView = wrapUnique(new WebLayerTreeViewWithCompositorFrameS ink(settings)); 79 m_webLayerTreeView = wrapUnique(new WebLayerTreeViewWithCompositorFrameS ink(settings));
80 m_webLayerTreeView->setRootLayer(*m_paintArtifactCompositor->getWebLayer ()); 80 m_webLayerTreeView->setRootLayer(*m_paintArtifactCompositor->getWebLayer ());
81 } 81 }
82 82
83 void TearDown() override 83 void TearDown() override
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 EXPECT_TRUE(transformNodeA.local.IsIdentity()); 611 EXPECT_TRUE(transformNodeA.local.IsIdentity());
612 const cc::TransformNode& transformNodeB = *transformTree.Node(scrollNodeB.tr ansform_id); 612 const cc::TransformNode& transformNodeB = *transformTree.Node(scrollNodeB.tr ansform_id);
613 EXPECT_TRUE(transformNodeB.local.IsIdentity()); 613 EXPECT_TRUE(transformNodeB.local.IsIdentity());
614 614
615 EXPECT_EQ(gfx::ScrollOffset(-11, -13), scrollTree.current_scroll_offset(cont entLayerAt(0)->id())); 615 EXPECT_EQ(gfx::ScrollOffset(-11, -13), scrollTree.current_scroll_offset(cont entLayerAt(0)->id()));
616 EXPECT_EQ(gfx::ScrollOffset(-37, -41), scrollTree.current_scroll_offset(cont entLayerAt(1)->id())); 616 EXPECT_EQ(gfx::ScrollOffset(-37, -41), scrollTree.current_scroll_offset(cont entLayerAt(1)->id()));
617 } 617 }
618 618
619 } // namespace 619 } // namespace
620 } // namespace blink 620 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698