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

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 functions 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 namespace {
17 #if defined(SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS) || \
18 defined(SK_ENABLE_PICTURE_IO_SECURITY_PRECAUTIONS)
hendrikw 2015/06/16 15:39:38 There was a comment about renaming previously, I'v
hendrikw 2015/06/16 15:40:37 Oops, last minute change, I have the logic wrong h
19 bool gAllPictureIOSecurityPrecautionsEnabled = true;
20 #else
21 bool gAllPictureIOSecurityPrecautionsEnabled = false;
22 #endif
23 } // namespac
24
16 DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage); 25 DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage);
17 26
18 /* SkPicture impl. This handles generic responsibilities like unique IDs and se rialization. */ 27 /* SkPicture impl. This handles generic responsibilities like unique IDs and se rialization. */
19 28
20 SkPicture::SkPicture() : fUniqueID(0) {} 29 SkPicture::SkPicture() : fUniqueID(0) {}
21 30
22 SkPicture::~SkPicture() { 31 SkPicture::~SkPicture() {
23 // TODO: move this to ~SkBigPicture() only? 32 // TODO: move this to ~SkBigPicture() only?
24 33
25 // If the ID is still zero, no one has read it, so no need to send this mess age. 34 // 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 } 198 }
190 } 199 }
191 200
192 bool SkPicture::suitableForGpuRasterization(GrContext*, const char** whyNot) con st { 201 bool SkPicture::suitableForGpuRasterization(GrContext*, const char** whyNot) con st {
193 if (this->numSlowPaths() > 5) { 202 if (this->numSlowPaths() > 5) {
194 if (whyNot) { *whyNot = "Too many slow paths (either concave or dashed). "; } 203 if (whyNot) { *whyNot = "Too many slow paths (either concave or dashed). "; }
195 return false; 204 return false;
196 } 205 }
197 return true; 206 return true;
198 } 207 }
208
209 // Global setting to disable security precautions for serialization.
210 void SkPicture::setPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) {
211 gAllPictureIOSecurityPrecautionsEnabled = set;
212 }
213
214 bool SkPicture::pictureIOSecurityPrecautionsEnabled() {
215 return gAllPictureIOSecurityPrecautionsEnabled;
216 }
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