OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_ | 5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_ |
6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_ | 6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_ |
7 | 7 |
8 #include "cc/resources/rasterizer.h" | 8 #include "cc/resources/rasterizer.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
(...skipping 17 matching lines...) Expand all Loading... |
28 // This can only be called once and must be called prior to | 28 // This can only be called once and must be called prior to |
29 // GetNumRasterThreads(). | 29 // GetNumRasterThreads(). |
30 static void SetNumRasterThreads(int num_threads); | 30 static void SetNumRasterThreads(int num_threads); |
31 | 31 |
32 // Returns the number of threads used for the global TaskGraphRunner instance. | 32 // Returns the number of threads used for the global TaskGraphRunner instance. |
33 static int GetNumRasterThreads(); | 33 static int GetNumRasterThreads(); |
34 | 34 |
35 // Returns a pointer to the global TaskGraphRunner instance. | 35 // Returns a pointer to the global TaskGraphRunner instance. |
36 static TaskGraphRunner* GetTaskGraphRunner(); | 36 static TaskGraphRunner* GetTaskGraphRunner(); |
37 | 37 |
38 // Returns a unique clone index for the current thread. Guaranteed to be a | |
39 // value between 0 and GetNumRasterThreads() - 1. | |
40 static size_t GetPictureCloneIndexForCurrentThread(); | |
41 | |
42 // Utility function that can be used to create a "raster finished" task that | 38 // Utility function that can be used to create a "raster finished" task that |
43 // posts |callback| to |task_runner| when run. | 39 // posts |callback| to |task_runner| when run. |
44 static scoped_refptr<RasterizerTask> CreateRasterFinishedTask( | 40 static scoped_refptr<RasterizerTask> CreateRasterFinishedTask( |
45 base::SequencedTaskRunner* task_runner, | 41 base::SequencedTaskRunner* task_runner, |
46 const base::Closure& callback); | 42 const base::Closure& callback); |
47 | 43 |
48 // Utility function that can be used to create a "raster required for | 44 // Utility function that can be used to create a "raster required for |
49 // activation finished" task that posts |callback| to |task_runner| when run. | 45 // activation finished" task that posts |callback| to |task_runner| when run. |
50 static scoped_refptr<RasterizerTask> | 46 static scoped_refptr<RasterizerTask> |
51 CreateRasterRequiredForActivationFinishedTask( | 47 CreateRasterRequiredForActivationFinishedTask( |
(...skipping 22 matching lines...) Expand all Loading... |
74 const ImageDecodeTask::Vector& decode_tasks, | 70 const ImageDecodeTask::Vector& decode_tasks, |
75 unsigned priority); | 71 unsigned priority); |
76 | 72 |
77 // Type-checking downcast routine. | 73 // Type-checking downcast routine. |
78 virtual Rasterizer* AsRasterizer() = 0; | 74 virtual Rasterizer* AsRasterizer() = 0; |
79 }; | 75 }; |
80 | 76 |
81 } // namespace cc | 77 } // namespace cc |
82 | 78 |
83 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 79 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
OLD | NEW |