Chromium Code Reviews| Index: include/core/SkPicture.h |
| =================================================================== |
| --- include/core/SkPicture.h (revision 13762) |
| +++ include/core/SkPicture.h (working copy) |
| @@ -34,6 +34,21 @@ |
| public: |
| SK_DECLARE_INST_COUNT(SkPicture) |
| + // SkAccelData provides a base class for device-specific acceleration |
| + // data. It is added to the picture via a call to a device's optimize |
| + // method. |
| + class SkAccelData : public SkRefCnt { |
| + public: |
| + SkAccelData(uint32_t id) : fID(id) { } |
| + |
| + uint32_t getID() const { return fID; } |
| + |
| + private: |
| + uint32_t fID; |
| + |
| + typedef SkRefCnt INHERITED; |
| + }; |
| + |
| /** The constructor prepares the picture to record. |
| @param width the width of the virtual device the picture records. |
| @param height the height of the virtual device the picture records. |
| @@ -44,6 +59,9 @@ |
| */ |
| SkPicture(const SkPicture& src); |
| + void setAccelData(const SkAccelData* data) { SkRefCnt_SafeAssign(fAccelData, data); } |
|
bsalomon
2014/03/12 15:34:34
If we ever have other backends that want to optimi
robertphillips
2014/03/13 12:43:42
Done. I have updated the interface to support this
|
| + const SkAccelData* getAccelData() const { return fAccelData; } |
| + |
| /** |
| * Function signature defining a function that sets up an SkBitmap from encoded data. On |
| * success, the SkBitmap should have its Config, width, height, rowBytes and pixelref set. |
| @@ -262,9 +280,10 @@ |
| // fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to |
| // install their own SkPicturePlayback-derived players,SkPictureRecord-derived |
| // recorders and set the picture size |
| - SkPicturePlayback* fPlayback; |
| - SkPictureRecord* fRecord; |
| - int fWidth, fHeight; |
| + SkPicturePlayback* fPlayback; |
| + SkPictureRecord* fRecord; |
| + int fWidth, fHeight; |
| + const SkAccelData* fAccelData; |
| // Create a new SkPicture from an existing SkPicturePlayback. Ref count of |
| // playback is unchanged. |