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

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

Issue 2290653002: change readTypeface to return sk_sp (Closed)
Patch Set: Created 4 years, 3 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/SkReadBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.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
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // binary data and arrays 55 // binary data and arrays
56 bool readByteArray(void* value, size_t size) override; 56 bool readByteArray(void* value, size_t size) override;
57 bool readColorArray(SkColor* colors, size_t size) override; 57 bool readColorArray(SkColor* colors, size_t size) override;
58 bool readIntArray(int32_t* values, size_t size) override; 58 bool readIntArray(int32_t* values, size_t size) override;
59 bool readPointArray(SkPoint* points, size_t size) override; 59 bool readPointArray(SkPoint* points, size_t size) override;
60 bool readScalarArray(SkScalar* values, size_t size) override; 60 bool readScalarArray(SkScalar* values, size_t size) override;
61 61
62 // helpers to get info about arrays and binary data 62 // helpers to get info about arrays and binary data
63 uint32_t getArrayCount() override; 63 uint32_t getArrayCount() override;
64 64
65 // TODO: Implement this (securely) when needed
66 SkTypeface* readTypeface() override;
67
68 bool validate(bool isValid) override; 65 bool validate(bool isValid) override;
69 bool isValid() const override; 66 bool isValid() const override;
70 67
71 bool validateAvailable(size_t size) override; 68 bool validateAvailable(size_t size) override;
72 69
73 private: 70 private:
74 bool readArray(void* value, size_t size, size_t elementSize); 71 bool readArray(void* value, size_t size, size_t elementSize);
75 72
76 void setMemory(const void* data, size_t size); 73 void setMemory(const void* data, size_t size);
77 74
78 static bool IsPtrAlign4(const void* ptr) { 75 static bool IsPtrAlign4(const void* ptr) {
79 return SkIsAlign4((uintptr_t)ptr); 76 return SkIsAlign4((uintptr_t)ptr);
80 } 77 }
81 78
82 bool fError; 79 bool fError;
83 80
84 typedef SkReadBuffer INHERITED; 81 typedef SkReadBuffer INHERITED;
85 }; 82 };
86 83
87 #endif // SkValidatingReadBuffer_DEFINED 84 #endif // SkValidatingReadBuffer_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698