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

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

Issue 2379383002: Propagate validation errors (Closed)
Patch Set: fix spilling Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
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 "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkImageDeserializer.h" 9 #include "SkImageDeserializer.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 if (IsValidPictInfo(info)) { 151 if (IsValidPictInfo(info)) {
152 if (pInfo) { *pInfo = info; } 152 if (pInfo) { *pInfo = info; }
153 return true; 153 return true;
154 } 154 }
155 return false; 155 return false;
156 } 156 }
157 157
158 sk_sp<SkPicture> SkPicture::Forwardport(const SkPictInfo& info, 158 sk_sp<SkPicture> SkPicture::Forwardport(const SkPictInfo& info,
159 const SkPictureData* data, 159 const SkPictureData* data,
160 const SkReadBuffer* buffer) { 160 SkReadBuffer* buffer) {
161 if (!data) { 161 if (!data) {
162 return nullptr; 162 return nullptr;
163 } 163 }
164 SkPicturePlayback playback(data); 164 SkPicturePlayback playback(data);
165 SkPictureRecorder r; 165 SkPictureRecorder r;
166 playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/, buff er); 166 playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/, buff er);
167 return r.finishRecordingAsPicture(); 167 return r.finishRecordingAsPicture();
168 } 168 }
169 169
170 sk_sp<SkPicture> SkPicture::MakeFromStream(SkStream* stream, SkImageDeserializer * factory) { 170 sk_sp<SkPicture> SkPicture::MakeFromStream(SkStream* stream, SkImageDeserializer * factory) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 #endif 271 #endif
272 272
273 // Global setting to disable security precautions for serialization. 273 // Global setting to disable security precautions for serialization.
274 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) { 274 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) {
275 g_AllPictureIOSecurityPrecautionsEnabled = set; 275 g_AllPictureIOSecurityPrecautionsEnabled = set;
276 } 276 }
277 277
278 bool SkPicture::PictureIOSecurityPrecautionsEnabled() { 278 bool SkPicture::PictureIOSecurityPrecautionsEnabled() {
279 return g_AllPictureIOSecurityPrecautionsEnabled; 279 return g_AllPictureIOSecurityPrecautionsEnabled;
280 } 280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698