| 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 #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 Loading... |
| 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 } |
| OLD | NEW |