Chromium Code Reviews| OLD | NEW |
|---|---|
| 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) | |
| 19 bool gAllPictureIOSecurityPrecautionsEnabled = true; | |
|
mtklein
2015/06/16 15:57:49
Skia tends to use static where possible instead of
hendrikw
2015/06/16 16:09:37
Done.
| |
| 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 Loading... | |
| 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 } | |
| OLD | NEW |