OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
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 | 9 |
10 #ifndef SkReader32_DEFINED | 10 #ifndef SkReader32_DEFINED |
11 #define SkReader32_DEFINED | 11 #define SkReader32_DEFINED |
12 | 12 |
13 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
14 #include "SkPath.h" | 14 #include "SkPath.h" |
15 #include "SkRegion.h" | 15 #include "SkRegion.h" |
16 #include "SkRRect.h" | 16 #include "SkRRect.h" |
17 #include "SkScalar.h" | 17 #include "SkScalar.h" |
18 #include "SkPatch.h" | |
18 | 19 |
19 class SkString; | 20 class SkString; |
20 | 21 |
21 class SkReader32 : SkNoncopyable { | 22 class SkReader32 : SkNoncopyable { |
22 public: | 23 public: |
23 SkReader32() : fCurr(NULL), fStop(NULL), fBase(NULL) {} | 24 SkReader32() : fCurr(NULL), fStop(NULL), fBase(NULL) {} |
24 SkReader32(const void* data, size_t size) { | 25 SkReader32(const void* data, size_t size) { |
25 this->setMemory(data, size); | 26 this->setMemory(data, size); |
26 } | 27 } |
27 | 28 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 SkASSERT(ptr_align_4(fCurr)); | 99 SkASSERT(ptr_align_4(fCurr)); |
99 memcpy(dst, fCurr, size); | 100 memcpy(dst, fCurr, size); |
100 fCurr += SkAlign4(size); | 101 fCurr += SkAlign4(size); |
101 SkASSERT(fCurr <= fStop); | 102 SkASSERT(fCurr <= fStop); |
102 } | 103 } |
103 | 104 |
104 uint8_t readU8() { return (uint8_t)this->readInt(); } | 105 uint8_t readU8() { return (uint8_t)this->readInt(); } |
105 uint16_t readU16() { return (uint16_t)this->readInt(); } | 106 uint16_t readU16() { return (uint16_t)this->readInt(); } |
106 int32_t readS32() { return this->readInt(); } | 107 int32_t readS32() { return this->readInt(); } |
107 uint32_t readU32() { return this->readInt(); } | 108 uint32_t readU32() { return this->readInt(); } |
109 | |
110 bool readPatch(SkPatch* patch) { | |
robertphillips
2014/08/04 18:44:18
this-> ?
dandov
2014/08/04 19:59:27
Done and also added (this->) to similar calls.
| |
111 return readObjectFromMemory(patch); | |
112 } | |
108 | 113 |
109 bool readPath(SkPath* path) { | 114 bool readPath(SkPath* path) { |
110 return readObjectFromMemory(path); | 115 return readObjectFromMemory(path); |
111 } | 116 } |
112 | 117 |
113 bool readMatrix(SkMatrix* matrix) { | 118 bool readMatrix(SkMatrix* matrix) { |
114 return readObjectFromMemory(matrix); | 119 return readObjectFromMemory(matrix); |
115 } | 120 } |
116 | 121 |
117 bool readRRect(SkRRect* rrect) { | 122 bool readRRect(SkRRect* rrect) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 const char* fBase; // beginning of buffer | 156 const char* fBase; // beginning of buffer |
152 | 157 |
153 #ifdef SK_DEBUG | 158 #ifdef SK_DEBUG |
154 static bool ptr_align_4(const void* ptr) { | 159 static bool ptr_align_4(const void* ptr) { |
155 return (((const char*)ptr - (const char*)NULL) & 3) == 0; | 160 return (((const char*)ptr - (const char*)NULL) & 3) == 0; |
156 } | 161 } |
157 #endif | 162 #endif |
158 }; | 163 }; |
159 | 164 |
160 #endif | 165 #endif |
OLD | NEW |