| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkRecording_DEFINED | 8 #ifndef SkRecording_DEFINED |
| 9 #define SkRecording_DEFINED | 9 #define SkRecording_DEFINED |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * ... | 29 * ... |
| 30 * | 30 * |
| 31 * canvas.clear(); // You must deref the canvas before you may call releasePla
yback(). | 31 * canvas.clear(); // You must deref the canvas before you may call releasePla
yback(). |
| 32 * scoped_ptr<const SkPlayback> playback(recording->releasePlayback()); | 32 * scoped_ptr<const SkPlayback> playback(recording->releasePlayback()); |
| 33 * playback->draw(&someCanvas); | 33 * playback->draw(&someCanvas); |
| 34 * playback->draw(&someOtherCanvas); | 34 * playback->draw(&someOtherCanvas); |
| 35 * | 35 * |
| 36 * SkPlayback is thread safe; SkRecording is not. | 36 * SkPlayback is thread safe; SkRecording is not. |
| 37 */ | 37 */ |
| 38 | 38 |
| 39 class SkPlayback : SkNoncopyable { | 39 class SK_API SkPlayback : SkNoncopyable { |
| 40 public: | 40 public: |
| 41 // Remember, if you've got an SkPlayback*, you probably own it. Don't forge
t to delete it! | 41 // Remember, if you've got an SkPlayback*, you probably own it. Don't forge
t to delete it! |
| 42 ~SkPlayback(); | 42 ~SkPlayback(); |
| 43 | 43 |
| 44 // Draw recorded commands into a canvas. | 44 // Draw recorded commands into a canvas. |
| 45 void draw(SkCanvas*) const; | 45 void draw(SkCanvas*) const; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 explicit SkPlayback(const SkRecord*); | 48 explicit SkPlayback(const SkRecord*); |
| 49 | 49 |
| 50 SkAutoTDelete<const SkRecord> fRecord; | 50 SkAutoTDelete<const SkRecord> fRecord; |
| 51 | 51 |
| 52 friend class SkRecording; | 52 friend class SkRecording; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class SkRecording : SkNoncopyable { | 55 class SK_API SkRecording : SkNoncopyable { |
| 56 public: | 56 public: |
| 57 SkRecording(int width, int height); | 57 SkRecording(int width, int height); |
| 58 ~SkRecording(); | 58 ~SkRecording(); |
| 59 | 59 |
| 60 // Draws issued to this canvas will be replayed by SkPlayback::draw(). | 60 // Draws issued to this canvas will be replayed by SkPlayback::draw(). |
| 61 // Any refs held on canvas() must be dropped before you may call releasePlay
back(). | 61 // Any refs held on canvas() must be dropped before you may call releasePlay
back(). |
| 62 SkCanvas* canvas(); | 62 SkCanvas* canvas(); |
| 63 | 63 |
| 64 // Release exclusive ownership of an SkPlayback to the caller. | 64 // Release exclusive ownership of an SkPlayback to the caller. |
| 65 // Any refs held on canvas() must be dropped before you may call releasePlay
back(). | 65 // Any refs held on canvas() must be dropped before you may call releasePlay
back(). |
| 66 SkPlayback* releasePlayback(); | 66 SkPlayback* releasePlayback(); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 SkAutoTDelete<SkRecord> fRecord; | 69 SkAutoTDelete<SkRecord> fRecord; |
| 70 SkAutoTUnref<SkRecorder> fRecorder; | 70 SkAutoTUnref<SkRecorder> fRecorder; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace EXPERIMENTAL | 73 } // namespace EXPERIMENTAL |
| 74 | 74 |
| 75 #endif//SkRecording_DEFINED | 75 #endif//SkRecording_DEFINED |
| OLD | NEW |