Index: src/core/SkPicture.cpp |
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
index 6c1f6cb759ee5f9338877e2bf3ea5bb37dc03ae8..4427e58bfe9aec93ccf7561b7f3554500844d5da 100644 |
--- a/src/core/SkPicture.cpp |
+++ b/src/core/SkPicture.cpp |
@@ -13,6 +13,15 @@ |
#include "SkPictureRecord.h" |
#include "SkPictureRecorder.h" |
+namespace { |
+#if defined(SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS) || \ |
+ 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
|
+bool gAllPictureIOSecurityPrecautionsEnabled = true; |
+#else |
+bool gAllPictureIOSecurityPrecautionsEnabled = false; |
+#endif |
+} // namespac |
+ |
DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage); |
/* SkPicture impl. This handles generic responsibilities like unique IDs and serialization. */ |
@@ -196,3 +205,12 @@ bool SkPicture::suitableForGpuRasterization(GrContext*, const char** whyNot) con |
} |
return true; |
} |
+ |
+// Global setting to disable security precautions for serialization. |
+void SkPicture::setPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) { |
+ gAllPictureIOSecurityPrecautionsEnabled = set; |
+} |
+ |
+bool SkPicture::pictureIOSecurityPrecautionsEnabled() { |
+ return gAllPictureIOSecurityPrecautionsEnabled; |
+} |