| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkValidatingReadBuffer_DEFINED | 8 #ifndef SkValidatingReadBuffer_DEFINED |
| 9 #define SkValidatingReadBuffer_DEFINED | 9 #define SkValidatingReadBuffer_DEFINED |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // binary data and arrays | 51 // binary data and arrays |
| 52 virtual bool readByteArray(void* value, size_t size) SK_OVERRIDE; | 52 virtual bool readByteArray(void* value, size_t size) SK_OVERRIDE; |
| 53 virtual bool readColorArray(SkColor* colors, size_t size) SK_OVERRIDE; | 53 virtual bool readColorArray(SkColor* colors, size_t size) SK_OVERRIDE; |
| 54 virtual bool readIntArray(int32_t* values, size_t size) SK_OVERRIDE; | 54 virtual bool readIntArray(int32_t* values, size_t size) SK_OVERRIDE; |
| 55 virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE; | 55 virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE; |
| 56 virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE; | 56 virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE; |
| 57 | 57 |
| 58 // helpers to get info about arrays and binary data | 58 // helpers to get info about arrays and binary data |
| 59 virtual uint32_t getArrayCount() SK_OVERRIDE; | 59 virtual uint32_t getArrayCount() SK_OVERRIDE; |
| 60 | 60 |
| 61 virtual void readBitmap(SkBitmap* bitmap) SK_OVERRIDE; | |
| 62 // TODO: Implement this (securely) when needed | 61 // TODO: Implement this (securely) when needed |
| 63 virtual SkTypeface* readTypeface() SK_OVERRIDE; | 62 virtual SkTypeface* readTypeface() SK_OVERRIDE; |
| 64 | 63 |
| 65 virtual bool validate(bool isValid) SK_OVERRIDE; | 64 virtual bool validate(bool isValid) SK_OVERRIDE; |
| 66 virtual bool isValid() const SK_OVERRIDE; | 65 virtual bool isValid() const SK_OVERRIDE; |
| 67 | 66 |
| 68 virtual bool validateAvailable(size_t size) SK_OVERRIDE; | 67 virtual bool validateAvailable(size_t size) SK_OVERRIDE; |
| 69 | 68 |
| 70 private: | 69 private: |
| 71 bool readArray(void* value, size_t size, size_t elementSize); | 70 bool readArray(void* value, size_t size, size_t elementSize); |
| 72 | 71 |
| 73 void setMemory(const void* data, size_t size); | 72 void setMemory(const void* data, size_t size); |
| 74 | 73 |
| 75 static bool IsPtrAlign4(const void* ptr) { | 74 static bool IsPtrAlign4(const void* ptr) { |
| 76 return SkIsAlign4((uintptr_t)ptr); | 75 return SkIsAlign4((uintptr_t)ptr); |
| 77 } | 76 } |
| 78 | 77 |
| 79 bool fError; | 78 bool fError; |
| 80 | 79 |
| 81 typedef SkReadBuffer INHERITED; | 80 typedef SkReadBuffer INHERITED; |
| 82 }; | 81 }; |
| 83 | 82 |
| 84 #endif // SkValidatingReadBuffer_DEFINED | 83 #endif // SkValidatingReadBuffer_DEFINED |
| OLD | NEW |