Chromium Code Reviews| Index: cc/resources/resource_provider.h |
| diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h |
| index dd7e200e3e1e73b13541ebb2130f7a3396690dcf..f07e5f618cd4f9bcb1d3671d5263d6d9380ea375 100644 |
| --- a/cc/resources/resource_provider.h |
| +++ b/cc/resources/resource_provider.h |
| @@ -331,14 +331,15 @@ class CC_EXPORT ResourceProvider { |
| SkCanvas* MapImageRasterBuffer(ResourceId id); |
| void UnmapImageRasterBuffer(ResourceId id); |
| - // Returns a canvas backed by pixel buffer. |
| + // Returns a canvas backed by pixel buffer. UnmapPixelRasterBuffer |
| + // returns true if canvas was written to while mapped. |
| // The pixel buffer needs to be uploaded to the underlying resource |
| // using BeginSetPixels before the resouce can be used for compositing. |
| // It is used by PixelRasterWorkerPool. |
| void AcquirePixelRasterBuffer(ResourceId id); |
| void ReleasePixelRasterBuffer(ResourceId id); |
| SkCanvas* MapPixelRasterBuffer(ResourceId id); |
| - void UnmapPixelRasterBuffer(ResourceId id); |
| + bool UnmapPixelRasterBuffer(ResourceId id); |
| // Asynchronously update pixels from acquired pixel buffer. |
| void BeginSetPixels(ResourceId id); |
| @@ -450,7 +451,7 @@ class CC_EXPORT ResourceProvider { |
| virtual ~RasterBuffer(); |
| SkCanvas* LockForWrite(); |
| - void UnlockForWrite(); |
| + bool UnlockForWrite(); |
|
alokp
2014/02/19 19:12:12
Add a comment what the bool means.
reveman
2014/02/19 22:53:09
Done.
|
| protected: |
| RasterBuffer(const Resource* resource, ResourceProvider* resource_provider); |
| @@ -458,7 +459,7 @@ class CC_EXPORT ResourceProvider { |
| ResourceProvider* resource_provider() const { return resource_provider_; } |
| virtual SkCanvas* DoLockForWrite() = 0; |
| - virtual void DoUnlockForWrite() = 0; |
| + virtual bool DoUnlockForWrite() = 0; |
| private: |
| const Resource* resource_; |
| @@ -475,11 +476,13 @@ class CC_EXPORT ResourceProvider { |
| protected: |
| virtual SkCanvas* DoLockForWrite() OVERRIDE; |
| - virtual void DoUnlockForWrite() OVERRIDE; |
| + virtual bool DoUnlockForWrite() OVERRIDE; |
| skia::RefPtr<SkSurface> CreateSurface(); |
| private: |
| skia::RefPtr<SkSurface> surface_; |
| + uint32_t surface_generation_id_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(DirectRasterBuffer); |
| }; |
| @@ -492,7 +495,7 @@ class CC_EXPORT ResourceProvider { |
| ResourceProvider* resource_provider); |
| virtual SkCanvas* DoLockForWrite() OVERRIDE; |
| - virtual void DoUnlockForWrite() OVERRIDE; |
| + virtual bool DoUnlockForWrite() OVERRIDE; |
| virtual uint8_t* MapBuffer(int* stride) = 0; |
| virtual void UnmapBuffer() = 0; |
| @@ -500,6 +503,7 @@ class CC_EXPORT ResourceProvider { |
| private: |
| uint8_t* mapped_buffer_; |
| SkBitmap raster_bitmap_; |
| + uint32_t raster_bitmap_generation_id_; |
| skia::RefPtr<SkCanvas> raster_canvas_; |
| }; |