Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_RESOURCES_RASTER_BUFFER_H_ | 5 #ifndef CC_RESOURCES_RASTER_BUFFER_H_ |
| 6 #define CC_RESOURCES_RASTER_BUFFER_H_ | 6 #define CC_RESOURCES_RASTER_BUFFER_H_ |
| 7 | 7 |
| 8 #include "skia/ext/refptr.h" | |
| 9 | |
| 8 class SkCanvas; | 10 class SkCanvas; |
| 9 | 11 |
| 10 namespace cc { | 12 namespace cc { |
| 11 | 13 |
| 12 class RasterBuffer { | 14 class RasterBuffer { |
| 13 public: | 15 public: |
| 14 virtual SkCanvas* AcquireSkCanvas() = 0; | 16 virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() = 0; |
|
reveman
2014/08/13 19:19:49
Do we need to return a skia::RefPtr? It's weird th
auygun
2014/08/14 10:35:42
Isn't it better to pass around the skia::RefPtr in
reveman
2014/08/14 12:26:36
Use skia::RefPtr if you need to pass ownership. Ra
auygun
2014/08/15 09:20:40
Acknowledged.
| |
| 15 virtual void ReleaseSkCanvas() = 0; | 17 // Returns true if canvas was written to while acquired. |
| 18 virtual bool ReleaseSkCanvas(SkCanvas* canvas) = 0; | |
| 16 | 19 |
| 17 protected: | 20 protected: |
| 18 virtual ~RasterBuffer() {} | 21 virtual ~RasterBuffer() {} |
| 19 }; | 22 }; |
| 20 | 23 |
| 21 } // namespace cc | 24 } // namespace cc |
| 22 | 25 |
| 23 #endif // CC_RESOURCES_RASTER_BUFFER_H_ | 26 #endif // CC_RESOURCES_RASTER_BUFFER_H_ |
| OLD | NEW |