| 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 |
| 11 | 11 |
| 12 #include "SkColor.h" | 12 #include "SkColor.h" |
| 13 #include "SkError.h" |
| 13 #include "SkPaint.h" | 14 #include "SkPaint.h" |
| 14 #include "SkPoint.h" | 15 #include "SkPoint.h" |
| 15 | 16 |
| 16 class SkBitmap; | 17 class SkBitmap; |
| 17 class SkFlattenable; | 18 class SkFlattenable; |
| 18 struct SkIRect; | 19 struct SkIRect; |
| 19 class SkMatrix; | 20 class SkMatrix; |
| 20 class SkOrderedReadBuffer; | 21 class SkOrderedReadBuffer; |
| 21 class SkOrderedWriteBuffer; | 22 class SkOrderedWriteBuffer; |
| 22 class SkPath; | 23 class SkPath; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 SkPoint readPoint() { | 96 SkPoint readPoint() { |
| 96 SkPoint point; | 97 SkPoint point; |
| 97 this->readPoint(&point); | 98 this->readPoint(&point); |
| 98 return point; | 99 return point; |
| 99 } | 100 } |
| 100 | 101 |
| 101 template <typename T> T* readFlattenableT() { | 102 template <typename T> T* readFlattenableT() { |
| 102 return static_cast<T*>(this->readFlattenable()); | 103 return static_cast<T*>(this->readFlattenable()); |
| 103 } | 104 } |
| 104 | 105 |
| 106 void setError(SkError error) { |
| 107 fError = static_cast<SkError>(fError | error); |
| 108 } |
| 109 |
| 110 protected: |
| 111 SkError fError; |
| 112 |
| 105 private: | 113 private: |
| 106 uint32_t fFlags; | 114 uint32_t fFlags; |
| 107 }; | 115 }; |
| 108 | 116 |
| 109 /////////////////////////////////////////////////////////////////////////////// | 117 /////////////////////////////////////////////////////////////////////////////// |
| 110 | 118 |
| 111 class SkFlattenableWriteBuffer { | 119 class SkFlattenableWriteBuffer { |
| 112 public: | 120 public: |
| 113 SkFlattenableWriteBuffer(); | 121 SkFlattenableWriteBuffer(); |
| 114 virtual ~SkFlattenableWriteBuffer(); | 122 virtual ~SkFlattenableWriteBuffer(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 bool persistTypeface() const { return (fFlags & kCrossProcess_Flag) != 0; } | 174 bool persistTypeface() const { return (fFlags & kCrossProcess_Flag) != 0; } |
| 167 | 175 |
| 168 protected: | 176 protected: |
| 169 // A helper function so that each subclass does not have to be a friend of S
kFlattenable | 177 // A helper function so that each subclass does not have to be a friend of S
kFlattenable |
| 170 void flattenObject(SkFlattenable* obj, SkFlattenableWriteBuffer& buffer); | 178 void flattenObject(SkFlattenable* obj, SkFlattenableWriteBuffer& buffer); |
| 171 | 179 |
| 172 uint32_t fFlags; | 180 uint32_t fFlags; |
| 173 }; | 181 }; |
| 174 | 182 |
| 175 #endif | 183 #endif |
| OLD | NEW |