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_GPU_RASTERIZER_H_ | |
6 #define CC_RESOURCES_GPU_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 GpuRasterizerClient { | |
19 public: | |
20 virtual void OnGpuRasterTaskCompleted( | |
21 Tile* tile, scoped_ptr<ResourcePool::Resource> resource, | |
22 bool was_canceled) = 0; | |
23 }; | |
24 | |
25 class CC_EXPORT GpuRasterizer { | |
26 public: | |
27 static scoped_ptr<GpuRasterizer> Create( | |
28 ContextProvider* context_provider, | |
29 ResourceProvider* resource_provider); | |
30 ~GpuRasterizer(); | |
31 | |
32 void SetClient(GpuRasterizerClient* client); | |
enne (OOO)
2013/11/27 23:33:26
Should this be a constructor parameter?
slavi
2013/11/28 00:47:49
Done.
| |
33 | |
34 ResourceFormat GetResourceFormat() const { return BGRA_8888; } | |
35 | |
36 void PushRasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource); | |
37 void FlushRasterTasks( | |
38 RenderingStatsInstrumentation* rendering_stats_instrumentation); | |
39 | |
40 private: | |
41 GpuRasterizer( | |
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 GpuRasterizerClient* client_; | |
55 ContextProvider* context_provider_; | |
56 ResourceProvider* resource_provider_; | |
57 RasterTaskVector raster_tasks_; | |
58 }; | |
59 | |
60 } // namespace cc | |
61 | |
62 #endif // CC_RESOURCES_GPU_RASTERIZER_H_ | |
OLD | NEW |