Chromium Code Reviews| 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 SkPictureRecorder_DEFINED | 8 #ifndef SkPictureRecorder_DEFINED |
| 9 #define SkPictureRecorder_DEFINED | 9 #define SkPictureRecorder_DEFINED |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 ref which the caller must take ownership of. | 75 ref which the caller must take ownership of. |
| 76 */ | 76 */ |
| 77 SkPicture* endRecording() { | 77 SkPicture* endRecording() { |
| 78 if (NULL != fPicture.get()) { | 78 if (NULL != fPicture.get()) { |
| 79 fPicture->endRecording(); | 79 fPicture->endRecording(); |
| 80 return fPicture.detach(); | 80 return fPicture.detach(); |
| 81 } | 81 } |
| 82 return NULL; | 82 return NULL; |
| 83 } | 83 } |
| 84 | 84 |
| 85 /** Create an intermediate SkPicture of the in-progress recording. | |
| 86 Future recorded operations will not appear in the snapshot. If no | |
| 87 recording is in progress this will return NULL. | |
| 88 */ | |
| 89 SkPicture* snapshot() { | |
| 90 if (NULL != fPicture) { | |
| 91 return SkNEW_ARGS(SkPicture, (*fPicture)); | |
|
scroggo
2014/04/25 14:16:52
I haven't followed along with all the picture chan
robertphillips
2014/04/25 14:55:28
Currently - yes. I believe the desire is to not as
scroggo
2014/04/25 15:00:44
When that day comes, what will the Android approac
| |
| 92 } | |
| 93 | |
| 94 return NULL; | |
| 95 } | |
| 96 | |
| 85 /** Enable/disable all the picture recording optimizations (i.e., | 97 /** Enable/disable all the picture recording optimizations (i.e., |
| 86 those in SkPictureRecord). It is mainly intended for testing the | 98 those in SkPictureRecord). It is mainly intended for testing the |
| 87 existing optimizations (i.e., to actually have the pattern | 99 existing optimizations (i.e., to actually have the pattern |
| 88 appear in an .skp we have to disable the optimization). Call right | 100 appear in an .skp we have to disable the optimization). Call right |
| 89 after 'beginRecording'. | 101 after 'beginRecording'. |
| 90 */ | 102 */ |
| 91 void internalOnly_EnableOpts(bool enableOpts) { | 103 void internalOnly_EnableOpts(bool enableOpts) { |
| 92 if (NULL != fPicture.get()) { | 104 if (NULL != fPicture.get()) { |
| 93 fPicture->internalOnly_EnableOpts(enableOpts); | 105 fPicture->internalOnly_EnableOpts(enableOpts); |
| 94 } | 106 } |
| 95 } | 107 } |
| 96 | 108 |
| 97 private: | 109 private: |
| 98 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES | 110 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES |
| 99 SkAutoTUnref<SkPictureFactory> fFactory; | 111 SkAutoTUnref<SkPictureFactory> fFactory; |
| 100 #endif | 112 #endif |
| 101 | 113 |
| 102 SkAutoTUnref<SkPicture> fPicture; | 114 SkAutoTUnref<SkPicture> fPicture; |
| 103 | 115 |
| 104 typedef SkNoncopyable INHERITED; | 116 typedef SkNoncopyable INHERITED; |
| 105 }; | 117 }; |
| 106 | 118 |
| 107 #endif | 119 #endif |
| OLD | NEW |