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

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

Powered by Google App Engine
This is Rietveld 408576698