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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 not active. This does not alter the refcnt on the canvas (if present). | 141 not active. This does not alter the refcnt on the canvas (if present). |
| 142 */ | 142 */ |
| 143 SkCanvas* getRecordingCanvas() const; | 143 SkCanvas* getRecordingCanvas() const; |
| 144 /** Signal that the caller is done recording. This invalidates the canvas | 144 /** Signal that the caller is done recording. This invalidates the canvas |
| 145 returned by beginRecording/getRecordingCanvas, and prepares the picture | 145 returned by beginRecording/getRecordingCanvas, and prepares the picture |
| 146 for drawing. Note: this happens implicitly the first time the picture | 146 for drawing. Note: this happens implicitly the first time the picture |
| 147 is drawn. | 147 is drawn. |
| 148 */ | 148 */ |
| 149 void endRecording(); | 149 void endRecording(); |
| 150 | 150 |
| 151 // An OperationList encapsulates a set of operation offsets into the picture byte | |
| 152 // stream along with the CTMs needed for those operation. | |
| 153 class OperationList : public SkNoncopyable { | |
|
reed1
2014/03/14 18:28:32
does this class need to be public? Can it instead
robertphillips
2014/03/14 18:36:08
SkPicturePlayback provides the impl and is already
robertphillips
2014/03/14 19:23:23
Done.
| |
| 154 public: | |
| 155 // If valid returns false then there is no optimization data | |
| 156 // present. All the draw operations need to be issued. | |
| 157 virtual bool valid() const { return false; } | |
| 158 | |
| 159 // The following three entry points should only be accessed if | |
| 160 // 'valid' returns true. | |
| 161 virtual int numOps() const { SkASSERT(false); return 0; }; | |
| 162 // The offset in the picture of the operation to execute. | |
| 163 virtual uint32_t offset(int index) const { SkASSERT(false); return 0; }; | |
| 164 // The CTM that must be installed for the operation to behave correctly | |
| 165 virtual const SkMatrix& matrix(int index) const { SkASSERT(false); retur n SkMatrix::I(); } | |
| 166 | |
| 167 static const OperationList& InvalidList(); | |
| 168 | |
| 169 private: | |
| 170 typedef SkNoncopyable INHERITED; | |
| 171 }; | |
| 172 | |
| 173 /** PRIVATE / EXPERIMENTAL -- do not call | |
| 174 Return the operations required to render the content inside 'queryRect'. | |
| 175 */ | |
| 176 const OperationList& EXPERIMENTAL_getActiveOps(const SkIRect& queryRect); | |
| 177 | |
| 151 /** Replays the drawing commands on the specified canvas. This internally | 178 /** Replays the drawing commands on the specified canvas. This internally |
| 152 calls endRecording() if that has not already been called. | 179 calls endRecording() if that has not already been called. |
| 153 @param canvas the canvas receiving the drawing commands. | 180 @param canvas the canvas receiving the drawing commands. |
| 154 */ | 181 */ |
| 155 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL); | 182 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL); |
| 156 | 183 |
| 157 /** Return the width of the picture's recording canvas. This | 184 /** Return the width of the picture's recording canvas. This |
| 158 value reflects what was passed to setSize(), and does not necessarily | 185 value reflects what was passed to setSize(), and does not necessarily |
| 159 reflect the bounds of what has been recorded into the picture. | 186 reflect the bounds of what has been recorded into the picture. |
| 160 @return the width of the picture's recording canvas | 187 @return the width of the picture's recording canvas |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 */ | 322 */ |
| 296 class SK_API SkDrawPictureCallback { | 323 class SK_API SkDrawPictureCallback { |
| 297 public: | 324 public: |
| 298 SkDrawPictureCallback() {} | 325 SkDrawPictureCallback() {} |
| 299 virtual ~SkDrawPictureCallback() {} | 326 virtual ~SkDrawPictureCallback() {} |
| 300 | 327 |
| 301 virtual bool abortDrawing() = 0; | 328 virtual bool abortDrawing() = 0; |
| 302 }; | 329 }; |
| 303 | 330 |
| 304 #endif | 331 #endif |
| OLD | NEW |