Chromium Code Reviews| Index: blimp/client/core/compositor/blimp_compositor.cc |
| diff --git a/blimp/client/core/compositor/blimp_compositor.cc b/blimp/client/core/compositor/blimp_compositor.cc |
| index 370047a6e03c73a85aca3bf0b77e3e04a6074f5e..4db83202f1bc3ff84cafbe9892300282cd3294ed 100644 |
| --- a/blimp/client/core/compositor/blimp_compositor.cc |
| +++ b/blimp/client/core/compositor/blimp_compositor.cc |
| @@ -15,13 +15,13 @@ |
| #include "base/threading/thread_restrictions.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" |
| -#include "blimp/client/core/compositor/delegated_output_surface.h" |
| +#include "blimp/client/core/compositor/blimp_compositor_frame_sink.h" |
| #include "blimp/client/public/compositor/compositor_dependencies.h" |
| #include "blimp/net/blimp_stats.h" |
| #include "cc/animation/animation_host.h" |
| #include "cc/layers/layer.h" |
| #include "cc/layers/surface_layer.h" |
| -#include "cc/output/output_surface.h" |
| +#include "cc/output/compositor_frame_sink.h" |
| #include "cc/proto/compositor_message.pb.h" |
| #include "cc/surfaces/surface.h" |
| #include "cc/surfaces/surface_factory.h" |
| @@ -64,8 +64,8 @@ BlimpCompositor::BlimpCompositor( |
| : render_widget_id_(render_widget_id), |
| client_(client), |
| compositor_dependencies_(compositor_dependencies), |
| - output_surface_(nullptr), |
| - output_surface_request_pending_(false), |
| + proxy_client_(nullptr), |
| + compositor_frame_sink_request_pending_(false), |
| layer_(cc::Layer::Create()), |
| remote_proto_channel_receiver_(nullptr), |
| weak_ptr_factory_(this) { |
| @@ -96,18 +96,18 @@ bool BlimpCompositor::OnTouchEvent(const ui::MotionEvent& motion_event) { |
| return false; |
| } |
| -void BlimpCompositor::RequestNewOutputSurface() { |
| +void BlimpCompositor::RequestNewCompositorFrameSink() { |
| DCHECK(!surface_factory_); |
| - DCHECK(!output_surface_request_pending_); |
| + DCHECK(!compositor_frame_sink_request_pending_); |
| - output_surface_request_pending_ = true; |
| + compositor_frame_sink_request_pending_ = true; |
| GetEmbedderDeps()->GetContextProviders( |
| base::Bind(&BlimpCompositor::OnContextProvidersCreated, |
| weak_ptr_factory_.GetWeakPtr())); |
| } |
| -void BlimpCompositor::DidInitializeOutputSurface() { |
| - output_surface_request_pending_ = false; |
| +void BlimpCompositor::DidInitializeCompositorFrameSink() { |
| + compositor_frame_sink_request_pending_ = false; |
| } |
| void BlimpCompositor::DidCommitAndDrawFrame() { |
| @@ -147,13 +147,13 @@ void BlimpCompositor::OnCompositorMessageReceived( |
| void BlimpCompositor::OnContextProvidersCreated( |
| const scoped_refptr<cc::ContextProvider>& compositor_context_provider, |
| const scoped_refptr<cc::ContextProvider>& worker_context_provider) { |
| - DCHECK(!surface_factory_) |
| - << "Any connection to the old output surface should have been destroyed"; |
| + DCHECK(!surface_factory_) << "Any connection to the old CompositorFrameSink " |
| + "should have been destroyed"; |
| // Make sure we still have a host and we're still expecting an output surface. |
| // This can happen if the host dies while the request is outstanding and we |
| // build a new one that hasn't asked for a surface yet. |
| - if (!output_surface_request_pending_) |
| + if (!compositor_frame_sink_request_pending_) |
| return; |
| // Try again if the context creation failed. |
| @@ -164,13 +164,12 @@ void BlimpCompositor::OnContextProvidersCreated( |
| return; |
| } |
| - std::unique_ptr<DelegatedOutputSurface> delegated_output_surface = |
| - base::MakeUnique<DelegatedOutputSurface>( |
| - std::move(compositor_context_provider), |
| - std::move(worker_context_provider), |
| - base::ThreadTaskRunnerHandle::Get(), weak_ptr_factory_.GetWeakPtr()); |
| + auto compositor_frame_sink = base::MakeUnique<BlimpCompositorFrameSink>( |
| + std::move(compositor_context_provider), |
| + std::move(worker_context_provider), base::ThreadTaskRunnerHandle::Get(), |
| + weak_ptr_factory_.GetWeakPtr()); |
| - host_->SetOutputSurface(std::move(delegated_output_surface)); |
| + host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| } |
| void BlimpCompositor::SendWebGestureEvent( |
| @@ -178,12 +177,12 @@ void BlimpCompositor::SendWebGestureEvent( |
| client_->SendWebGestureEvent(render_widget_id_, gesture_event); |
| } |
| -void BlimpCompositor::BindToOutputSurface( |
| - base::WeakPtr<BlimpOutputSurface> output_surface) { |
| +void BlimpCompositor::BindToProxyClient( |
| + base::WeakPtr<BlimpCompositorFrameSinkProxyClient> proxy_client) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DCHECK(!surface_factory_); |
| - output_surface_ = output_surface; |
| + proxy_client_ = proxy_client; |
| surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( |
| GetEmbedderDeps()->GetSurfaceManager(), this); |
| } |
| @@ -222,21 +221,23 @@ void BlimpCompositor::SwapCompositorFrame(cc::CompositorFrame frame) { |
| base::Closure()); |
| } |
| -void BlimpCompositor::UnbindOutputSurface() { |
| +void BlimpCompositor::UnbindProxyClient() { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DCHECK(surface_factory_); |
| DestroyDelegatedContent(); |
| surface_factory_.reset(); |
| - output_surface_ = nullptr; |
| + proxy_client_ = nullptr; |
| } |
| void BlimpCompositor::ReturnResources( |
| const cc::ReturnedResourceArray& resources) { |
| DCHECK(surface_factory_); |
| compositor_dependencies_->GetCompositorTaskRunner()->PostTask( |
| - FROM_HERE, base::Bind(&BlimpOutputSurface::ReclaimCompositorResources, |
| - output_surface_, resources)); |
| + FROM_HERE, |
| + base::Bind( |
| + &BlimpCompositorFrameSinkProxyClient::ReclaimCompositorResources, |
| + proxy_client_, resources)); |
| } |
| CompositorDependencies* BlimpCompositor::GetEmbedderDeps() { |
| @@ -271,7 +272,7 @@ void BlimpCompositor::CreateLayerTreeHost() { |
| compositor_dependencies_->GetLayerTreeSettings(); |
| // TODO(khushalsagar): This is a hack. Remove when we move the split point |
| // out. For details on why this is needed, see crbug.com/586210. |
| - settings->abort_commit_before_output_surface_creation = false; |
| + settings->abort_commit_before_compositor_frame_sink_creation = false; |
| params.settings = settings; |
| params.animation_host = cc::AnimationHost::CreateMainInstance(); |
| @@ -306,9 +307,10 @@ void BlimpCompositor::DestroyLayerTreeHost() { |
| // BlimpInputManager. |
| input_manager_.reset(); |
| - // Cancel any outstanding OutputSurface requests. That way if we get an async |
| + // Cancel any outstanding CompositorFrameSink requests. That way if we get an |
| + // async |
|
Khushal
2016/09/14 03:10:35
Pretty comment is not pretty. :(
danakj
2016/09/14 17:17:12
Done.
|
| // callback related to the old request we know to drop it. |
| - output_surface_request_pending_ = false; |
| + compositor_frame_sink_request_pending_ = false; |
| // Make sure we don't have a receiver at this point. |
| DCHECK(!remote_proto_channel_receiver_); |