| 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 ac3754e0a510adfeff87e0010f265420abaac847..ef465198377af77017188965bb8d348df1924e17 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));
 | 
|  
 | 
| @@ -1417,8 +1419,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));
 | 
| @@ -1461,7 +1463,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;
 | 
|  }
 | 
|  
 | 
| @@ -1703,8 +1705,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);
 | 
| @@ -1770,7 +1771,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);
 | 
| @@ -1824,8 +1825,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);
 | 
| @@ -1886,8 +1886,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);
 | 
| @@ -2730,7 +2729,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);
 | 
| @@ -2740,9 +2739,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);
 | 
| @@ -2968,7 +2967,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 =
 | 
| @@ -3057,7 +3056,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);
 | 
| @@ -3094,7 +3093,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);
 | 
| @@ -3222,7 +3221,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);
 | 
|  
 | 
| @@ -3839,8 +3838,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;
 | 
| @@ -3956,10 +3954,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);
 | 
| @@ -3973,7 +3972,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);
 | 
| @@ -4384,7 +4383,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();
 | 
| @@ -4417,7 +4416,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();
 | 
| @@ -4466,7 +4465,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();
 | 
| @@ -4698,7 +4697,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();
 | 
| @@ -5961,7 +5960,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;
 | 
|  }
 | 
|  
 | 
| @@ -6256,7 +6255,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 =
 | 
| @@ -6350,7 +6349,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);
 | 
| @@ -6518,7 +6517,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);
 | 
| @@ -6939,10 +6938,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() {
 | 
| @@ -7158,7 +7158,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();
 | 
| @@ -7172,7 +7172,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_));
 | 
| @@ -7187,7 +7187,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();
 | 
| @@ -7204,7 +7204,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();
 | 
| @@ -7245,9 +7245,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.
 | 
| @@ -7259,7 +7260,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));
 | 
| @@ -7286,7 +7287,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).
 | 
| @@ -7307,7 +7308,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.
 | 
| @@ -7320,9 +7321,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) {
 | 
| @@ -7382,14 +7383,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));
 | 
| @@ -7455,12 +7456,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));
 | 
| @@ -7477,7 +7478,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) {
 | 
| @@ -7486,12 +7487,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));
 | 
| @@ -7508,16 +7509,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);
 | 
| @@ -7595,11 +7596,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) {
 | 
| @@ -7641,7 +7641,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());
 | 
| @@ -7803,7 +7803,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;
 | 
| @@ -7835,7 +7835,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;
 | 
| @@ -7869,10 +7869,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);
 | 
| @@ -7898,9 +7898,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);
 | 
| @@ -7984,9 +7984,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));
 | 
|    }
 | 
|  
 | 
| @@ -8005,9 +8005,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());
 | 
|  
 | 
| @@ -8049,7 +8049,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());
 | 
|  
 | 
| @@ -8078,7 +8078,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(),
 | 
| @@ -8103,7 +8103,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
 | 
| @@ -8534,8 +8534,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(
 | 
| @@ -8551,7 +8552,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));
 | 
| @@ -8570,8 +8571,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);
 | 
| @@ -8595,7 +8597,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());
 | 
| @@ -8731,7 +8733,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);
 | 
| @@ -9642,7 +9644,7 @@ class LayerTreeHostImplWithImplicitLimitsTest : public LayerTreeHostImplTest {
 | 
|    void SetUp() override {
 | 
|      LayerTreeSettings settings = DefaultSettings();
 | 
|      settings.max_memory_for_prepaint_percentage = 50;
 | 
| -    CreateHostImpl(settings, CreateOutputSurface());
 | 
| +    CreateHostImpl(settings, CreateCompositorFrameSink());
 | 
|    }
 | 
|  };
 | 
|  
 | 
| @@ -9747,8 +9749,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();
 | 
|    }
 | 
|  };
 | 
|  
 | 
| @@ -10743,7 +10745,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_;
 | 
| @@ -10754,9 +10758,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_);
 | 
|  }
 | 
|  
 | 
| @@ -10991,9 +10995,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();
 | 
| @@ -11004,8 +11007,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();
 | 
| @@ -11014,8 +11016,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);
 | 
| @@ -11034,10 +11035,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)));
 | 
|    }
 | 
|  };
 | 
|  
 | 
| @@ -11064,12 +11065,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());
 | 
|  };
 | 
| @@ -11079,12 +11080,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();
 | 
|  }
 | 
|  
 | 
| @@ -11230,11 +11233,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();
 | 
| @@ -11247,14 +11252,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());
 | 
|  }
 | 
|  
 | 
| 
 |