Index: cc/resources/ganesh_rasterizer.h |
diff --git a/cc/resources/ganesh_rasterizer.h b/cc/resources/ganesh_rasterizer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1ac5b2a090e8bc3f149d18429493e9687e4c23c6 |
--- /dev/null |
+++ b/cc/resources/ganesh_rasterizer.h |
@@ -0,0 +1,62 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_RESOURCES_GANESH_RASTERIZER_H_ |
+#define CC_RESOURCES_GANESH_RASTERIZER_H_ |
+ |
+#include "base/memory/scoped_vector.h" |
+#include "cc/resources/resource_pool.h" |
+#include "cc/resources/tile.h" |
+ |
+namespace cc { |
+ |
+class ContextProvider; |
+class ResourceProvider; |
+class RenderingStatsInstrumentation; |
+ |
+class CC_EXPORT GaneshRasterizerClient { |
+ public: |
+ virtual void OnGaneshRasterTaskCompleted( |
+ Tile* tile, scoped_ptr<ResourcePool::Resource> resource, |
+ 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
|
+}; |
+ |
+class CC_EXPORT GaneshRasterizer { |
+ public: |
+ static scoped_ptr<GaneshRasterizer> Create( |
+ ContextProvider* context_provider, |
+ ResourceProvider* resource_provider); |
+ ~GaneshRasterizer(); |
+ |
+ void SetClient(GaneshRasterizerClient* client); |
+ |
+ 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
|
+ |
+ void PushRasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource); |
+ void FlushRasterTasks( |
+ RenderingStatsInstrumentation* rendering_stats_instrumentation); |
reveman
2013/11/24 21:56:57
Instead of push/flush, what if we add a container
|
+ |
+ private: |
+ GaneshRasterizer( |
+ ContextProvider* context_provider, |
+ ResourceProvider* resource_provider); |
+ |
+ struct RasterTask { |
+ RasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource); |
+ ~RasterTask(); |
+ |
+ Tile* tile_; |
+ scoped_ptr<ResourcePool::Resource> resource_; |
+ }; |
+ typedef ScopedVector<RasterTask> RasterTaskVector; |
+ |
+ GaneshRasterizerClient* client_; |
+ ContextProvider* context_provider_; |
+ ResourceProvider* resource_provider_; |
+ RasterTaskVector raster_tasks_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_RESOURCES_GANESH_RASTERIZER_H_ |