| Index: cc/trees/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| index bcb68a1823e6c8912c8f7ee5aac5d8aacd3cec92..961f4f1388117617e6cbe912a428a92158538bdb 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -48,10 +48,10 @@
|
| #include "cc/resources/ui_resource_manager.h"
|
| #include "cc/test/animation_test_common.h"
|
| #include "cc/test/begin_frame_args_test.h"
|
| +#include "cc/test/fake_compositor_frame_sink.h"
|
| #include "cc/test/fake_layer_tree_host_impl.h"
|
| #include "cc/test/fake_mask_layer_impl.h"
|
| #include "cc/test/fake_output_surface.h"
|
| -#include "cc/test/fake_output_surface_client.h"
|
| #include "cc/test/fake_picture_layer_impl.h"
|
| #include "cc/test/fake_raster_source.h"
|
| #include "cc/test/fake_video_frame_provider.h"
|
| @@ -59,7 +59,7 @@
|
| #include "cc/test/gpu_rasterization_enabled_settings.h"
|
| #include "cc/test/layer_test_common.h"
|
| #include "cc/test/layer_tree_test.h"
|
| -#include "cc/test/test_delegating_output_surface.h"
|
| +#include "cc/test/test_compositor_frame_sink.h"
|
| #include "cc/test/test_gpu_memory_buffer_manager.h"
|
| #include "cc/test/test_shared_bitmap_manager.h"
|
| #include "cc/test/test_task_graph_runner.h"
|
| @@ -123,15 +123,15 @@ class LayerTreeHostImplTest : public testing::Test,
|
| }
|
|
|
| void SetUp() override {
|
| - CreateHostImpl(DefaultSettings(), CreateOutputSurface());
|
| + CreateHostImpl(DefaultSettings(), CreateCompositorFrameSink());
|
| }
|
|
|
| void TearDown() override {
|
| if (host_impl_)
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| }
|
|
|
| - void DidLoseOutputSurfaceOnImplThread() override {}
|
| + void DidLoseCompositorFrameSinkOnImplThread() override {}
|
| void SetBeginFrameSource(BeginFrameSource* source) override {}
|
| void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {}
|
| void DidSwapBuffersCompleteOnImplThread() override {}
|
| @@ -170,7 +170,7 @@ class LayerTreeHostImplTest : public testing::Test,
|
| void DidCompletePageScaleAnimationOnImplThread() override {
|
| did_complete_page_scale_animation_ = true;
|
| }
|
| - void OnDrawForOutputSurface(bool resourceless_software_draw) override {
|
| + void OnDrawForCompositorFrameSink(bool resourceless_software_draw) override {
|
| std::unique_ptr<LayerTreeHostImpl::FrameData> frame(
|
| new LayerTreeHostImpl::FrameData);
|
| EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(frame.get()));
|
| @@ -185,26 +185,27 @@ class LayerTreeHostImplTest : public testing::Test,
|
| reduce_memory_result_ = reduce_memory_result;
|
| }
|
|
|
| - virtual bool CreateHostImpl(const LayerTreeSettings& settings,
|
| - std::unique_ptr<OutputSurface> output_surface) {
|
| + virtual bool CreateHostImpl(
|
| + const LayerTreeSettings& settings,
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink) {
|
| return CreateHostImplWithTaskRunnerProvider(
|
| - settings, std::move(output_surface), &task_runner_provider_);
|
| + settings, std::move(compositor_frame_sink), &task_runner_provider_);
|
| }
|
|
|
| virtual bool CreateHostImplWithTaskRunnerProvider(
|
| const LayerTreeSettings& settings,
|
| - std::unique_ptr<OutputSurface> output_surface,
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink,
|
| TaskRunnerProvider* task_runner_provider) {
|
| if (host_impl_)
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = LayerTreeHostImpl::Create(
|
| settings, this, task_runner_provider, &stats_instrumentation_,
|
| &shared_bitmap_manager_, &gpu_memory_buffer_manager_,
|
| &task_graph_runner_,
|
| AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0);
|
| - output_surface_ = std::move(output_surface);
|
| + compositor_frame_sink_ = std::move(compositor_frame_sink);
|
| host_impl_->SetVisible(true);
|
| - bool init = host_impl_->InitializeRenderer(output_surface_.get());
|
| + bool init = host_impl_->InitializeRenderer(compositor_frame_sink_.get());
|
| host_impl_->SetViewportSize(gfx::Size(10, 10));
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f);
|
| // Set the BeginFrameArgs so that methods which use it are able to.
|
| @@ -469,8 +470,8 @@ class LayerTreeHostImplTest : public testing::Test,
|
| scoped_refptr<AnimationTimeline> timeline() { return timeline_; }
|
|
|
| protected:
|
| - virtual std::unique_ptr<OutputSurface> CreateOutputSurface() {
|
| - return FakeOutputSurface::CreateDelegating3d();
|
| + virtual std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() {
|
| + return FakeCompositorFrameSink::Create3d();
|
| }
|
|
|
| void DrawOneFrame() {
|
| @@ -504,7 +505,7 @@ class LayerTreeHostImplTest : public testing::Test,
|
| TestSharedBitmapManager shared_bitmap_manager_;
|
| TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
|
| TestTaskGraphRunner task_graph_runner_;
|
| - std::unique_ptr<OutputSurface> output_surface_;
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink_;
|
| std::unique_ptr<LayerTreeHostImpl> host_impl_;
|
| FakeRenderingStatsInstrumentation stats_instrumentation_;
|
| bool on_can_draw_state_changed_called_;
|
| @@ -526,7 +527,7 @@ class LayerTreeHostImplTest : public testing::Test,
|
| class LayerTreeHostImplTimelinesTest : public LayerTreeHostImplTest {
|
| public:
|
| void SetUp() override {
|
| - CreateHostImpl(DefaultSettings(), CreateOutputSurface());
|
| + CreateHostImpl(DefaultSettings(), CreateCompositorFrameSink());
|
| }
|
| };
|
|
|
| @@ -568,8 +569,7 @@ TEST_F(LayerTreeHostImplTest, NotifyIfCanDrawChanged) {
|
| }
|
|
|
| TEST_F(LayerTreeHostImplTest, ResourcelessDrawWithEmptyViewport) {
|
| - CreateHostImpl(DefaultSettings(),
|
| - FakeOutputSurface::CreateDelegatingSoftware());
|
| + CreateHostImpl(DefaultSettings(), FakeCompositorFrameSink::CreateSoftware());
|
| SetupScrollAndContentsLayers(gfx::Size(100, 100));
|
| host_impl_->active_tree()->BuildPropertyTreesForTesting();
|
|
|
| @@ -577,16 +577,18 @@ TEST_F(LayerTreeHostImplTest, ResourcelessDrawWithEmptyViewport) {
|
| host_impl_->SetViewportSize(gfx::Size());
|
| EXPECT_FALSE(host_impl_->CanDraw());
|
|
|
| - FakeOutputSurface* fake_output_surface =
|
| - static_cast<FakeOutputSurface*>(host_impl_->output_surface());
|
| - EXPECT_EQ(fake_output_surface->num_sent_frames(), 0u);
|
| + FakeCompositorFrameSink* fake_compositor_frame_sink =
|
| + static_cast<FakeCompositorFrameSink*>(
|
| + host_impl_->compositor_frame_sink());
|
| + EXPECT_EQ(fake_compositor_frame_sink->num_sent_frames(), 0u);
|
| gfx::Transform identity;
|
| gfx::Rect viewport(100, 100);
|
| const bool resourceless_software_draw = true;
|
| host_impl_->OnDraw(identity, viewport, resourceless_software_draw);
|
| - ASSERT_EQ(fake_output_surface->num_sent_frames(), 1u);
|
| - EXPECT_EQ(gfx::SizeF(100.f, 100.f),
|
| - fake_output_surface->last_sent_frame()->metadata.root_layer_size);
|
| + ASSERT_EQ(fake_compositor_frame_sink->num_sent_frames(), 1u);
|
| + EXPECT_EQ(
|
| + gfx::SizeF(100.f, 100.f),
|
| + fake_compositor_frame_sink->last_sent_frame()->metadata.root_layer_size);
|
| }
|
|
|
| TEST_F(LayerTreeHostImplTest, ScrollDeltaNoLayers) {
|
| @@ -735,7 +737,7 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
|
| // Initialization will fail.
|
| EXPECT_FALSE(CreateHostImpl(
|
| DefaultSettings(),
|
| - FakeOutputSurface::CreateDelegating3d(std::move(context_owned))));
|
| + FakeCompositorFrameSink::Create3d(std::move(context_owned))));
|
|
|
| SetupScrollAndContentsLayers(gfx::Size(100, 100));
|
|
|
| @@ -1416,8 +1418,8 @@ TEST_F(LayerTreeHostImplTest, AnimationSchedulingActiveTree) {
|
|
|
| TEST_F(LayerTreeHostImplTest, AnimationSchedulingCommitToActiveTree) {
|
| FakeImplTaskRunnerProvider provider(nullptr);
|
| - CreateHostImplWithTaskRunnerProvider(DefaultSettings(), CreateOutputSurface(),
|
| - &provider);
|
| + CreateHostImplWithTaskRunnerProvider(DefaultSettings(),
|
| + CreateCompositorFrameSink(), &provider);
|
| EXPECT_TRUE(host_impl_->CommitToActiveTree());
|
|
|
| host_impl_->SetViewportSize(gfx::Size(50, 50));
|
| @@ -1460,7 +1462,7 @@ TEST_F(LayerTreeHostImplTest, AnimationSchedulingCommitToActiveTree) {
|
| EXPECT_FALSE(did_request_commit_);
|
|
|
| // Delete the LayerTreeHostImpl before the TaskRunnerProvider goes away.
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = nullptr;
|
| }
|
|
|
| @@ -1702,8 +1704,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
|
|
|
| TEST_F(LayerTreeHostImplTest, ViewportScrollOrder) {
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings,
|
| - CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 0.25f, 4.f);
|
|
|
| const gfx::Size content_size(1000, 1000);
|
| @@ -1769,7 +1770,7 @@ TEST_F(LayerTreeHostImplTest, ViewportScrollOrder) {
|
| // dropped. crbug.com/539334.
|
| TEST_F(LayerTreeHostImplTest, ScrollViewportWithFractionalAmounts) {
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 2.f);
|
|
|
| const gfx::Size content_size(1000, 1000);
|
| @@ -1823,8 +1824,7 @@ TEST_F(LayerTreeHostImplTest, ScrollViewportWithFractionalAmounts) {
|
| // to the outer viewport.
|
| TEST_F(LayerTreeHostImplTest, ScrollDuringPinchGesture) {
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings,
|
| - CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 2.f);
|
|
|
| const gfx::Size content_size(1000, 1000);
|
| @@ -1885,8 +1885,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDuringPinchGesture) {
|
| // should assume the user means to scroll into the edge of the screen.
|
| TEST_F(LayerTreeHostImplTest, PinchZoomSnapsToScreenEdge) {
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings,
|
| - CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 2.f);
|
|
|
| const gfx::Size content_size(1000, 1000);
|
| @@ -2729,7 +2728,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
|
| class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {
|
| protected:
|
| void SetupLayers(LayerTreeSettings settings) {
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = nullptr;
|
|
|
| gfx::Size content_size(100, 100);
|
| @@ -2739,9 +2738,9 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {
|
| settings, this, &task_runner_provider_, &shared_bitmap_manager_,
|
| &task_graph_runner_, &stats_instrumentation_);
|
| host_impl_ = base::WrapUnique(host_impl_override_time);
|
| - output_surface_ = CreateOutputSurface();
|
| + compositor_frame_sink_ = CreateCompositorFrameSink();
|
| host_impl_->SetVisible(true);
|
| - host_impl_->InitializeRenderer(output_surface_.get());
|
| + host_impl_->InitializeRenderer(compositor_frame_sink_.get());
|
|
|
| SetupScrollAndContentsLayers(content_size);
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 4.f);
|
| @@ -2967,7 +2966,7 @@ class LayerTreeHostImplTestScrollbarOpacity : public LayerTreeHostImplTest {
|
| // If no animator is set, scrollbar won't show and no animation is expected.
|
| bool expecting_animations = animator != LayerTreeSettings::NO_ANIMATOR;
|
|
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->CreatePendingTree();
|
| CreateScrollAndContentsLayers(host_impl_->pending_tree(), content_size);
|
| std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar =
|
| @@ -3056,7 +3055,7 @@ TEST_F(LayerTreeHostImplTestScrollbarOpacity, NoAnimator) {
|
|
|
| TEST_F(LayerTreeHostImplTest, ScrollbarInnerLargerThanOuter) {
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
|
|
| gfx::Size inner_viewport_size(315, 200);
|
| gfx::Size outer_viewport_size(300, 200);
|
| @@ -3093,7 +3092,7 @@ TEST_F(LayerTreeHostImplTest, ScrollbarRegistration) {
|
| settings.scrollbar_animator = LayerTreeSettings::LINEAR_FADE;
|
| settings.scrollbar_fade_delay_ms = 20;
|
| settings.scrollbar_fade_duration_ms = 20;
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
|
|
| gfx::Size viewport_size(300, 200);
|
| gfx::Size content_size(1000, 1000);
|
| @@ -3221,7 +3220,7 @@ void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale(
|
| gfx::Size content_size(1000, 1000);
|
| gfx::Size scrollbar_size(gfx::Size(15, viewport_size.height()));
|
|
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->active_tree()->SetDeviceScaleFactor(device_scale_factor);
|
| host_impl_->SetViewportSize(device_viewport_size);
|
|
|
| @@ -3838,8 +3837,7 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsAndFails) {
|
|
|
| TEST_F(LayerTreeHostImplTest,
|
| PrepareToDrawWhenDrawAndSwapFullViewportEveryFrame) {
|
| - CreateHostImpl(DefaultSettings(),
|
| - FakeOutputSurface::CreateDelegatingSoftware());
|
| + CreateHostImpl(DefaultSettings(), FakeCompositorFrameSink::CreateSoftware());
|
|
|
| const gfx::Transform external_transform;
|
| const gfx::Rect external_viewport;
|
| @@ -3955,10 +3953,11 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest {
|
| clip_size_.height() + top_controls_height_);
|
| }
|
|
|
| - bool CreateHostImpl(const LayerTreeSettings& settings,
|
| - std::unique_ptr<OutputSurface> output_surface) override {
|
| + bool CreateHostImpl(
|
| + const LayerTreeSettings& settings,
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink) override {
|
| bool init = LayerTreeHostImplTest::CreateHostImpl(
|
| - settings, std::move(output_surface));
|
| + settings, std::move(compositor_frame_sink));
|
| if (init) {
|
| host_impl_->active_tree()->set_top_controls_height(top_controls_height_);
|
| host_impl_->active_tree()->SetCurrentTopControlsShownRatio(1.f);
|
| @@ -3972,7 +3971,7 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest {
|
| const gfx::Size& outer_viewport_size,
|
| const gfx::Size& scroll_layer_size) {
|
| settings_ = DefaultSettings();
|
| - CreateHostImpl(settings_, CreateOutputSurface());
|
| + CreateHostImpl(settings_, CreateCompositorFrameSink());
|
| SetupTopControlsAndScrollLayerWithVirtualViewport(
|
| host_impl_->active_tree(), inner_viewport_size, outer_viewport_size,
|
| scroll_layer_size);
|
| @@ -4383,7 +4382,7 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollableSublayer) {
|
| // TreeImpl correctly affects the top controls manager and viewport bounds.
|
| TEST_F(LayerTreeHostImplTopControlsTest, PositionTopControlsExplicitly) {
|
| settings_ = DefaultSettings();
|
| - CreateHostImpl(settings_, CreateOutputSurface());
|
| + CreateHostImpl(settings_, CreateCompositorFrameSink());
|
| SetupTopControlsAndScrollLayerWithVirtualViewport(
|
| layer_size_, layer_size_, layer_size_);
|
| DrawFrame();
|
| @@ -4416,7 +4415,7 @@ TEST_F(LayerTreeHostImplTopControlsTest, PositionTopControlsExplicitly) {
|
| // change after the activation.
|
| TEST_F(LayerTreeHostImplTopControlsTest, ApplyDeltaOnTreeActivation) {
|
| settings_ = DefaultSettings();
|
| - CreateHostImpl(settings_, CreateOutputSurface());
|
| + CreateHostImpl(settings_, CreateCompositorFrameSink());
|
| SetupTopControlsAndScrollLayerWithVirtualViewport(
|
| layer_size_, layer_size_, layer_size_);
|
| DrawFrame();
|
| @@ -4465,7 +4464,7 @@ TEST_F(LayerTreeHostImplTopControlsTest, ApplyDeltaOnTreeActivation) {
|
| // the compositor to accommodate the top controls.
|
| TEST_F(LayerTreeHostImplTopControlsTest, TopControlsLayoutHeightChanged) {
|
| settings_ = DefaultSettings();
|
| - CreateHostImpl(settings_, CreateOutputSurface());
|
| + CreateHostImpl(settings_, CreateCompositorFrameSink());
|
| SetupTopControlsAndScrollLayerWithVirtualViewport(
|
| layer_size_, layer_size_, layer_size_);
|
| DrawFrame();
|
| @@ -4697,7 +4696,7 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
|
| TEST_F(LayerTreeHostImplTopControlsTest,
|
| ScrollNonScrollableRootWithTopControls) {
|
| settings_ = DefaultSettings();
|
| - CreateHostImpl(settings_, CreateOutputSurface());
|
| + CreateHostImpl(settings_, CreateCompositorFrameSink());
|
| SetupTopControlsAndScrollLayerWithVirtualViewport(
|
| layer_size_, layer_size_, layer_size_);
|
| DrawFrame();
|
| @@ -5960,7 +5959,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
|
| EXPECT_EQ(gfx::SizeF(new_size), scroll_watcher.scrollable_size());
|
|
|
| // Tear down the LayerTreeHostImpl before the InputHandlerClient.
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = nullptr;
|
| }
|
|
|
| @@ -6255,7 +6254,7 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildEventBubbling) {
|
| TEST_F(LayerTreeHostImplTest, OverscrollAlways) {
|
| InputHandlerScrollResult scroll_result;
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
|
|
| LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(50, 50));
|
| LayerImpl* clip_layer =
|
| @@ -6349,7 +6348,7 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
|
| TEST_F(LayerTreeHostImplTest, OverscrollOnMainThread) {
|
| InputHandlerScrollResult scroll_result;
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
|
|
| const gfx::Size content_size(50, 50);
|
| const gfx::Size viewport_size(50, 50);
|
| @@ -6517,7 +6516,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChainingWithReplacedOuterViewport) {
|
| TEST_F(LayerTreeHostImplTest, OverscrollOnImplThread) {
|
| InputHandlerScrollResult scroll_result;
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
|
|
| const gfx::Size content_size(50, 50);
|
| const gfx::Size viewport_size(50, 50);
|
| @@ -6938,10 +6937,11 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest {
|
| child_(NULL),
|
| did_activate_pending_tree_(false) {}
|
|
|
| - std::unique_ptr<OutputSurface> CreateFakeOutputSurface(bool software) {
|
| + std::unique_ptr<CompositorFrameSink> CreateFakeCompositorFrameSink(
|
| + bool software) {
|
| if (software)
|
| - return FakeOutputSurface::CreateDelegatingSoftware();
|
| - return FakeOutputSurface::CreateDelegating3d();
|
| + return FakeCompositorFrameSink::CreateSoftware();
|
| + return FakeCompositorFrameSink::Create3d();
|
| }
|
|
|
| void SetupActiveTreeLayers() {
|
| @@ -7157,7 +7157,7 @@ TEST_F(LayerTreeHostImplViewportCoveredTest, ViewportCovered) {
|
| viewport_size_ = gfx::Size(1000, 1000);
|
|
|
| bool software = false;
|
| - CreateHostImpl(DefaultSettings(), CreateFakeOutputSurface(software));
|
| + CreateHostImpl(DefaultSettings(), CreateFakeCompositorFrameSink(software));
|
|
|
| host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
|
| SetupActiveTreeLayers();
|
| @@ -7171,7 +7171,7 @@ TEST_F(LayerTreeHostImplViewportCoveredTest, ViewportCoveredScaled) {
|
| viewport_size_ = gfx::Size(1000, 1000);
|
|
|
| bool software = false;
|
| - CreateHostImpl(DefaultSettings(), CreateFakeOutputSurface(software));
|
| + CreateHostImpl(DefaultSettings(), CreateFakeCompositorFrameSink(software));
|
|
|
| host_impl_->active_tree()->SetDeviceScaleFactor(2.f);
|
| host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
|
| @@ -7186,7 +7186,7 @@ TEST_F(LayerTreeHostImplViewportCoveredTest, ActiveTreeGrowViewportInvalid) {
|
| viewport_size_ = gfx::Size(1000, 1000);
|
|
|
| bool software = true;
|
| - CreateHostImpl(DefaultSettings(), CreateFakeOutputSurface(software));
|
| + CreateHostImpl(DefaultSettings(), CreateFakeCompositorFrameSink(software));
|
|
|
| // Pending tree to force active_tree size invalid. Not used otherwise.
|
| host_impl_->CreatePendingTree();
|
| @@ -7203,7 +7203,7 @@ TEST_F(LayerTreeHostImplViewportCoveredTest, ActiveTreeShrinkViewportInvalid) {
|
| viewport_size_ = gfx::Size(1000, 1000);
|
|
|
| bool software = true;
|
| - CreateHostImpl(DefaultSettings(), CreateFakeOutputSurface(software));
|
| + CreateHostImpl(DefaultSettings(), CreateFakeCompositorFrameSink(software));
|
|
|
| // Set larger viewport and activate it to active tree.
|
| host_impl_->CreatePendingTree();
|
| @@ -7244,9 +7244,10 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
|
| context_provider->BindToCurrentThread();
|
| context_provider->TestContext3d()->set_have_post_sub_buffer(true);
|
|
|
| - std::unique_ptr<FakeOutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d(context_provider));
|
| - FakeOutputSurface* fake_output_surface = output_surface.get();
|
| + std::unique_ptr<FakeCompositorFrameSink> compositor_frame_sink(
|
| + FakeCompositorFrameSink::Create3d(context_provider));
|
| + FakeCompositorFrameSink* fake_compositor_frame_sink =
|
| + compositor_frame_sink.get();
|
|
|
| // This test creates its own LayerTreeHostImpl, so
|
| // that we can force partial swap enabled.
|
| @@ -7258,7 +7259,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
|
| &shared_bitmap_manager_, NULL, &task_graph_runner_,
|
| AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0);
|
| layer_tree_host_impl->SetVisible(true);
|
| - layer_tree_host_impl->InitializeRenderer(output_surface.get());
|
| + layer_tree_host_impl->InitializeRenderer(compositor_frame_sink.get());
|
| layer_tree_host_impl->WillBeginImplFrame(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500));
|
| @@ -7285,7 +7286,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
|
| layer_tree_host_impl->DidDrawAllLayers(frame);
|
| gfx::Rect expected_swap_rect(500, 500);
|
| EXPECT_EQ(expected_swap_rect.ToString(),
|
| - fake_output_surface->last_swap_rect().ToString());
|
| + fake_compositor_frame_sink->last_swap_rect().ToString());
|
|
|
| // Second frame, only the damaged area should get swapped. Damage should be
|
| // the union of old and new child rects: gfx::Rect(26, 28).
|
| @@ -7306,7 +7307,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
|
|
|
| expected_swap_rect = gfx::Rect(26, 28);
|
| EXPECT_EQ(expected_swap_rect.ToString(),
|
| - fake_output_surface->last_swap_rect().ToString());
|
| + fake_compositor_frame_sink->last_swap_rect().ToString());
|
|
|
| layer_tree_host_impl->SetViewportSize(gfx::Size(10, 10));
|
| // This will damage everything.
|
| @@ -7319,9 +7320,9 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
|
|
|
| expected_swap_rect = gfx::Rect(10, 10);
|
| EXPECT_EQ(expected_swap_rect.ToString(),
|
| - fake_output_surface->last_swap_rect().ToString());
|
| + fake_compositor_frame_sink->last_swap_rect().ToString());
|
|
|
| - layer_tree_host_impl->ReleaseOutputSurface();
|
| + layer_tree_host_impl->ReleaseCompositorFrameSink();
|
| }
|
|
|
| TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {
|
| @@ -7381,14 +7382,14 @@ static std::unique_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
|
| SharedBitmapManager* manager,
|
| TaskGraphRunner* task_graph_runner,
|
| RenderingStatsInstrumentation* stats_instrumentation,
|
| - OutputSurface* output_surface) {
|
| + CompositorFrameSink* compositor_frame_sink) {
|
| settings.renderer_settings.partial_swap_enabled = partial_swap;
|
| std::unique_ptr<LayerTreeHostImpl> my_host_impl = LayerTreeHostImpl::Create(
|
| settings, client, task_runner_provider, stats_instrumentation, manager,
|
| nullptr, task_graph_runner,
|
| AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0);
|
| my_host_impl->SetVisible(true);
|
| - my_host_impl->InitializeRenderer(output_surface);
|
| + my_host_impl->InitializeRenderer(compositor_frame_sink);
|
| my_host_impl->WillBeginImplFrame(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| my_host_impl->SetViewportSize(gfx::Size(100, 100));
|
| @@ -7454,12 +7455,12 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) {
|
| scoped_refptr<TestContextProvider> provider(TestContextProvider::Create());
|
| provider->BindToCurrentThread();
|
| provider->TestContext3d()->set_have_post_sub_buffer(true);
|
| - std::unique_ptr<OutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d(provider));
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink(
|
| + FakeCompositorFrameSink::Create3d(provider));
|
| std::unique_ptr<LayerTreeHostImpl> my_host_impl = SetupLayersForOpacity(
|
| DefaultSettings(), true, this, &task_runner_provider_,
|
| &shared_bitmap_manager, &task_graph_runner, &stats_instrumentation_,
|
| - output_surface.get());
|
| + compositor_frame_sink.get());
|
| {
|
| LayerTreeHostImpl::FrameData frame;
|
| EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame));
|
| @@ -7476,7 +7477,7 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) {
|
| my_host_impl->DrawLayers(&frame);
|
| my_host_impl->DidDrawAllLayers(frame);
|
| }
|
| - my_host_impl->ReleaseOutputSurface();
|
| + my_host_impl->ReleaseCompositorFrameSink();
|
| }
|
|
|
| TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) {
|
| @@ -7485,12 +7486,12 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) {
|
| scoped_refptr<TestContextProvider> provider(TestContextProvider::Create());
|
| provider->BindToCurrentThread();
|
| provider->TestContext3d()->set_have_post_sub_buffer(true);
|
| - std::unique_ptr<OutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d(provider));
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink(
|
| + FakeCompositorFrameSink::Create3d(provider));
|
| std::unique_ptr<LayerTreeHostImpl> my_host_impl = SetupLayersForOpacity(
|
| DefaultSettings(), false, this, &task_runner_provider_,
|
| &shared_bitmap_manager, &task_graph_runner, &stats_instrumentation_,
|
| - output_surface.get());
|
| + compositor_frame_sink.get());
|
| {
|
| LayerTreeHostImpl::FrameData frame;
|
| EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame));
|
| @@ -7507,16 +7508,16 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) {
|
| my_host_impl->DrawLayers(&frame);
|
| my_host_impl->DidDrawAllLayers(frame);
|
| }
|
| - my_host_impl->ReleaseOutputSurface();
|
| + my_host_impl->ReleaseCompositorFrameSink();
|
| }
|
|
|
| TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
|
| std::unique_ptr<TestWebGraphicsContext3D> context =
|
| TestWebGraphicsContext3D::Create();
|
| TestWebGraphicsContext3D* context3d = context.get();
|
| - std::unique_ptr<OutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d(std::move(context)));
|
| - CreateHostImpl(DefaultSettings(), std::move(output_surface));
|
| + std::unique_ptr<CompositorFrameSink> compositor_frame_sink(
|
| + FakeCompositorFrameSink::Create3d(std::move(context)));
|
| + CreateHostImpl(DefaultSettings(), std::move(compositor_frame_sink));
|
|
|
| std::unique_ptr<LayerImpl> root_layer =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| @@ -7594,11 +7595,10 @@ TEST_F(LayerTreeHostImplTest, HasTransparentBackground) {
|
| host_impl_->DidDrawAllLayers(frame);
|
| }
|
|
|
| -class LayerTreeHostImplTestWithDelegatingRenderer
|
| - : public LayerTreeHostImplTest {
|
| +class LayerTreeHostImplTestDrawAndTestDamage : public LayerTreeHostImplTest {
|
| protected:
|
| - std::unique_ptr<OutputSurface> CreateOutputSurface() override {
|
| - return FakeOutputSurface::CreateDelegating3d();
|
| + std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() override {
|
| + return FakeCompositorFrameSink::Create3d();
|
| }
|
|
|
| void DrawFrameAndTestDamage(const gfx::Rect& expected_damage) {
|
| @@ -7640,7 +7640,7 @@ class LayerTreeHostImplTestWithDelegatingRenderer
|
| }
|
| };
|
|
|
| -TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) {
|
| +TEST_F(LayerTreeHostImplTestDrawAndTestDamage, FrameIncludesDamageRect) {
|
| std::unique_ptr<SolidColorLayerImpl> root =
|
| SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
|
| root->SetPosition(gfx::PointF());
|
| @@ -7802,7 +7802,7 @@ TEST_F(LayerTreeHostImplTest,
|
| ForcedDrawToSoftwareDeviceSkipsUnsupportedLayers) {
|
| set_reduce_memory_result(false);
|
| EXPECT_TRUE(CreateHostImpl(DefaultSettings(),
|
| - FakeOutputSurface::CreateDelegatingSoftware()));
|
| + FakeCompositorFrameSink::CreateSoftware()));
|
|
|
| const gfx::Transform external_transform;
|
| const gfx::Rect external_viewport;
|
| @@ -7834,7 +7834,7 @@ TEST_F(LayerTreeHostImplTest,
|
|
|
| // Checks that we use the memory limits provided.
|
| TEST_F(LayerTreeHostImplTest, MemoryLimits) {
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = nullptr;
|
|
|
| const size_t kGpuByteLimit = 1234321;
|
| @@ -7868,10 +7868,10 @@ TEST_F(LayerTreeHostImplTest, MemoryLimits) {
|
| AnimationHost::CreateForTesting(ThreadInstance::IMPL), 0);
|
|
|
| // Gpu compositing.
|
| - output_surface_ =
|
| - FakeOutputSurface::CreateDelegating3d(TestWebGraphicsContext3D::Create());
|
| + compositor_frame_sink_ =
|
| + FakeCompositorFrameSink::Create3d(TestWebGraphicsContext3D::Create());
|
| host_impl_->SetVisible(true);
|
| - host_impl_->InitializeRenderer(output_surface_.get());
|
| + host_impl_->InitializeRenderer(compositor_frame_sink_.get());
|
| {
|
| const auto& state = host_impl_->global_tile_state();
|
| EXPECT_EQ(kGpuByteLimit, state.hard_memory_limit_in_bytes);
|
| @@ -7897,9 +7897,9 @@ TEST_F(LayerTreeHostImplTest, MemoryLimits) {
|
| }
|
|
|
| // Software compositing.
|
| - host_impl_->ReleaseOutputSurface();
|
| - output_surface_ = FakeOutputSurface::CreateDelegatingSoftware();
|
| - host_impl_->InitializeRenderer(output_surface_.get());
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| + compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware();
|
| + host_impl_->InitializeRenderer(compositor_frame_sink_.get());
|
| {
|
| const auto& state = host_impl_->global_tile_state();
|
| EXPECT_EQ(kSoftwareByteLimit, state.hard_memory_limit_in_bytes);
|
| @@ -7983,9 +7983,9 @@ class LayerTreeHostImplTestPrepareTiles : public LayerTreeHostImplTest {
|
| new FakeLayerTreeHostImpl(LayerTreeSettings(), &task_runner_provider_,
|
| &shared_bitmap_manager_, &task_graph_runner_);
|
| host_impl_.reset(fake_host_impl_);
|
| - output_surface_ = CreateOutputSurface();
|
| + compositor_frame_sink_ = CreateCompositorFrameSink();
|
| host_impl_->SetVisible(true);
|
| - host_impl_->InitializeRenderer(output_surface_.get());
|
| + host_impl_->InitializeRenderer(compositor_frame_sink_.get());
|
| host_impl_->SetViewportSize(gfx::Size(10, 10));
|
| }
|
|
|
| @@ -8004,9 +8004,9 @@ TEST_F(LayerTreeHostImplTest, UIResourceManagement) {
|
| std::unique_ptr<TestWebGraphicsContext3D> context =
|
| TestWebGraphicsContext3D::Create();
|
| TestWebGraphicsContext3D* context3d = context.get();
|
| - std::unique_ptr<FakeOutputSurface> output_surface =
|
| - FakeOutputSurface::CreateDelegating3d();
|
| - CreateHostImpl(DefaultSettings(), std::move(output_surface));
|
| + std::unique_ptr<FakeCompositorFrameSink> compositor_frame_sink =
|
| + FakeCompositorFrameSink::Create3d();
|
| + CreateHostImpl(DefaultSettings(), std::move(compositor_frame_sink));
|
|
|
| EXPECT_EQ(0u, context3d->NumTextures());
|
|
|
| @@ -8048,7 +8048,7 @@ TEST_F(LayerTreeHostImplTest, CreateETC1UIResource) {
|
| std::unique_ptr<TestWebGraphicsContext3D> context =
|
| TestWebGraphicsContext3D::Create();
|
| TestWebGraphicsContext3D* context3d = context.get();
|
| - CreateHostImpl(DefaultSettings(), FakeOutputSurface::CreateDelegating3d());
|
| + CreateHostImpl(DefaultSettings(), FakeCompositorFrameSink::Create3d());
|
|
|
| EXPECT_EQ(0u, context3d->NumTextures());
|
|
|
| @@ -8077,7 +8077,7 @@ TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) {
|
|
|
| CreateHostImpl(
|
| DefaultSettings(),
|
| - base::MakeUnique<TestDelegatingOutputSurface>(
|
| + base::MakeUnique<TestCompositorFrameSink>(
|
| context_provider, TestContextProvider::CreateWorker(),
|
| FakeOutputSurface::Create3d(context_provider), nullptr, nullptr,
|
| RendererSettings(), base::ThreadTaskRunnerHandle::Get().get(),
|
| @@ -8102,7 +8102,7 @@ TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) {
|
| EXPECT_FALSE(context_provider->HasOneRef());
|
| EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures());
|
|
|
| - host_impl_->ReleaseOutputSurface();
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = nullptr;
|
|
|
| // The CopyOutputResult's callback was cancelled, the CopyOutputResult
|
| @@ -8533,8 +8533,9 @@ TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) {
|
| host_impl_->active_tree()->SetRootLayerForTesting(std::move(root));
|
| host_impl_->active_tree()->BuildPropertyTreesForTesting();
|
|
|
| - FakeOutputSurface* fake_output_surface =
|
| - static_cast<FakeOutputSurface*>(host_impl_->output_surface());
|
| + FakeCompositorFrameSink* fake_compositor_frame_sink =
|
| + static_cast<FakeCompositorFrameSink*>(
|
| + host_impl_->compositor_frame_sink());
|
|
|
| ui::LatencyInfo latency_info;
|
| latency_info.AddLatencyNumber(
|
| @@ -8550,7 +8551,7 @@ TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) {
|
| host_impl_->DidDrawAllLayers(frame);
|
|
|
| const std::vector<ui::LatencyInfo>& metadata_latency_after =
|
| - fake_output_surface->last_sent_frame()->metadata.latency_info;
|
| + fake_compositor_frame_sink->last_sent_frame()->metadata.latency_info;
|
| EXPECT_EQ(1u, metadata_latency_after.size());
|
| EXPECT_TRUE(metadata_latency_after[0].FindLatency(
|
| ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, NULL));
|
| @@ -8569,8 +8570,9 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) {
|
| host_impl_->active_tree()->BuildPropertyTreesForTesting();
|
|
|
| // Ensure the default frame selection bounds are empty.
|
| - FakeOutputSurface* fake_output_surface =
|
| - static_cast<FakeOutputSurface*>(host_impl_->output_surface());
|
| + FakeCompositorFrameSink* fake_compositor_frame_sink =
|
| + static_cast<FakeCompositorFrameSink*>(
|
| + host_impl_->compositor_frame_sink());
|
|
|
| // Plumb the layer-local selection bounds.
|
| gfx::Point selection_top(5, 0);
|
| @@ -8594,7 +8596,7 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) {
|
|
|
| // Ensure the selection bounds have propagated to the frame metadata.
|
| const Selection<gfx::SelectionBound>& selection_after =
|
| - fake_output_surface->last_sent_frame()->metadata.selection;
|
| + fake_compositor_frame_sink->last_sent_frame()->metadata.selection;
|
| EXPECT_EQ(selection.start.type, selection_after.start.type());
|
| EXPECT_EQ(selection.end.type, selection_after.end.type());
|
| EXPECT_EQ(gfx::PointF(selection_bottom), selection_after.start.edge_bottom());
|
| @@ -8727,7 +8729,7 @@ class LayerTreeHostImplWithTopControlsTest : public LayerTreeHostImplTest {
|
| public:
|
| void SetUp() override {
|
| LayerTreeSettings settings = DefaultSettings();
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| host_impl_->active_tree()->set_top_controls_height(top_controls_height_);
|
| host_impl_->sync_tree()->set_top_controls_height(top_controls_height_);
|
| host_impl_->active_tree()->SetCurrentTopControlsShownRatio(1.f);
|
| @@ -9638,7 +9640,7 @@ class LayerTreeHostImplWithImplicitLimitsTest : public LayerTreeHostImplTest {
|
| void SetUp() override {
|
| LayerTreeSettings settings = DefaultSettings();
|
| settings.max_memory_for_prepaint_percentage = 50;
|
| - CreateHostImpl(settings, CreateOutputSurface());
|
| + CreateHostImpl(settings, CreateCompositorFrameSink());
|
| }
|
| };
|
|
|
| @@ -9743,8 +9745,8 @@ TEST_F(LayerTreeHostImplTest, OnDrawConstraintSetNeedsRedraw) {
|
|
|
| class ResourcelessSoftwareLayerTreeHostImplTest : public LayerTreeHostImplTest {
|
| protected:
|
| - std::unique_ptr<OutputSurface> CreateOutputSurface() override {
|
| - return FakeOutputSurface::CreateDelegating3d();
|
| + std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() override {
|
| + return FakeCompositorFrameSink::Create3d();
|
| }
|
| };
|
|
|
| @@ -10739,7 +10741,9 @@ TEST_F(LayerTreeHostImplTest, WheelScrollWithPageScaleFactorOnInnerLayer) {
|
| class LayerTreeHostImplCountingLostSurfaces : public LayerTreeHostImplTest {
|
| public:
|
| LayerTreeHostImplCountingLostSurfaces() : num_lost_surfaces_(0) {}
|
| - void DidLoseOutputSurfaceOnImplThread() override { num_lost_surfaces_++; }
|
| + void DidLoseCompositorFrameSinkOnImplThread() override {
|
| + num_lost_surfaces_++;
|
| + }
|
|
|
| protected:
|
| int num_lost_surfaces_;
|
| @@ -10750,9 +10754,9 @@ TEST_F(LayerTreeHostImplCountingLostSurfaces, TwiceLostSurface) {
|
| // we go from having a valid output surface to not having a valid output
|
| // surface.
|
| EXPECT_EQ(0, num_lost_surfaces_);
|
| - host_impl_->DidLoseOutputSurface();
|
| + host_impl_->DidLoseCompositorFrameSink();
|
| EXPECT_EQ(1, num_lost_surfaces_);
|
| - host_impl_->DidLoseOutputSurface();
|
| + host_impl_->DidLoseCompositorFrameSink();
|
| EXPECT_LE(1, num_lost_surfaces_);
|
| }
|
|
|
| @@ -10987,9 +10991,8 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusModes) {
|
|
|
| LayerTreeSettings msaaSettings = GpuRasterizationEnabledSettings();
|
| msaaSettings.gpu_rasterization_msaa_sample_count = 4;
|
| - EXPECT_TRUE(CreateHostImpl(
|
| - msaaSettings,
|
| - FakeOutputSurface::CreateDelegating3d(std::move(context_with_msaa))));
|
| + EXPECT_TRUE(CreateHostImpl(msaaSettings, FakeCompositorFrameSink::Create3d(
|
| + std::move(context_with_msaa))));
|
| host_impl_->SetHasGpuRasterizationTrigger(true);
|
| host_impl_->SetContentIsSuitableForGpuRasterization(false);
|
| host_impl_->CommitComplete();
|
| @@ -11000,8 +11003,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusModes) {
|
|
|
| LayerTreeSettings settings = DefaultSettings();
|
| settings.gpu_rasterization_enabled = false;
|
| - EXPECT_TRUE(
|
| - CreateHostImpl(settings, FakeOutputSurface::CreateDelegating3d()));
|
| + EXPECT_TRUE(CreateHostImpl(settings, FakeCompositorFrameSink::Create3d()));
|
| host_impl_->SetHasGpuRasterizationTrigger(true);
|
| host_impl_->SetContentIsSuitableForGpuRasterization(true);
|
| host_impl_->CommitComplete();
|
| @@ -11010,8 +11012,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusModes) {
|
| EXPECT_FALSE(host_impl_->use_gpu_rasterization());
|
|
|
| settings.gpu_rasterization_forced = true;
|
| - EXPECT_TRUE(
|
| - CreateHostImpl(settings, FakeOutputSurface::CreateDelegating3d()));
|
| + EXPECT_TRUE(CreateHostImpl(settings, FakeCompositorFrameSink::Create3d()));
|
|
|
| host_impl_->SetHasGpuRasterizationTrigger(false);
|
| host_impl_->SetContentIsSuitableForGpuRasterization(false);
|
| @@ -11030,10 +11031,10 @@ class MsaaIsSlowLayerTreeHostImplTest : public LayerTreeHostImplTest {
|
| auto context_provider = TestContextProvider::Create();
|
| context_provider->UnboundTestContext3d()->SetMaxSamples(4);
|
| context_provider->UnboundTestContext3d()->set_msaa_is_slow(msaa_is_slow);
|
| - auto msaa_is_normal_output_surface =
|
| - FakeOutputSurface::CreateDelegating3d(context_provider);
|
| - EXPECT_TRUE(
|
| - CreateHostImpl(settings, std::move(msaa_is_normal_output_surface)));
|
| + auto msaa_is_normal_compositor_frame_sink =
|
| + FakeCompositorFrameSink::Create3d(context_provider);
|
| + EXPECT_TRUE(CreateHostImpl(
|
| + settings, std::move(msaa_is_normal_compositor_frame_sink)));
|
| }
|
| };
|
|
|
| @@ -11060,12 +11061,12 @@ TEST_F(MsaaIsSlowLayerTreeHostImplTest, GpuRasterizationStatusMsaaIsSlow) {
|
| }
|
|
|
| // A mock output surface which lets us detect calls to ForceReclaimResources.
|
| -class MockReclaimResourcesOutputSurface : public FakeOutputSurface {
|
| +class MockReclaimResourcesCompositorFrameSink : public FakeCompositorFrameSink {
|
| public:
|
| - MockReclaimResourcesOutputSurface()
|
| - : FakeOutputSurface(TestContextProvider::Create(),
|
| - TestContextProvider::CreateWorker(),
|
| - true) {}
|
| + MockReclaimResourcesCompositorFrameSink()
|
| + : FakeCompositorFrameSink(TestContextProvider::Create(),
|
| + TestContextProvider::CreateWorker(),
|
| + true) {}
|
|
|
| MOCK_METHOD0(ForceReclaimResources, void());
|
| };
|
| @@ -11075,12 +11076,14 @@ class MockReclaimResourcesOutputSurface : public FakeOutputSurface {
|
| // ensures that BeginCommit triggers ForceReclaimResources. See
|
| // crbug.com/489515.
|
| TEST_F(LayerTreeHostImplTest, BeginCommitReclaimsResources) {
|
| - auto output_surface = base::MakeUnique<MockReclaimResourcesOutputSurface>();
|
| + auto compositor_frame_sink =
|
| + base::MakeUnique<MockReclaimResourcesCompositorFrameSink>();
|
| // Hold an unowned pointer to the output surface to use for mock expectations.
|
| - MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get();
|
| + MockReclaimResourcesCompositorFrameSink* mock_compositor_frame_sink =
|
| + compositor_frame_sink.get();
|
|
|
| - CreateHostImpl(DefaultSettings(), std::move(output_surface));
|
| - EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1);
|
| + CreateHostImpl(DefaultSettings(), std::move(compositor_frame_sink));
|
| + EXPECT_CALL(*mock_compositor_frame_sink, ForceReclaimResources()).Times(1);
|
| host_impl_->BeginCommit();
|
| }
|
|
|
| @@ -11226,11 +11229,13 @@ TEST_F(LayerTreeHostImplTest, JitterTest) {
|
| }
|
| }
|
|
|
| -// Checks that if we lose a GPU raster enabled OutputSurface and replace it
|
| -// with a software OutputSurface, LayerTreeHostImpl correctly re-computes GPU
|
| +// Checks that if we lose a GPU raster enabled CompositorFrameSink and replace
|
| +// it
|
| +// with a software CompositorFrameSink, LayerTreeHostImpl correctly re-computes
|
| +// GPU
|
| // rasterization status.
|
| -TEST_F(LayerTreeHostImplTest, RecomputeGpuRasterOnOutputSurfaceChange) {
|
| - host_impl_->ReleaseOutputSurface();
|
| +TEST_F(LayerTreeHostImplTest, RecomputeGpuRasterOnCompositorFrameSinkChange) {
|
| + host_impl_->ReleaseCompositorFrameSink();
|
| host_impl_ = nullptr;
|
|
|
| LayerTreeSettings settings = DefaultSettings();
|
| @@ -11243,14 +11248,14 @@ TEST_F(LayerTreeHostImplTest, RecomputeGpuRasterOnOutputSurfaceChange) {
|
| host_impl_->SetVisible(true);
|
|
|
| // InitializeRenderer with a gpu-raster enabled output surface.
|
| - auto gpu_raster_output_surface =
|
| - FakeOutputSurface::CreateDelegating3d(TestWebGraphicsContext3D::Create());
|
| - host_impl_->InitializeRenderer(gpu_raster_output_surface.get());
|
| + auto gpu_raster_compositor_frame_sink =
|
| + FakeCompositorFrameSink::Create3d(TestWebGraphicsContext3D::Create());
|
| + host_impl_->InitializeRenderer(gpu_raster_compositor_frame_sink.get());
|
| EXPECT_TRUE(host_impl_->use_gpu_rasterization());
|
|
|
| // Re-initialize with a software output surface.
|
| - output_surface_ = FakeOutputSurface::CreateDelegatingSoftware();
|
| - host_impl_->InitializeRenderer(output_surface_.get());
|
| + compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware();
|
| + host_impl_->InitializeRenderer(compositor_frame_sink_.get());
|
| EXPECT_FALSE(host_impl_->use_gpu_rasterization());
|
| }
|
|
|
|
|