summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 02:49:15 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 02:49:15 +0000
commitd15d96236c279c9d490dda55ef176416e17c56d1 (patch)
tree51592921aff4666ea762ca17c75546c39743abdb /cc
parente6ba52b54d2616d5ed32f96c89a53fea1d159bc1 (diff)
downloadchromium_src-d15d96236c279c9d490dda55ef176416e17c56d1.zip
chromium_src-d15d96236c279c9d490dda55ef176416e17c56d1.tar.gz
chromium_src-d15d96236c279c9d490dda55ef176416e17c56d1.tar.bz2
Remove NULL ResourceProvider, TileManager early outs
These early outs were added in r201247 as part of resourceless software mode in which ResourceProvider and TileManager were not created. This is no longer the case after r207424, so remove these early outs. For Android WebView, this does not affect software mode, and does not make hardware any more broken than it already is. BUG=245935 Review URL: https://chromiumcodereview.appspot.com/17176012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/picture_layer_impl.cc2
-rw-r--r--cc/trees/layer_tree_host_impl.cc9
-rw-r--r--cc/trees/thread_proxy.cc57
3 files changed, 22 insertions, 46 deletions
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index f0edaa6..73131ae 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1008,8 +1008,6 @@ bool PictureLayerImpl::CanHaveTilings() const {
return false;
if (pile_->recorded_region().IsEmpty())
return false;
- if (!layer_tree_impl()->tile_manager())
- return false;
if (draw_properties().can_draw_directly_to_backbuffer &&
layer_tree_impl()->settings().force_direct_layer_drawing)
return false;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 5096b66f..4fe0871 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -751,10 +751,8 @@ bool LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame);
if (!output_surface_->ForcedDrawToSoftwareDevice())
renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes);
- if (renderer_) {
- RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()),
- frame);
- }
+ RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()),
+ frame);
// If we're making a frame to draw, it better have at least one render pass.
DCHECK(!frame->render_passes.empty());
@@ -1222,8 +1220,7 @@ void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) {
// Once all layers have been drawn, pending texture uploads should no
// longer block future uploads.
- if (resource_provider_)
- resource_provider_->MarkPendingUploadsAsNonBlocking();
+ resource_provider_->MarkPendingUploadsAsNonBlocking();
}
void LayerTreeHostImpl::FinishAllRendering() {
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 54d8105..521d4cc 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -351,12 +351,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();
}
@@ -424,8 +420,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,
@@ -448,8 +442,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());
@@ -806,10 +798,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()->
@@ -827,21 +817,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::ImplThreadTaskRunner(),
- 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::ImplThreadTaskRunner(),
+ queue.Pass(),
+ layer_tree_host_impl_->resource_provider());
+ current_resource_update_controller_on_impl_thread_->PerformMoreUpdates(
+ scheduler_on_impl_thread_->AnticipatedDrawTime());
}
void ThreadProxy::BeginFrameAbortedByMainThreadOnImplThread() {
@@ -857,11 +840,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());
@@ -1237,10 +1220,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();
}