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

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

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected scope of dependencies. Created 4 years, 8 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 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_RASTER_TILE_TASK_WORKER_POOL_H_ 5 #ifndef CC_RASTER_TILE_TASK_WORKER_POOL_H_
6 #define CC_RASTER_TILE_TASK_WORKER_POOL_H_ 6 #define CC_RASTER_TILE_TASK_WORKER_POOL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "cc/playback/raster_source.h" 10 #include "cc/playback/raster_source.h"
11 #include "cc/raster/tile_task_runner.h" 11 #include "cc/raster/tile_task_runner.h"
12 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 14
15 namespace base { 15 namespace base {
16 class SequencedTaskRunner; 16 class SequencedTaskRunner;
17 } 17 }
18 18
19 namespace cc { 19 namespace cc {
20 class RenderingStatsInstrumentation; 20 class RenderingStatsInstrumentation;
21 21
22 class CC_EXPORT TileTaskWorkerPool { 22 class CC_EXPORT TileTaskWorkerPool {
23 public: 23 public:
24 TileTaskWorkerPool(); 24 TileTaskWorkerPool();
25 virtual ~TileTaskWorkerPool(); 25 virtual ~TileTaskWorkerPool();
26 26
27 // Utility function that can be used to call ::ScheduleOnOriginThread() for 27 // Utility function that can be used to call ::ScheduleOnOriginThread() for
28 // each task in |graph|. 28 // each task in |graph|.
29 static void ScheduleTasksOnOriginThread(TileTaskClient* client, 29 static void ScheduleTasksOnOriginThread(TaskGraph* graph);
30 TaskGraph* graph);
31 30
32 // Utility function that will create a temporary bitmap and copy pixels to 31 // Utility function that will create a temporary bitmap and copy pixels to
33 // |memory| when necessary. The |canvas_bitmap_rect| is the rect of the bitmap 32 // |memory| when necessary. The |canvas_bitmap_rect| is the rect of the bitmap
34 // being played back in the pixel space of the source, ie a rect in the source 33 // being played back in the pixel space of the source, ie a rect in the source
35 // that will cover the resulting |memory|. The |canvas_playback_rect| can be a 34 // that will cover the resulting |memory|. The |canvas_playback_rect| can be a
36 // smaller contained rect inside the |canvas_bitmap_rect| if the |memory| is 35 // smaller contained rect inside the |canvas_bitmap_rect| if the |memory| is
37 // already partially complete, and only the subrect needs to be played back. 36 // already partially complete, and only the subrect needs to be played back.
38 static void PlaybackToMemory( 37 static void PlaybackToMemory(
39 void* memory, 38 void* memory,
40 ResourceFormat format, 39 ResourceFormat format,
41 const gfx::Size& size, 40 const gfx::Size& size,
42 size_t stride, 41 size_t stride,
43 const RasterSource* raster_source, 42 const RasterSource* raster_source,
44 const gfx::Rect& canvas_bitmap_rect, 43 const gfx::Rect& canvas_bitmap_rect,
45 const gfx::Rect& canvas_playback_rect, 44 const gfx::Rect& canvas_playback_rect,
46 float scale, 45 float scale,
47 const RasterSource::PlaybackSettings& playback_settings); 46 const RasterSource::PlaybackSettings& playback_settings);
48 47
49 // Type-checking downcast routine. 48 // Type-checking downcast routine.
50 virtual TileTaskRunner* AsTileTaskRunner() = 0; 49 virtual TileTaskRunner* AsTileTaskRunner() = 0;
51 }; 50 };
52 51
53 } // namespace cc 52 } // namespace cc
54 53
55 #endif // CC_RASTER_TILE_TASK_WORKER_POOL_H_ 54 #endif // CC_RASTER_TILE_TASK_WORKER_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698