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

Unified Diff: src/core/SkOrderedReadBuffer.h

Issue 37803002: Adding size parameter to read array functions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed comments Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkOrderedReadBuffer.h
diff --git a/src/core/SkOrderedReadBuffer.h b/src/core/SkOrderedReadBuffer.h
index d864465cff106816268acc89350f92f3c0643856..2c4f480e739fab2324b1543ecd7d8edcabfcd0a3 100644
--- a/src/core/SkOrderedReadBuffer.h
+++ b/src/core/SkOrderedReadBuffer.h
@@ -61,11 +61,11 @@ public:
virtual void readPath(SkPath* path) SK_OVERRIDE;
// binary data and arrays
- virtual uint32_t readByteArray(void* value) SK_OVERRIDE;
- virtual uint32_t readColorArray(SkColor* colors) SK_OVERRIDE;
- virtual uint32_t readIntArray(int32_t* values) SK_OVERRIDE;
- virtual uint32_t readPointArray(SkPoint* points) SK_OVERRIDE;
- virtual uint32_t readScalarArray(SkScalar* values) SK_OVERRIDE;
+ virtual bool readByteArray(void* value, size_t size) SK_OVERRIDE;
+ virtual bool readColorArray(SkColor* colors, size_t size) SK_OVERRIDE;
+ virtual bool readIntArray(int32_t* values, size_t size) SK_OVERRIDE;
+ virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE;
+ virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE;
// helpers to get info about arrays and binary data
virtual uint32_t getArrayCount() SK_OVERRIDE;
@@ -113,6 +113,8 @@ public:
}
private:
+ bool readArray(void* value, size_t size, size_t elementSize);
+
SkReader32 fReader;
void* fMemoryPtr;

Powered by Google App Engine
This is Rietveld 408576698