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

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

Issue 463493002: SkCanvas::drawPatch param SkPoint[12] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed GPU headers from GM Created 6 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
« no previous file with comments | « include/core/SkReadBuffer.h ('k') | include/core/SkWriter32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
19 18
20 class SkString; 19 class SkString;
21 20
22 class SkReader32 : SkNoncopyable { 21 class SkReader32 : SkNoncopyable {
23 public: 22 public:
24 SkReader32() : fCurr(NULL), fStop(NULL), fBase(NULL) {} 23 SkReader32() : fCurr(NULL), fStop(NULL), fBase(NULL) {}
25 SkReader32(const void* data, size_t size) { 24 SkReader32(const void* data, size_t size) {
26 this->setMemory(data, size); 25 this->setMemory(data, size);
27 } 26 }
28 27
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 SkASSERT(ptr_align_4(fCurr)); 98 SkASSERT(ptr_align_4(fCurr));
100 memcpy(dst, fCurr, size); 99 memcpy(dst, fCurr, size);
101 fCurr += SkAlign4(size); 100 fCurr += SkAlign4(size);
102 SkASSERT(fCurr <= fStop); 101 SkASSERT(fCurr <= fStop);
103 } 102 }
104 103
105 uint8_t readU8() { return (uint8_t)this->readInt(); } 104 uint8_t readU8() { return (uint8_t)this->readInt(); }
106 uint16_t readU16() { return (uint16_t)this->readInt(); } 105 uint16_t readU16() { return (uint16_t)this->readInt(); }
107 int32_t readS32() { return this->readInt(); } 106 int32_t readS32() { return this->readInt(); }
108 uint32_t readU32() { return this->readInt(); } 107 uint32_t readU32() { return this->readInt(); }
109
110 bool readPatch(SkPatch* patch) {
111 return this->readObjectFromMemory(patch);
112 }
113 108
114 bool readPath(SkPath* path) { 109 bool readPath(SkPath* path) {
115 return this->readObjectFromMemory(path); 110 return this->readObjectFromMemory(path);
116 } 111 }
117 112
118 bool readMatrix(SkMatrix* matrix) { 113 bool readMatrix(SkMatrix* matrix) {
119 return this->readObjectFromMemory(matrix); 114 return this->readObjectFromMemory(matrix);
120 } 115 }
121 116
122 bool readRRect(SkRRect* rrect) { 117 bool readRRect(SkRRect* rrect) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 const char* fBase; // beginning of buffer 151 const char* fBase; // beginning of buffer
157 152
158 #ifdef SK_DEBUG 153 #ifdef SK_DEBUG
159 static bool ptr_align_4(const void* ptr) { 154 static bool ptr_align_4(const void* ptr) {
160 return (((const char*)ptr - (const char*)NULL) & 3) == 0; 155 return (((const char*)ptr - (const char*)NULL) & 3) == 0;
161 } 156 }
162 #endif 157 #endif
163 }; 158 };
164 159
165 #endif 160 #endif
OLDNEW
« no previous file with comments | « include/core/SkReadBuffer.h ('k') | include/core/SkWriter32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698