OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_RESOURCES_GANESH_RASTERIZER_H_ | |
6 #define CC_RESOURCES_GANESH_RASTERIZER_H_ | |
7 | |
8 #include "base/memory/scoped_vector.h" | |
9 #include "cc/resources/resource_pool.h" | |
10 #include "cc/resources/tile.h" | |
11 | |
12 namespace cc { | |
13 | |
14 class ContextProvider; | |
15 class ResourceProvider; | |
16 class RenderingStatsInstrumentation; | |
17 | |
18 class CC_EXPORT GaneshRasterizerClient { | |
19 public: | |
20 virtual void OnGaneshRasterTaskCompleted( | |
21 Tile* tile, scoped_ptr<ResourcePool::Resource> resource, | |
22 bool was_canceled) = 0; | |
reveman
2013/11/24 21:56:57
why "was_canceled"? I don't see why that would eve
slavi
2013/11/25 23:13:14
You're not. I modeled this after the other RasterW
| |
23 }; | |
24 | |
25 class CC_EXPORT GaneshRasterizer { | |
26 public: | |
27 static scoped_ptr<GaneshRasterizer> Create( | |
28 ContextProvider* context_provider, | |
29 ResourceProvider* resource_provider); | |
30 ~GaneshRasterizer(); | |
31 | |
32 void SetClient(GaneshRasterizerClient* client); | |
33 | |
34 ResourceFormat GetResourceFormat() const { return BGRA_8888; } | |
reveman
2013/11/24 21:56:57
This will be a problem after you rebase this patch
slavi
2013/11/25 23:13:14
See the current way where in the rasterizer I read
| |
35 | |
36 void PushRasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource); | |
37 void FlushRasterTasks( | |
38 RenderingStatsInstrumentation* rendering_stats_instrumentation); | |
reveman
2013/11/24 21:56:57
Instead of push/flush, what if we add a container
| |
39 | |
40 private: | |
41 GaneshRasterizer( | |
42 ContextProvider* context_provider, | |
43 ResourceProvider* resource_provider); | |
44 | |
45 struct RasterTask { | |
46 RasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource); | |
47 ~RasterTask(); | |
48 | |
49 Tile* tile_; | |
50 scoped_ptr<ResourcePool::Resource> resource_; | |
51 }; | |
52 typedef ScopedVector<RasterTask> RasterTaskVector; | |
53 | |
54 GaneshRasterizerClient* client_; | |
55 ContextProvider* context_provider_; | |
56 ResourceProvider* resource_provider_; | |
57 RasterTaskVector raster_tasks_; | |
58 }; | |
59 | |
60 } // namespace cc | |
61 | |
62 #endif // CC_RESOURCES_GANESH_RASTERIZER_H_ | |
OLD | NEW |