| 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 |
| 11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
| 12 #include "SkBitmapHeap.h" | 12 #include "SkBitmapHeap.h" |
| 13 #include "SkFlattenableBuffers.h" | 13 #include "SkReadBuffer.h" |
| 14 #include "SkWriteBuffer.h" |
| 14 #include "SkPath.h" | 15 #include "SkPath.h" |
| 15 #include "SkPicture.h" | 16 #include "SkPicture.h" |
| 16 #include "SkReader32.h" | 17 #include "SkReader32.h" |
| 17 | 18 |
| 18 class SkBitmap; | 19 class SkBitmap; |
| 19 | 20 |
| 20 class SkValidatingReadBuffer : public SkFlattenableReadBuffer { | 21 class SkValidatingReadBuffer : public SkReadBuffer { |
| 21 public: | 22 public: |
| 22 SkValidatingReadBuffer(const void* data, size_t size); | 23 SkValidatingReadBuffer(const void* data, size_t size); |
| 23 virtual ~SkValidatingReadBuffer(); | 24 virtual ~SkValidatingReadBuffer(); |
| 24 | 25 |
| 25 const void* skip(size_t size); | 26 const void* skip(size_t size); |
| 26 | 27 |
| 27 // primitives | 28 // primitives |
| 28 virtual bool readBool() SK_OVERRIDE; | 29 virtual bool readBool() SK_OVERRIDE; |
| 29 virtual SkColor readColor() SK_OVERRIDE; | 30 virtual SkColor readColor() SK_OVERRIDE; |
| 30 virtual SkFixed readFixed() SK_OVERRIDE; | 31 virtual SkFixed readFixed() SK_OVERRIDE; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 71 |
| 71 void setMemory(const void* data, size_t size); | 72 void setMemory(const void* data, size_t size); |
| 72 | 73 |
| 73 static bool IsPtrAlign4(const void* ptr) { | 74 static bool IsPtrAlign4(const void* ptr) { |
| 74 return SkIsAlign4((uintptr_t)ptr); | 75 return SkIsAlign4((uintptr_t)ptr); |
| 75 } | 76 } |
| 76 | 77 |
| 77 SkReader32 fReader; | 78 SkReader32 fReader; |
| 78 bool fError; | 79 bool fError; |
| 79 | 80 |
| 80 typedef SkFlattenableReadBuffer INHERITED; | 81 typedef SkReadBuffer INHERITED; |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 #endif // SkValidatingReadBuffer_DEFINED | 84 #endif // SkValidatingReadBuffer_DEFINED |
| OLD | NEW |