Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: include/core/SkFlattenableBuffers.h

Issue 61913002: Adding error checks to SkRBuffer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed serialization tests Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/core/SkBuffer.h » ('j') | src/core/SkPath.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBuffer.h » ('j') | src/core/SkPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698