Index: cc/resources/gpu_rasterizer.h |
diff --git a/cc/resources/gpu_rasterizer.h b/cc/resources/gpu_rasterizer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9abc8cea6affd1784de1ca2471383238b76a0d43 |
--- /dev/null |
+++ b/cc/resources/gpu_rasterizer.h |
@@ -0,0 +1,78 @@ |
+// 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_GPU_RASTERIZER_H_ |
+#define CC_RESOURCES_GPU_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 GpuRasterizerClient { |
+ public: |
+ virtual void OnGpuRasterTaskCompleted( |
+ Tile* tile, scoped_ptr<ScopedResource> resource) = 0; |
+}; |
+ |
+class CC_EXPORT GpuRasterizer { |
+ public: |
+ static scoped_ptr<GpuRasterizer> Create( |
+ ContextProvider* context_provider, |
+ ResourceProvider* resource_provider); |
+ virtual ~GpuRasterizer(); |
+ |
+ void SetClient(GpuRasterizerClient* client); |
+ |
+ class RasterTask { |
+ public: |
+ RasterTask(Tile* tile, scoped_ptr<ScopedResource> resource); |
+ ~RasterTask(); |
+ |
+ private: |
+ friend class GpuRasterizer; |
+ friend class FakeGpuRasterizer; |
+ |
+ Tile* tile_; |
+ scoped_ptr<ScopedResource> resource_; |
+ }; |
+ |
+ typedef ScopedVector<RasterTask> RasterTaskVector; |
+ |
+ class CC_EXPORT Queue { |
+ public: |
+ Queue(); |
+ ~Queue(); |
+ |
+ void Append(Tile* tile, scoped_ptr<ScopedResource> resource); |
+ |
+ private: |
+ friend class GpuRasterizer; |
+ friend class FakeGpuRasterizer; |
+ |
+ RasterTaskVector raster_tasks_; |
+ }; |
+ |
+ virtual void Rasterize( |
+ const Queue& queue, |
+ RenderingStatsInstrumentation* rendering_stats_instrumentation); |
+ |
+ protected: |
+ GpuRasterizer( |
+ ContextProvider* context_provider, |
+ ResourceProvider* resource_provider); |
+ |
+ GpuRasterizerClient* client_; |
+ ContextProvider* context_provider_; |
+ ResourceProvider* resource_provider_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_RESOURCES_GPU_RASTERIZER_H_ |