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

Unified Diff: cc/output/output_surface.cc

Issue 1230203007: Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed output surface lost worker context handling Created 5 years, 5 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/output/context_provider.h ('k') | cc/raster/gpu_tile_task_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/output_surface.cc
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index a597a87d8456bc65f3ce763d469db9e7e776ed7f..f0a1faf6f813bb1a11173f635c92fef80b9c455d 100644
--- a/cc/output/output_surface.cc
+++ b/cc/output/output_surface.cc
@@ -107,10 +107,6 @@ OutputSurface::~OutputSurface() {
context_provider_->SetMemoryPolicyChangedCallback(
ContextProvider::MemoryPolicyChangedCallback());
}
- if (worker_context_provider_.get()) {
- worker_context_provider_->SetLostContextCallback(
- ContextProvider::LostContextCallback());
- }
}
bool OutputSurface::HasExternalStencilTest() const {
@@ -132,17 +128,8 @@ bool OutputSurface::BindToClient(OutputSurfaceClient* client) {
}
}
- if (success && worker_context_provider_.get()) {
+ if (success && worker_context_provider_.get())
success = worker_context_provider_->BindToCurrentThread();
- if (success) {
- worker_context_provider_->SetupLock();
- // The destructor resets the context lost callback, so base::Unretained
- // is safe, as long as the worker threads stop using the context before
- // the output surface is destroyed.
- worker_context_provider_->SetLostContextCallback(base::Bind(
- &OutputSurface::DidLoseOutputSurface, base::Unretained(this)));
reveman 2015/07/24 22:53:54 I had to remove this to be able to share worker co
- }
- }
if (!success)
client_ = NULL;
@@ -217,11 +204,7 @@ void OutputSurface::SetWorkerContextShouldAggressivelyFreeResources(
"OutputSurface::SetWorkerContextShouldAggressivelyFreeResources",
"aggressively_free_resources", aggressively_free_resources);
if (auto* context_provider = worker_context_provider()) {
- // The context lock must be held while accessing the worker context.
- base::AutoLock context_lock(*context_provider->GetLock());
-
- // Allow context to bind to current thread.
- context_provider->DetachFromThread();
+ ContextProvider::ScopedContextLock scoped_context(context_provider);
if (aggressively_free_resources) {
context_provider->DeleteCachedResources();
@@ -231,9 +214,6 @@ void OutputSurface::SetWorkerContextShouldAggressivelyFreeResources(
context_support->SetAggressivelyFreeResources(
aggressively_free_resources);
}
-
- // Allow context to bind to other threads.
- context_provider->DetachFromThread();
}
}
« no previous file with comments | « cc/output/context_provider.h ('k') | cc/raster/gpu_tile_task_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698