| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
| 9 | 9 |
| 10 #ifndef SkGPipe_DEFINED | 10 #ifndef SkGPipe_DEFINED |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 /** | 80 /** |
| 81 * This is called each time some atomic portion of the data has been | 81 * This is called each time some atomic portion of the data has been |
| 82 * written to the block (most recently returned by requestBlock()). | 82 * written to the block (most recently returned by requestBlock()). |
| 83 * If bytes == 0, then the writer has finished. | 83 * If bytes == 0, then the writer has finished. |
| 84 * | 84 * |
| 85 * bytes will always be a multiple of 4. | 85 * bytes will always be a multiple of 4. |
| 86 */ | 86 */ |
| 87 virtual void notifyWritten(size_t bytes) = 0; | 87 virtual void notifyWritten(size_t bytes) = 0; |
| 88 virtual int numberOfReaders() const { return 1; } | 88 virtual int numberOfReaders() const { return 1; } |
| 89 | 89 |
| 90 /** |
| 91 * Release resource references that are held in internal caches. |
| 92 * This must only be called after the pipe has been completely flushed. |
| 93 */ |
| 94 void purgeCaches(); |
| 95 |
| 90 private: | 96 private: |
| 91 friend class SkGPipeWriter; | 97 friend class SkGPipeWriter; |
| 92 void setCanvas(SkGPipeCanvas*); | 98 void setCanvas(SkGPipeCanvas*); |
| 93 | 99 |
| 94 SkGPipeCanvas* fCanvas; | 100 SkGPipeCanvas* fCanvas; |
| 95 }; | 101 }; |
| 96 | 102 |
| 97 class SkGPipeWriter { | 103 class SkGPipeWriter { |
| 98 public: | 104 public: |
| 99 SkGPipeWriter(); | 105 SkGPipeWriter(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 private: | 165 private: |
| 160 enum { | 166 enum { |
| 161 kDefaultRecordingCanvasSize = 32767, | 167 kDefaultRecordingCanvasSize = 32767, |
| 162 }; | 168 }; |
| 163 | 169 |
| 164 SkGPipeCanvas* fCanvas; | 170 SkGPipeCanvas* fCanvas; |
| 165 SkWriter32 fWriter; | 171 SkWriter32 fWriter; |
| 166 }; | 172 }; |
| 167 | 173 |
| 168 #endif | 174 #endif |
| OLD | NEW |