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

Side by Side Diff: src/core/SkValidatingReadBuffer.h

Issue 806653007: Fix up all the easy virtual ... SK_OVERRIDE cases. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 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 | « src/core/SkTypeface.cpp ('k') | src/core/SkXfermode.cpp » ('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 * 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 "SkReadBuffer.h" 13 #include "SkReadBuffer.h"
14 #include "SkWriteBuffer.h" 14 #include "SkWriteBuffer.h"
15 #include "SkPath.h" 15 #include "SkPath.h"
16 #include "SkPicture.h" 16 #include "SkPicture.h"
17 #include "SkReader32.h" 17 #include "SkReader32.h"
18 18
19 class SkBitmap; 19 class SkBitmap;
20 20
21 class SkValidatingReadBuffer : public SkReadBuffer { 21 class SkValidatingReadBuffer : public SkReadBuffer {
22 public: 22 public:
23 SkValidatingReadBuffer(const void* data, size_t size); 23 SkValidatingReadBuffer(const void* data, size_t size);
24 virtual ~SkValidatingReadBuffer(); 24 virtual ~SkValidatingReadBuffer();
25 25
26 virtual const void* skip(size_t size) SK_OVERRIDE; 26 const void* skip(size_t size) SK_OVERRIDE;
27 27
28 // primitives 28 // primitives
29 virtual bool readBool() SK_OVERRIDE; 29 bool readBool() SK_OVERRIDE;
30 virtual SkColor readColor() SK_OVERRIDE; 30 SkColor readColor() SK_OVERRIDE;
31 virtual SkFixed readFixed() SK_OVERRIDE; 31 SkFixed readFixed() SK_OVERRIDE;
32 virtual int32_t readInt() SK_OVERRIDE; 32 int32_t readInt() SK_OVERRIDE;
33 virtual SkScalar readScalar() SK_OVERRIDE; 33 SkScalar readScalar() SK_OVERRIDE;
34 virtual uint32_t readUInt() SK_OVERRIDE; 34 uint32_t readUInt() SK_OVERRIDE;
35 virtual int32_t read32() SK_OVERRIDE; 35 int32_t read32() SK_OVERRIDE;
36 36
37 // strings -- the caller is responsible for freeing the string contents 37 // strings -- the caller is responsible for freeing the string contents
38 virtual void readString(SkString* string) SK_OVERRIDE; 38 void readString(SkString* string) SK_OVERRIDE;
39 virtual void* readEncodedString(size_t* length, SkPaint::TextEncoding encodi ng) SK_OVERRIDE; 39 void* readEncodedString(size_t* length, SkPaint::TextEncoding encoding) SK_O VERRIDE;
40 40
41 // common data structures 41 // common data structures
42 virtual SkFlattenable* readFlattenable(SkFlattenable::Type type) SK_OVERRIDE ; 42 SkFlattenable* readFlattenable(SkFlattenable::Type type) SK_OVERRIDE;
43 virtual void skipFlattenable() SK_OVERRIDE; 43 void skipFlattenable() SK_OVERRIDE;
44 virtual void readPoint(SkPoint* point) SK_OVERRIDE; 44 void readPoint(SkPoint* point) SK_OVERRIDE;
45 virtual void readMatrix(SkMatrix* matrix) SK_OVERRIDE; 45 void readMatrix(SkMatrix* matrix) SK_OVERRIDE;
46 virtual void readIRect(SkIRect* rect) SK_OVERRIDE; 46 void readIRect(SkIRect* rect) SK_OVERRIDE;
47 virtual void readRect(SkRect* rect) SK_OVERRIDE; 47 void readRect(SkRect* rect) SK_OVERRIDE;
48 virtual void readRegion(SkRegion* region) SK_OVERRIDE; 48 void readRegion(SkRegion* region) SK_OVERRIDE;
49 virtual void readPath(SkPath* path) SK_OVERRIDE; 49 void readPath(SkPath* path) SK_OVERRIDE;
50 50
51 // binary data and arrays 51 // binary data and arrays
52 virtual bool readByteArray(void* value, size_t size) SK_OVERRIDE; 52 bool readByteArray(void* value, size_t size) SK_OVERRIDE;
53 virtual bool readColorArray(SkColor* colors, size_t size) SK_OVERRIDE; 53 bool readColorArray(SkColor* colors, size_t size) SK_OVERRIDE;
54 virtual bool readIntArray(int32_t* values, size_t size) SK_OVERRIDE; 54 bool readIntArray(int32_t* values, size_t size) SK_OVERRIDE;
55 virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE; 55 bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE;
56 virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE; 56 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 uint32_t getArrayCount() SK_OVERRIDE;
60 60
61 // TODO: Implement this (securely) when needed 61 // TODO: Implement this (securely) when needed
62 virtual SkTypeface* readTypeface() SK_OVERRIDE; 62 SkTypeface* readTypeface() SK_OVERRIDE;
63 63
64 virtual bool validate(bool isValid) SK_OVERRIDE; 64 bool validate(bool isValid) SK_OVERRIDE;
65 virtual bool isValid() const SK_OVERRIDE; 65 bool isValid() const SK_OVERRIDE;
66 66
67 virtual bool validateAvailable(size_t size) SK_OVERRIDE; 67 bool validateAvailable(size_t size) SK_OVERRIDE;
68 68
69 private: 69 private:
70 bool readArray(void* value, size_t size, size_t elementSize); 70 bool readArray(void* value, size_t size, size_t elementSize);
71 71
72 void setMemory(const void* data, size_t size); 72 void setMemory(const void* data, size_t size);
73 73
74 static bool IsPtrAlign4(const void* ptr) { 74 static bool IsPtrAlign4(const void* ptr) {
75 return SkIsAlign4((uintptr_t)ptr); 75 return SkIsAlign4((uintptr_t)ptr);
76 } 76 }
77 77
78 bool fError; 78 bool fError;
79 79
80 typedef SkReadBuffer INHERITED; 80 typedef SkReadBuffer INHERITED;
81 }; 81 };
82 82
83 #endif // SkValidatingReadBuffer_DEFINED 83 #endif // SkValidatingReadBuffer_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698