Chromium Code Reviews| 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..dcb7711142666a5108696ded2266c289df98751a |
| --- /dev/null |
| +++ b/cc/resources/gpu_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_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<ResourcePool::Resource> resource, |
| + bool was_canceled) = 0; |
| +}; |
| + |
| +class CC_EXPORT GpuRasterizer { |
| + public: |
| + static scoped_ptr<GpuRasterizer> Create( |
| + ContextProvider* context_provider, |
| + ResourceProvider* resource_provider); |
| + ~GpuRasterizer(); |
| + |
| + 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.
|
| + |
| + ResourceFormat GetResourceFormat() const { return BGRA_8888; } |
| + |
| + void PushRasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource); |
| + void FlushRasterTasks( |
| + RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| + |
| + private: |
| + GpuRasterizer( |
| + 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; |
| + |
| + GpuRasterizerClient* client_; |
| + ContextProvider* context_provider_; |
| + ResourceProvider* resource_provider_; |
| + RasterTaskVector raster_tasks_; |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_RESOURCES_GPU_RASTERIZER_H_ |