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

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

Issue 1834303003: Delete SkFlattenable::Type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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/SkValidatingReadBuffer.h ('k') | src/utils/SkBitmapSourceDeserializer.h » ('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 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkErrorInternals.h" 9 #include "SkErrorInternals.h"
10 #include "SkValidatingReadBuffer.h" 10 #include "SkValidatingReadBuffer.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 SkTypeface* SkValidatingReadBuffer::readTypeface() { 215 SkTypeface* SkValidatingReadBuffer::readTypeface() {
216 SkASSERT(false); 216 SkASSERT(false);
217 // TODO: Implement this (securely) when needed 217 // TODO: Implement this (securely) when needed
218 return nullptr; 218 return nullptr;
219 } 219 }
220 220
221 bool SkValidatingReadBuffer::validateAvailable(size_t size) { 221 bool SkValidatingReadBuffer::validateAvailable(size_t size) {
222 return this->validate((size <= SK_MaxU32) && fReader.isAvailable(static_cast <uint32_t>(size))); 222 return this->validate((size <= SK_MaxU32) && fReader.isAvailable(static_cast <uint32_t>(size)));
223 } 223 }
224 224
225 SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type) { 225 SkFlattenable* SkValidatingReadBuffer::readFlattenable() {
226 SkString name; 226 SkString name;
227 this->readString(&name); 227 this->readString(&name);
228 if (fError) { 228 if (fError) {
229 return nullptr; 229 return nullptr;
230 } 230 }
231 231
232 const char* cname = name.c_str(); 232 const char* cname = name.c_str();
233 SkFlattenable::Factory factory = SkFlattenable::NameToFactory(cname); 233 SkFlattenable::Factory factory = SkFlattenable::NameToFactory(cname);
234 if (nullptr == factory) { 234 if (nullptr == factory) {
235 return nullptr; // writer failed to give us the flattenable 235 return nullptr; // writer failed to give us the flattenable
(...skipping 22 matching lines...) Expand all
258 258
259 void SkValidatingReadBuffer::skipFlattenable() { 259 void SkValidatingReadBuffer::skipFlattenable() {
260 SkString name; 260 SkString name;
261 this->readString(&name); 261 this->readString(&name);
262 if (fError) { 262 if (fError) {
263 return; 263 return;
264 } 264 }
265 uint32_t sizeRecorded = this->readUInt(); 265 uint32_t sizeRecorded = this->readUInt();
266 this->skip(sizeRecorded); 266 this->skip(sizeRecorded);
267 } 267 }
OLDNEW
« no previous file with comments | « src/core/SkValidatingReadBuffer.h ('k') | src/utils/SkBitmapSourceDeserializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698