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

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

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 2nd proposition, with some comments adressed Created 7 years, 4 months 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/SkFlattenableBuffers.cpp » ('j') | src/core/SkImageFilter.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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkFlattenableBuffers.cpp » ('j') | src/core/SkImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698