aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicture.cpp
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-21 20:45:03 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-21 20:45:03 +0000
commitedef4aa8d84f9d0cfa49e9b7c761bb986af63142 (patch)
tree3a5068bc5c64964ba3d07dc0e7158583fb745af2 /src/core/SkPicture.cpp
parent61d6c9ef8fa1f650722e13d35a9d4d490ffa24b4 (diff)
Patch to prevent chromium breakage until the DEPS.
Once https://codereview.chromium.org/15489004/ is submitted to Skia, a DEPS roll into chrome will break due to a change in the API. A long term fix for chrome to use the new API is at https://codereview.chromium.org/15496006/, but since it depends on the earlier Skia change, this patch fills in the gap. Will be reverted once https://codereview.chromium.org/15496006/ is submitted to chrome. R=djsollen@google.com Review URL: https://codereview.chromium.org/15538005 git-svn-id: http://skia.googlecode.com/svn/trunk@9228 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPicture.cpp')
-rw-r--r--src/core/SkPicture.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index ab2faea6b6..6d3772823c 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;