Chromium Code Reviews| Index: include/core/SkFlattenableBuffers.h |
| diff --git a/include/core/SkFlattenableBuffers.h b/include/core/SkFlattenableBuffers.h |
| index 6e44550be561c6f267ade5f6655557a03d2edb3f..9d40e96d08b57d8e877b003b14509ed96e4d3774 100644 |
| --- a/include/core/SkFlattenableBuffers.h |
| +++ b/include/core/SkFlattenableBuffers.h |
| @@ -99,11 +99,16 @@ public: |
| virtual void readPath(SkPath* path) = 0; |
| // binary data and arrays |
| - virtual uint32_t readByteArray(void* value) = 0; |
| - virtual uint32_t readColorArray(SkColor* colors) = 0; |
| - virtual uint32_t readIntArray(int32_t* values) = 0; |
| - virtual uint32_t readPointArray(SkPoint* points) = 0; |
| - virtual uint32_t readScalarArray(SkScalar* values) = 0; |
| + |
| + /** |
| + * In the following read.*Array(...) functions, the size parameter specifies |
| + * the allocation size (in bytes) of the pointer parameter. |
|
reed1
2013/10/24 16:10:33
// What does the return value indicate? What is th
sugoi1
2013/10/24 19:40:04
Done.
|
| + */ |
| + virtual uint32_t readByteArray(void* value, uint32_t size) = 0; |
| + virtual uint32_t readColorArray(SkColor* colors, uint32_t size) = 0; |
| + virtual uint32_t readIntArray(int32_t* values, uint32_t size) = 0; |
| + virtual uint32_t readPointArray(SkPoint* points, uint32_t size) = 0; |
| + virtual uint32_t readScalarArray(SkScalar* values, uint32_t size) = 0; |
| /** This helper peeks into the buffer and reports back the length of the next array in |
| * the buffer but does not change the state of the buffer. |
| @@ -127,7 +132,7 @@ public: |
| SkData* readByteArrayAsData() { |
| size_t len = this->getArrayCount(); |
| void* buffer = sk_malloc_throw(len); |
| - (void)this->readByteArray(buffer); |
| + (void)this->readByteArray(buffer, len); |
| return SkData::NewFromMalloc(buffer, len); |
| } |