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

Unified Diff: cc/raster/gpu_tile_task_worker_pool.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: rebase Created 5 years, 4 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/output_surface.cc ('k') | cc/raster/one_copy_tile_task_worker_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/gpu_tile_task_worker_pool.cc
diff --git a/cc/raster/gpu_tile_task_worker_pool.cc b/cc/raster/gpu_tile_task_worker_pool.cc
index 3567308fcdc70d01c810bd6963fddb714c5e2fef..23804550122319aaf08eff05b70121cc15fdccee 100644
--- a/cc/raster/gpu_tile_task_worker_pool.cc
+++ b/cc/raster/gpu_tile_task_worker_pool.cc
@@ -46,13 +46,9 @@ class RasterBufferImpl : public RasterBuffer {
ContextProvider* context_provider = rasterizer_->resource_provider()
->output_surface()
->worker_context_provider();
+ DCHECK(context_provider);
- // The context lock must be held while accessing the context on a
- // worker thread.
- base::AutoLock context_lock(*context_provider->GetLock());
-
- // Allow this worker thread to bind to context_provider.
- context_provider->DetachFromThread();
+ ContextProvider::ScopedContextLock scoped_context(context_provider);
gfx::Rect playback_rect = raster_full_rect;
if (resource_has_previous_content_) {
@@ -67,10 +63,7 @@ class RasterBufferImpl : public RasterBuffer {
playback_rect, scale);
// Barrier to sync worker context output to cc context.
- context_provider->ContextGL()->OrderingBarrierCHROMIUM();
-
- // Allow compositor thread to bind to context_provider.
- context_provider->DetachFromThread();
+ scoped_context.ContextGL()->OrderingBarrierCHROMIUM();
}
private:
« no previous file with comments | « cc/output/output_surface.cc ('k') | cc/raster/one_copy_tile_task_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698