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

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

Issue 1183853003: skia: Add runtime option to disable picture IO security precautions (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rename stuff Created 5 years, 6 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 | « include/core/SkPicture.h ('k') | src/core/SkPictureShader.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 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 "SkMessageBus.h" 9 #include "SkMessageBus.h"
10 #include "SkPicture.h" 10 #include "SkPicture.h"
11 #include "SkPictureData.h" 11 #include "SkPictureData.h"
12 #include "SkPicturePlayback.h" 12 #include "SkPicturePlayback.h"
13 #include "SkPictureRecord.h" 13 #include "SkPictureRecord.h"
14 #include "SkPictureRecorder.h" 14 #include "SkPictureRecorder.h"
15 15
16 #if defined(SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS) || \
17 defined(SK_ENABLE_PICTURE_IO_SECURITY_PRECAUTIONS)
18 static bool g_AllPictureIOSecurityPrecautionsEnabled = true;
19 #else
20 static bool g_AllPictureIOSecurityPrecautionsEnabled = false;
21 #endif
22
16 DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage); 23 DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage);
17 24
18 /* SkPicture impl. This handles generic responsibilities like unique IDs and se rialization. */ 25 /* SkPicture impl. This handles generic responsibilities like unique IDs and se rialization. */
19 26
20 SkPicture::SkPicture() : fUniqueID(0) {} 27 SkPicture::SkPicture() : fUniqueID(0) {}
21 28
22 SkPicture::~SkPicture() { 29 SkPicture::~SkPicture() {
23 // TODO: move this to ~SkBigPicture() only? 30 // TODO: move this to ~SkBigPicture() only?
24 31
25 // If the ID is still zero, no one has read it, so no need to send this mess age. 32 // If the ID is still zero, no one has read it, so no need to send this mess age.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 196 }
190 } 197 }
191 198
192 bool SkPicture::suitableForGpuRasterization(GrContext*, const char** whyNot) con st { 199 bool SkPicture::suitableForGpuRasterization(GrContext*, const char** whyNot) con st {
193 if (this->numSlowPaths() > 5) { 200 if (this->numSlowPaths() > 5) {
194 if (whyNot) { *whyNot = "Too many slow paths (either concave or dashed). "; } 201 if (whyNot) { *whyNot = "Too many slow paths (either concave or dashed). "; }
195 return false; 202 return false;
196 } 203 }
197 return true; 204 return true;
198 } 205 }
206
207 // Global setting to disable security precautions for serialization.
208 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) {
209 g_AllPictureIOSecurityPrecautionsEnabled = set;
210 }
211
212 bool SkPicture::PictureIOSecurityPrecautionsEnabled() {
213 return g_AllPictureIOSecurityPrecautionsEnabled;
214 }
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698