Index: cc/resources/resource_provider.h |
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h |
index e44b75e87649912d184477cce6b70879d9adc03a..788858779b55836afbb87fbc275632690683ddde 100644 |
--- a/cc/resources/resource_provider.h |
+++ b/cc/resources/resource_provider.h |
@@ -20,6 +20,7 @@ |
#include "cc/base/cc_export.h" |
#include "cc/output/context_provider.h" |
#include "cc/output/output_surface.h" |
+#include "cc/resources/rasterizer.h" |
#include "cc/resources/release_callback.h" |
#include "cc/resources/resource_format.h" |
#include "cc/resources/return_callback.h" |
@@ -316,7 +317,7 @@ class CC_EXPORT ResourceProvider { |
// Returns a canvas for gpu rasterization. |
// Call Unmap before the resource can be read or used for compositing. |
// It is used for direct gpu rasterization. |
- SkCanvas* MapGpuRasterBuffer(ResourceId id); |
+ RasterCanvas* MapGpuRasterBuffer(ResourceId id); |
void UnmapGpuRasterBuffer(ResourceId id); |
// Returns a canvas backed by an image buffer. UnmapImageRasterBuffer |
@@ -325,7 +326,7 @@ class CC_EXPORT ResourceProvider { |
// which is internally bound to the underlying resource when read. |
// Call Unmap before the resource can be read or used for compositing. |
// It is used by ImageRasterWorkerPool. |
- SkCanvas* MapImageRasterBuffer(ResourceId id); |
+ RasterCanvas* MapImageRasterBuffer(ResourceId id); |
bool UnmapImageRasterBuffer(ResourceId id); |
// Returns a canvas backed by pixel buffer. UnmapPixelRasterBuffer |
@@ -335,7 +336,7 @@ class CC_EXPORT ResourceProvider { |
// It is used by PixelRasterWorkerPool. |
void AcquirePixelRasterBuffer(ResourceId id); |
void ReleasePixelRasterBuffer(ResourceId id); |
- SkCanvas* MapPixelRasterBuffer(ResourceId id); |
+ RasterCanvas* MapPixelRasterBuffer(ResourceId id); |
bool UnmapPixelRasterBuffer(ResourceId id); |
// Asynchronously update pixels from acquired pixel buffer. |
@@ -445,11 +446,11 @@ class CC_EXPORT ResourceProvider { |
}; |
typedef base::hash_map<ResourceId, Resource> ResourceMap; |
- class RasterBuffer { |
+ class RasterBuffer : public RasterCanvas { |
reveman
2014/08/11 11:46:21
Do we need both a RasterBuffer and a RasterCanvas
auygun
2014/08/11 14:03:00
I'll try to do that. Looks like RasterBuffer can e
|
public: |
virtual ~RasterBuffer(); |
- SkCanvas* LockForWrite(); |
+ void LockForWrite(); |
// Returns true if canvas was written to while locked. |
bool UnlockForWrite(); |
@@ -464,7 +465,6 @@ class CC_EXPORT ResourceProvider { |
private: |
const Resource* resource_; |
ResourceProvider* resource_provider_; |
- SkCanvas* locked_canvas_; |
int canvas_save_count_; |
}; |
@@ -478,6 +478,7 @@ class CC_EXPORT ResourceProvider { |
protected: |
virtual SkCanvas* DoLockForWrite() OVERRIDE; |
virtual bool DoUnlockForWrite() OVERRIDE; |
+ virtual void Flush() OVERRIDE {} |
skia::RefPtr<SkSurface> CreateSurface(); |
private: |
@@ -498,6 +499,7 @@ class CC_EXPORT ResourceProvider { |
virtual SkCanvas* DoLockForWrite() OVERRIDE; |
virtual bool DoUnlockForWrite() OVERRIDE; |
+ virtual void Flush() OVERRIDE; |
virtual uint8_t* MapBuffer(int* stride) = 0; |
virtual void UnmapBuffer() = 0; |