| Index: cc/trees/thread_proxy.cc
|
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
|
| index 980f1d4aeea2cdec6e9a06c549b2fa091bd70dd6..12e652d3df9b36c54d01eb11c5753f245de9a6d5 100644
|
| --- a/cc/trees/thread_proxy.cc
|
| +++ b/cc/trees/thread_proxy.cc
|
| @@ -338,12 +338,8 @@ void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() {
|
| TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread");
|
| if (!layer_tree_host_impl_->IsContextLost())
|
| return;
|
| - cc::ContextProvider* offscreen_contexts =
|
| - layer_tree_host_impl_->resource_provider() ?
|
| - layer_tree_host_impl_->resource_provider()->
|
| - offscreen_context_provider() : NULL;
|
| -
|
| - if (offscreen_contexts)
|
| + if (cc::ContextProvider* offscreen_contexts = layer_tree_host_impl_
|
| + ->resource_provider()->offscreen_context_provider())
|
| offscreen_contexts->VerifyContexts();
|
| scheduler_on_impl_thread_->DidLoseOutputSurface();
|
| }
|
| @@ -408,8 +404,6 @@ bool ThreadProxy::ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes,
|
|
|
| if (!layer_tree_host_->contents_texture_manager())
|
| return false;
|
| - if (!layer_tree_host_impl_->resource_provider())
|
| - return false;
|
|
|
| bool reduce_result = layer_tree_host_->contents_texture_manager()->
|
| ReduceMemoryOnImplThread(limit_bytes,
|
| @@ -432,8 +426,6 @@ void ThreadProxy::ReduceWastedContentsTextureMemoryOnImplThread() {
|
|
|
| if (!layer_tree_host_->contents_texture_manager())
|
| return;
|
| - if (!layer_tree_host_impl_->resource_provider())
|
| - return;
|
|
|
| layer_tree_host_->contents_texture_manager()->ReduceWastedMemoryOnImplThread(
|
| layer_tree_host_impl_->resource_provider());
|
| @@ -779,10 +771,8 @@ void ThreadProxy::StartCommitOnImplThread(
|
|
|
| if (offscreen_context_provider.get())
|
| offscreen_context_provider->BindToCurrentThread();
|
| - if (layer_tree_host_impl_->resource_provider()) {
|
| - layer_tree_host_impl_->resource_provider()->
|
| - set_offscreen_context_provider(offscreen_context_provider);
|
| - }
|
| + layer_tree_host_impl_->resource_provider()->
|
| + set_offscreen_context_provider(offscreen_context_provider);
|
|
|
| if (layer_tree_host_->contents_texture_manager()) {
|
| if (layer_tree_host_->contents_texture_manager()->
|
| @@ -800,21 +790,14 @@ void ThreadProxy::StartCommitOnImplThread(
|
| }
|
|
|
| commit_completion_event_on_impl_thread_ = completion;
|
| - if (layer_tree_host_impl_->resource_provider()) {
|
| - current_resource_update_controller_on_impl_thread_ =
|
| - ResourceUpdateController::Create(
|
| - this,
|
| - Proxy::ImplThread()->TaskRunner(),
|
| - queue.Pass(),
|
| - layer_tree_host_impl_->resource_provider());
|
| - current_resource_update_controller_on_impl_thread_->PerformMoreUpdates(
|
| - scheduler_on_impl_thread_->AnticipatedDrawTime());
|
| - } else {
|
| - // Normally the ResourceUpdateController notifies when commit should
|
| - // finish, but in tile-free software rendering there is no resource
|
| - // update step so jump straight to the notification.
|
| - scheduler_on_impl_thread_->FinishCommit();
|
| - }
|
| + current_resource_update_controller_on_impl_thread_ =
|
| + ResourceUpdateController::Create(
|
| + this,
|
| + Proxy::ImplThread()->TaskRunner(),
|
| + queue.Pass(),
|
| + layer_tree_host_impl_->resource_provider());
|
| + current_resource_update_controller_on_impl_thread_->PerformMoreUpdates(
|
| + scheduler_on_impl_thread_->AnticipatedDrawTime());
|
| }
|
|
|
| void ThreadProxy::BeginFrameAbortedByMainThreadOnImplThread() {
|
| @@ -830,11 +813,11 @@ void ThreadProxy::ScheduledActionCommit() {
|
| TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit");
|
| DCHECK(IsImplThread());
|
| DCHECK(commit_completion_event_on_impl_thread_);
|
| - if (current_resource_update_controller_on_impl_thread_) {
|
| - // Complete all remaining texture updates.
|
| - current_resource_update_controller_on_impl_thread_->Finalize();
|
| - current_resource_update_controller_on_impl_thread_.reset();
|
| - }
|
| + DCHECK(current_resource_update_controller_on_impl_thread_);
|
| +
|
| + // Complete all remaining texture updates.
|
| + current_resource_update_controller_on_impl_thread_->Finalize();
|
| + current_resource_update_controller_on_impl_thread_.reset();
|
|
|
| layer_tree_host_impl_->BeginCommit();
|
| layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get());
|
| @@ -1206,10 +1189,8 @@ void ThreadProxy::DidTryInitializeRendererOnImplThread(
|
| offscreen_context_provider->BindToCurrentThread();
|
|
|
| if (success) {
|
| - if (layer_tree_host_impl_->resource_provider()) {
|
| - layer_tree_host_impl_->resource_provider()->
|
| - set_offscreen_context_provider(offscreen_context_provider);
|
| - }
|
| + layer_tree_host_impl_->resource_provider()->
|
| + set_offscreen_context_provider(offscreen_context_provider);
|
| } else if (offscreen_context_provider.get()) {
|
| offscreen_context_provider->VerifyContexts();
|
| }
|
|
|