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

Unified Diff: src/core/SkPicture.cpp

Issue 15538005: Patch to prevent chromium breakage until the DEPS. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPicture.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index ab2faea6b6b4eb38b6e0a9a9ac4ae5338cb46c8b..6d3772823c899408f935419dde90ae8791b1881c 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -301,6 +301,34 @@ void SkPicture::initFromStream(SkStream* stream, bool* success, InstallPixelRefP
}
}
+#define PREVENT_CHROME_BREAKAGE
+#ifdef PREVENT_CHROME_BREAKAGE
+// This block of code is to allow chromium to build until https://codereview.chromium.org/15496006/
+// is submitted. Then it will be reverted.
+#include "SkThread.h"
+
+static SkPicture::OldEncodeBitmap gOldEncodeBitmapFunction;
+
+SK_DECLARE_STATIC_MUTEX(gEncodeFunctionMutex);
+
+static SkData* encode_from_old_encoder(size_t* pixelRefOffset, const SkBitmap& bm) {
+ SkASSERT(gOldEncodeBitmapFunction != NULL);
+ SkDynamicMemoryWStream stream;
+ if (!gOldEncodeBitmapFunction(&stream, bm)) {
+ return NULL;
+ }
+ return stream.copyToData();
+}
+
+void SkPicture::serialize(SkWStream* stream, OldEncodeBitmap oldEncoder) const {
+ SkAutoMutexAcquire ac(gEncodeFunctionMutex);
+ gOldEncodeBitmapFunction = oldEncoder;
+ this->serialize(stream, &encode_from_old_encoder);
+ gOldEncodeBitmapFunction = NULL;
+}
+
+#endif // PREVENT_CHROME_BREAKAGE
+
void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
SkPicturePlayback* playback = fPlayback;
« no previous file with comments | « include/core/SkPicture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698