Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkPicture_DEFINED | 10 #ifndef SkPicture_DEFINED |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 | 33 |
| 34 namespace SkRecords { | 34 namespace SkRecords { |
| 35 class CollectLayers; | 35 class CollectLayers; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 /** \class SkPicture | 38 /** \class SkPicture |
| 39 | 39 |
| 40 The SkPicture class records the drawing commands made to a canvas, to | 40 The SkPicture class records the drawing commands made to a canvas, to |
| 41 be played back at a later time. | 41 be played back at a later time. |
| 42 */ | 42 */ |
| 43 class SK_API SkPicture : public SkRefCnt { | 43 class SK_API SkPicture : public SkNVRefCnt<SkPicture> { |
| 44 public: | 44 public: |
| 45 SK_DECLARE_INST_COUNT(SkPicture) | 45 SK_DECLARE_INST_COUNT(SkPicture) |
| 46 | 46 |
| 47 // AccelData provides a base class for device-specific acceleration | 47 // AccelData provides a base class for device-specific acceleration |
| 48 // data. It is added to the picture via EXPERIMENTAL_addAccelData. | 48 // data. It is added to the picture via EXPERIMENTAL_addAccelData. |
| 49 class AccelData : public SkRefCnt { | 49 class AccelData : public SkRefCnt { |
| 50 public: | 50 public: |
| 51 typedef uint8_t Domain; | 51 typedef uint8_t Domain; |
| 52 typedef uint32_t Key; | 52 typedef uint32_t Key; |
| 53 | 53 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 /** | 97 /** |
| 98 * Recreate a picture that was serialized into a buffer. If the creation re quires bitmap | 98 * Recreate a picture that was serialized into a buffer. If the creation re quires bitmap |
| 99 * decoding, the decoder must be set on the SkReadBuffer parameter by calli ng | 99 * decoding, the decoder must be set on the SkReadBuffer parameter by calli ng |
| 100 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf fer(). | 100 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf fer(). |
| 101 * @param SkReadBuffer Serialized picture data. | 101 * @param SkReadBuffer Serialized picture data. |
| 102 * @return A new SkPicture representing the serialized data, or NULL if the buffer is | 102 * @return A new SkPicture representing the serialized data, or NULL if the buffer is |
| 103 * invalid. | 103 * invalid. |
| 104 */ | 104 */ |
| 105 static SkPicture* CreateFromBuffer(SkReadBuffer&); | 105 static SkPicture* CreateFromBuffer(SkReadBuffer&); |
| 106 | 106 |
| 107 virtual ~SkPicture(); | 107 ~SkPicture(); |
| 108 | 108 |
| 109 /** Replays the drawing commands on the specified canvas. Note that | 109 /** Replays the drawing commands on the specified canvas. Note that |
| 110 this has the effect of unfurling this picture into the destination | 110 this has the effect of unfurling this picture into the destination |
| 111 canvas. Using the SkCanvas::drawPicture entry point gives the destinatio n | 111 canvas. Using the SkCanvas::drawPicture entry point gives the destinatio n |
| 112 canvas the option of just taking a ref. | 112 canvas the option of just taking a ref. |
| 113 @param canvas the canvas receiving the drawing commands. | 113 @param canvas the canvas receiving the drawing commands. |
| 114 @param callback a callback that allows interruption of playback | 114 @param callback a callback that allows interruption of playback |
| 115 */ | 115 */ |
| 116 void playback(SkCanvas* canvas, SkDrawPictureCallback* = NULL) const; | 116 void playback(SkCanvas* canvas, SkDrawPictureCallback* = NULL) const; |
| 117 | 117 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 bool suitableForGpuRasterization(const char** reason, int sampleCount) c onst; | 288 bool suitableForGpuRasterization(const char** reason, int sampleCount) c onst; |
| 289 | 289 |
| 290 bool fWillPlaybackBitmaps; | 290 bool fWillPlaybackBitmaps; |
| 291 bool fHasText; | 291 bool fHasText; |
| 292 int fNumPaintWithPathEffectUses; | 292 int fNumPaintWithPathEffectUses; |
| 293 int fNumFastPathDashEffects; | 293 int fNumFastPathDashEffects; |
| 294 int fNumAAConcavePaths; | 294 int fNumAAConcavePaths; |
| 295 int fNumAAHairlineConcavePaths; | 295 int fNumAAHairlineConcavePaths; |
| 296 int fNumAADFEligibleConcavePaths; | 296 int fNumAADFEligibleConcavePaths; |
| 297 } fAnalysis; | 297 } fAnalysis; |
| 298 mutable uint32_t fUniqueID; | 298 mutable uint32_t fUniqueID; |
|
tomhudson
2014/11/19 18:59:06
Follow-on CL to move this up top for better packin
mtklein
2014/11/19 19:19:14
Done.
| |
| 299 | 299 |
| 300 friend class SkPictureRecorder; // SkRecord-based constructor. | 300 friend class SkPictureRecorder; // SkRecord-based constructor. |
| 301 friend class GrLayerHoister; // access to fRecord | 301 friend class GrLayerHoister; // access to fRecord |
| 302 friend class ReplaceDraw; | 302 friend class ReplaceDraw; |
| 303 friend class SkPictureUtils; | 303 friend class SkPictureUtils; |
| 304 | 304 |
| 305 typedef SkRefCnt INHERITED; | 305 typedef SkRefCnt INHERITED; |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 #endif | 308 #endif |
| OLD | NEW |