Chromium Code Reviews| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 return point; | 137 return point; |
| 138 } | 138 } |
| 139 | 139 |
| 140 SkData* readByteArrayAsData() { | 140 SkData* readByteArrayAsData() { |
| 141 size_t len = this->getArrayCount(); | 141 size_t len = this->getArrayCount(); |
| 142 void* buffer = sk_malloc_throw(len); | 142 void* buffer = sk_malloc_throw(len); |
| 143 (void)this->readByteArray(buffer, len); | 143 (void)this->readByteArray(buffer, len); |
| 144 return SkData::NewFromMalloc(buffer, len); | 144 return SkData::NewFromMalloc(buffer, len); |
| 145 } | 145 } |
| 146 | 146 |
| 147 virtual void validate(bool isValid) {} | 147 virtual bool validate(bool isValid) { return true; } |
|
reed1
2013/11/08 18:15:39
Lets keep the impls for virtuals in the .cpp
reed1
2013/11/08 18:15:39
I think we need some dox for this guy, now that th
sugoi1
2013/11/08 18:40:56
Done.
sugoi1
2013/11/08 18:40:56
Done.
| |
| 148 | 148 |
| 149 private: | 149 private: |
| 150 template <typename T> T* readFlattenableT(); | 150 template <typename T> T* readFlattenableT(); |
| 151 uint32_t fFlags; | 151 uint32_t fFlags; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 /////////////////////////////////////////////////////////////////////////////// | 154 /////////////////////////////////////////////////////////////////////////////// |
| 155 | 155 |
| 156 class SkFlattenableWriteBuffer { | 156 class SkFlattenableWriteBuffer { |
| 157 public: | 157 public: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 } | 224 } |
| 225 | 225 |
| 226 protected: | 226 protected: |
| 227 // A helper function so that each subclass does not have to be a friend of S kFlattenable | 227 // A helper function so that each subclass does not have to be a friend of S kFlattenable |
| 228 void flattenObject(const SkFlattenable* obj, SkFlattenableWriteBuffer& buffe r); | 228 void flattenObject(const SkFlattenable* obj, SkFlattenableWriteBuffer& buffe r); |
| 229 | 229 |
| 230 uint32_t fFlags; | 230 uint32_t fFlags; |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 #endif | 233 #endif |
| OLD | NEW |