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

Side by Side Diff: cc/resources/tile_task_worker_pool.h

Issue 786583002: cc: Renaming Rasterizer and RasterWorkerPool interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Update include files alphabetic orders. Created 6 years 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 unified diff | Download patch
OLDNEW
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_TILE_TASK_WORKER_POOL_H_
6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_ 6 #define CC_RESOURCES_TILE_TASK_WORKER_POOL_H_
7 7
8 #include "cc/resources/rasterizer.h" 8 #include "cc/resources/tile_task_runner.h"
9 #include "ui/gfx/geometry/rect.h" 9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/gfx/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
11 11
12 namespace base { 12 namespace base {
13 class SequencedTaskRunner; 13 class SequencedTaskRunner;
14 } 14 }
15 15
16 namespace cc { 16 namespace cc {
17 class RasterSource; 17 class RasterSource;
18 class RenderingStatsInstrumentation; 18 class RenderingStatsInstrumentation;
19 19
20 class CC_EXPORT RasterWorkerPool { 20 class CC_EXPORT TileTaskWorkerPool {
21 public: 21 public:
22 static unsigned kBenchmarkRasterTaskPriority; 22 static unsigned kBenchmarkTaskPriority;
23 static unsigned kRasterFinishedTaskPriority; 23 static unsigned kTaskSetFinishedTaskPriority;
24 static unsigned kRasterTaskPriorityBase; 24 static unsigned kTileTaskPriorityBase;
25 25
26 RasterWorkerPool(); 26 TileTaskWorkerPool();
27 virtual ~RasterWorkerPool(); 27 virtual ~TileTaskWorkerPool();
28 28
29 // Set the number of threads to use for the global TaskGraphRunner instance. 29 // Set the number of threads to use for the global TaskGraphRunner instance.
30 // This can only be called once and must be called prior to 30 // This can only be called once and must be called prior to
31 // GetNumRasterThreads(). 31 // GetNumWorkerThreads().
32 static void SetNumRasterThreads(int num_threads); 32 static void SetNumWorkerThreads(int num_threads);
33 33
34 // Returns the number of threads used for the global TaskGraphRunner instance. 34 // Returns the number of threads used for the global TaskGraphRunner instance.
35 static int GetNumRasterThreads(); 35 static int GetNumWorkerThreads();
36 36
37 // Returns a pointer to the global TaskGraphRunner instance. 37 // Returns a pointer to the global TaskGraphRunner instance.
38 static TaskGraphRunner* GetTaskGraphRunner(); 38 static TaskGraphRunner* GetTaskGraphRunner();
39 39
40 // Utility function that can be used to create a "raster finished" task that 40 // Utility function that can be used to create a "Task set finished" task that
41 // posts |callback| to |task_runner| when run. 41 // posts |callback| to |task_runner| when run.
42 static scoped_refptr<RasterizerTask> CreateRasterFinishedTask( 42 static scoped_refptr<TileTask> CreateTaskSetFinishedTask(
43 base::SequencedTaskRunner* task_runner, 43 base::SequencedTaskRunner* task_runner,
44 const base::Closure& callback); 44 const base::Closure& callback);
45 45
46 // Utility function that can be used to call ::ScheduleOnOriginThread() for 46 // Utility function that can be used to call ::ScheduleOnOriginThread() for
47 // each task in |graph|. 47 // each task in |graph|.
48 static void ScheduleTasksOnOriginThread(RasterizerTaskClient* client, 48 static void ScheduleTasksOnOriginThread(TileTaskClient* client,
49 TaskGraph* graph); 49 TaskGraph* graph);
50 50
51 // Utility function that can be used to build a task graph. Inserts a node 51 // Utility function that can be used to build a task graph. Inserts a node
52 // that represents |task| in |graph|. See TaskGraph definition for valid 52 // that represents |task| in |graph|. See TaskGraph definition for valid
53 // |priority| values. 53 // |priority| values.
54 static void InsertNodeForTask(TaskGraph* graph, 54 static void InsertNodeForTask(TaskGraph* graph,
55 RasterizerTask* task, 55 TileTask* task,
56 unsigned priority, 56 unsigned priority,
57 size_t dependencies); 57 size_t dependencies);
58 58
59 // Utility function that can be used to build a task graph. Inserts nodes that 59 // Utility function that can be used to build a task graph. Inserts nodes that
60 // represent |task| and all its image decode dependencies in |graph|. 60 // represent |task| and all its image decode dependencies in |graph|.
61 static void InsertNodesForRasterTask( 61 static void InsertNodesForRasterTask(
62 TaskGraph* graph, 62 TaskGraph* graph,
63 RasterTask* task, 63 RasterTask* task,
64 const ImageDecodeTask::Vector& decode_tasks, 64 const ImageDecodeTask::Vector& decode_tasks,
65 unsigned priority); 65 unsigned priority);
66 66
67 // Utility function that will create a temporary bitmap and copy pixels to 67 // Utility function that will create a temporary bitmap and copy pixels to
68 // |memory| when necessary. 68 // |memory| when necessary.
69 static void PlaybackToMemory(void* memory, 69 static void PlaybackToMemory(void* memory,
70 ResourceFormat format, 70 ResourceFormat format,
71 const gfx::Size& size, 71 const gfx::Size& size,
72 int stride, 72 int stride,
73 const RasterSource* raster_source, 73 const RasterSource* raster_source,
74 const gfx::Rect& rect, 74 const gfx::Rect& rect,
75 float scale); 75 float scale);
76 76
77 // Type-checking downcast routine. 77 // Type-checking downcast routine.
78 virtual Rasterizer* AsRasterizer() = 0; 78 virtual TileTaskRunner* AsTileTaskRunner() = 0;
79 }; 79 };
80 80
81 } // namespace cc 81 } // namespace cc
82 82
83 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ 83 #endif // CC_RESOURCES_TILE_TASK_WORKER_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698