| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 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 #ifndef SkFlattenableBuffers_DEFINED | 9 #ifndef SkFlattenableBuffers_DEFINED |
| 10 #define SkFlattenableBuffers_DEFINED | 10 #define SkFlattenableBuffers_DEFINED |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 SkPoint readPoint() { | 95 SkPoint readPoint() { |
| 96 SkPoint point; | 96 SkPoint point; |
| 97 this->readPoint(&point); | 97 this->readPoint(&point); |
| 98 return point; | 98 return point; |
| 99 } | 99 } |
| 100 | 100 |
| 101 template <typename T> T* readFlattenableT() { | 101 template <typename T> T* readFlattenableT() { |
| 102 return static_cast<T*>(this->readFlattenable()); | 102 return static_cast<T*>(this->readFlattenable()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void setError() { |
| 106 fError = true; |
| 107 } |
| 108 |
| 109 protected: |
| 110 bool fError; |
| 111 |
| 105 private: | 112 private: |
| 106 uint32_t fFlags; | 113 uint32_t fFlags; |
| 107 }; | 114 }; |
| 108 | 115 |
| 109 /////////////////////////////////////////////////////////////////////////////// | 116 /////////////////////////////////////////////////////////////////////////////// |
| 110 | 117 |
| 111 class SkFlattenableWriteBuffer { | 118 class SkFlattenableWriteBuffer { |
| 112 public: | 119 public: |
| 113 SkFlattenableWriteBuffer(); | 120 SkFlattenableWriteBuffer(); |
| 114 virtual ~SkFlattenableWriteBuffer(); | 121 virtual ~SkFlattenableWriteBuffer(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 bool persistTypeface() const { return (fFlags & kCrossProcess_Flag) != 0; } | 173 bool persistTypeface() const { return (fFlags & kCrossProcess_Flag) != 0; } |
| 167 | 174 |
| 168 protected: | 175 protected: |
| 169 // A helper function so that each subclass does not have to be a friend of S
kFlattenable | 176 // A helper function so that each subclass does not have to be a friend of S
kFlattenable |
| 170 void flattenObject(SkFlattenable* obj, SkFlattenableWriteBuffer& buffer); | 177 void flattenObject(SkFlattenable* obj, SkFlattenableWriteBuffer& buffer); |
| 171 | 178 |
| 172 uint32_t fFlags; | 179 uint32_t fFlags; |
| 173 }; | 180 }; |
| 174 | 181 |
| 175 #endif | 182 #endif |
| OLD | NEW |