Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: cc/trees/thread_proxy.cc

Issue 1194623003: cc: Remove contents_texture_manager from LayerTreeHost(Impl) and proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contentstexturemanager: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index c9bd06f7d13c867ca3fb2ae4f256b5e1c9462e36..8ce9c3773463946ba6b71ee4a9093a15f273df19 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -97,18 +97,12 @@ ThreadProxy::MainThreadOrBlockedMainThread::MainThreadOrBlockedMainThread(
ThreadProxy::MainThreadOrBlockedMainThread::~MainThreadOrBlockedMainThread() {}
-PrioritizedResourceManager*
-ThreadProxy::MainThreadOrBlockedMainThread::contents_texture_manager() {
- return layer_tree_host->contents_texture_manager();
-}
-
ThreadProxy::CompositorThreadOnly::CompositorThreadOnly(
ThreadProxy* proxy,
int layer_tree_host_id,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
scoped_ptr<BeginFrameSource> external_begin_frame_source)
: layer_tree_host_id(layer_tree_host_id),
- contents_texture_manager(NULL),
commit_completion_event(NULL),
completion_event_for_commit_held_on_tree_activation(NULL),
next_frame_is_newly_committed_frame(false),
@@ -212,22 +206,6 @@ void ThreadProxy::DidLoseOutputSurface() {
TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface");
DCHECK(IsMainThread());
layer_tree_host()->DidLoseOutputSurface();
-
- {
- DebugScopedSetMainThreadBlocked main_thread_blocked(this);
-
- // Return lost resources to their owners immediately.
- BlockingTaskRunner::CapturePostTasks blocked(
- blocking_main_thread_task_runner());
-
- CompletionEvent completion;
- Proxy::ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadProxy::DeleteContentsTexturesOnImplThread,
- impl_thread_weak_ptr_,
- &completion));
- completion.Wait();
- }
}
void ThreadProxy::RequestNewOutputSurface() {
@@ -421,32 +399,6 @@ void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread(
base::Passed(&events)));
}
-bool ThreadProxy::ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes,
- int priority_cutoff) {
- DCHECK(IsImplThread());
-
- if (!impl().contents_texture_manager)
- return false;
- if (!impl().layer_tree_host_impl->resource_provider())
- return false;
-
- bool reduce_result =
- impl().contents_texture_manager->ReduceMemoryOnImplThread(
- limit_bytes,
- priority_cutoff,
- impl().layer_tree_host_impl->resource_provider());
- if (!reduce_result)
- return false;
-
- // The texture upload queue may reference textures that were just purged,
- // clear them from the queue.
- if (impl().current_resource_update_controller) {
- impl()
- .current_resource_update_controller->DiscardUploadsToEvictedResources();
- }
- return true;
-}
-
bool ThreadProxy::IsInsideDraw() { return impl().inside_draw; }
void ThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) {
@@ -796,17 +748,6 @@ void ThreadProxy::BeginMainFrame(
layer_tree_host()->AnimateLayers(
begin_main_frame_state->begin_frame_args.frame_time);
- // Unlink any backings that the impl thread has evicted, so that we know to
- // re-paint them in UpdateLayers.
- if (blocked_main().contents_texture_manager()) {
- blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings();
-
- blocked_main().contents_texture_manager()->SetMaxMemoryLimitBytes(
- begin_main_frame_state->memory_allocation_limit_bytes);
- blocked_main().contents_texture_manager()->SetExternalPriorityCutoff(
- begin_main_frame_state->memory_allocation_priority_cutoff);
- }
-
// Recreate all UI resources if there were evicted UI resources when the impl
// thread initiated the commit.
if (begin_main_frame_state->evicted_ui_resources)
@@ -916,28 +857,6 @@ void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion,
scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
- if (impl().contents_texture_manager) {
- DCHECK_EQ(impl().contents_texture_manager,
- blocked_main().contents_texture_manager());
- } else {
- // Cache this pointer that was created on the main thread side to avoid a
- // data race between creating it and using it on the compositor thread.
- impl().contents_texture_manager = blocked_main().contents_texture_manager();
- }
-
- if (impl().contents_texture_manager) {
- if (impl().contents_texture_manager->LinkedEvictedBackingsExist()) {
- // Clear any uploads we were making to textures linked to evicted
- // resources
- queue->ClearUploadsToEvictedResources();
- // Some textures in the layer tree are invalid. Kick off another commit
- // to fill them again.
- SetNeedsCommitOnImplThread();
- }
-
- impl().contents_texture_manager->PushTexturePrioritiesToBackings();
- }
-
impl().commit_completion_event = completion;
impl().current_resource_update_controller = ResourceUpdateController::Create(
this,
@@ -1213,16 +1132,6 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
completion->Signal();
}
-void ThreadProxy::DeleteContentsTexturesOnImplThread(
- CompletionEvent* completion) {
- TRACE_EVENT0("cc", "ThreadProxy::DeleteContentsTexturesOnImplThread");
- DCHECK(IsImplThread());
- DCHECK(IsMainThreadBlocked());
- layer_tree_host()->DeleteContentsTexturesOnImplThread(
- impl().layer_tree_host_impl->resource_provider());
- completion->Signal();
-}
-
void ThreadProxy::InitializeOutputSurfaceOnImplThread(
scoped_ptr<OutputSurface> output_surface) {
TRACE_EVENT0("cc", "ThreadProxy::InitializeOutputSurfaceOnImplThread");
@@ -1263,8 +1172,6 @@ void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) {
TRACE_EVENT0("cc", "ThreadProxy::LayerTreeHostClosedOnImplThread");
DCHECK(IsImplThread());
DCHECK(IsMainThreadBlocked());
- layer_tree_host()->DeleteContentsTexturesOnImplThread(
- impl().layer_tree_host_impl->resource_provider());
impl().current_resource_update_controller = nullptr;
impl().scheduler = nullptr;
impl().layer_tree_host_impl = nullptr;
@@ -1273,7 +1180,6 @@ void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) {
// holding while still on the compositor thread. This also ensures any
// callbacks holding a ThreadProxy pointer are cancelled.
impl().smoothness_priority_expiration_notifier.Shutdown();
- impl().contents_texture_manager = NULL;
completion->Signal();
}
@@ -1339,10 +1245,9 @@ void ThreadProxy::RenewTreePriority() {
if (impl().smoothness_priority_expiration_notifier.HasPendingNotification())
priority = SMOOTHNESS_TAKES_PRIORITY;
- // New content always takes priority when the active tree has
- // evicted resources or there is an invalid viewport size.
- if (impl().layer_tree_host_impl->active_tree()->ContentsTexturesPurged() ||
- impl().layer_tree_host_impl->active_tree()->ViewportSizeInvalid() ||
+ // New content always takes priority when there is an invalid viewport size or
+ // ui resources have been evicted.
+ if (impl().layer_tree_host_impl->active_tree()->ViewportSizeInvalid() ||
impl().layer_tree_host_impl->EvictedUIResourcesExist() ||
impl().input_throttled_until_commit) {
// Once we enter NEW_CONTENTS_TAKES_PRIORITY mode, visible tiles on active
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698