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

Unified Diff: cc/resources/raster_worker_pool.cc

Issue 334133002: cc: Support on demand raster with ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review3 Created 6 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/output/software_renderer_unittest.cc ('k') | cc/surfaces/display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/raster_worker_pool.cc
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index 8f71b2e249328299b81ed287a7f190561899bb4b..d01bdc80cf48cdf8835544f7283b892b9ff3f6eb 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -46,15 +46,14 @@ class RasterTaskGraphRunner : public TaskGraphRunner,
#endif
workers_.push_back(worker.Pass());
}
-
- // Use index 0 for origin thread.
- current_tls_.Set(new ThreadLocalState(0));
}
virtual ~RasterTaskGraphRunner() { NOTREACHED(); }
size_t GetPictureCloneIndexForCurrentThread() {
- return current_tls_.Get()->picture_clone_index;
+ // Use index 0 if called on non-raster thread.
+ ThreadLocalState* thread_local_state = current_tls_.Get();
+ return thread_local_state ? current_tls_.Get()->picture_clone_index : 0;
}
private:
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/surfaces/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698