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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkPicture.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 // do this at the end, so that they will be zero if we hit an error. 296 // do this at the end, so that they will be zero if we hit an error.
297 fWidth = info.fWidth; 297 fWidth = info.fWidth;
298 fHeight = info.fHeight; 298 fHeight = info.fHeight;
299 if (success) { 299 if (success) {
300 *success = true; 300 *success = true;
301 } 301 }
302 } 302 }
303 303
304 #define PREVENT_CHROME_BREAKAGE
305 #ifdef PREVENT_CHROME_BREAKAGE
306 // This block of code is to allow chromium to build until https://codereview.chr omium.org/15496006/
307 // is submitted. Then it will be reverted.
308 #include "SkThread.h"
309
310 static SkPicture::OldEncodeBitmap gOldEncodeBitmapFunction;
311
312 SK_DECLARE_STATIC_MUTEX(gEncodeFunctionMutex);
313
314 static SkData* encode_from_old_encoder(size_t* pixelRefOffset, const SkBitmap& b m) {
315 SkASSERT(gOldEncodeBitmapFunction != NULL);
316 SkDynamicMemoryWStream stream;
317 if (!gOldEncodeBitmapFunction(&stream, bm)) {
318 return NULL;
319 }
320 return stream.copyToData();
321 }
322
323 void SkPicture::serialize(SkWStream* stream, OldEncodeBitmap oldEncoder) const {
324 SkAutoMutexAcquire ac(gEncodeFunctionMutex);
325 gOldEncodeBitmapFunction = oldEncoder;
326 this->serialize(stream, &encode_from_old_encoder);
327 gOldEncodeBitmapFunction = NULL;
328 }
329
330 #endif // PREVENT_CHROME_BREAKAGE
331
304 void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const { 332 void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
305 SkPicturePlayback* playback = fPlayback; 333 SkPicturePlayback* playback = fPlayback;
306 334
307 if (NULL == playback && fRecord) { 335 if (NULL == playback && fRecord) {
308 playback = SkNEW_ARGS(SkPicturePlayback, (*fRecord)); 336 playback = SkNEW_ARGS(SkPicturePlayback, (*fRecord));
309 } 337 }
310 338
311 SkPictInfo info; 339 SkPictInfo info;
312 340
313 info.fVersion = PICTURE_VERSION; 341 info.fVersion = PICTURE_VERSION;
(...skipping 21 matching lines...) Expand all
335 } 363 }
336 364
337 #ifdef SK_BUILD_FOR_ANDROID 365 #ifdef SK_BUILD_FOR_ANDROID
338 void SkPicture::abortPlayback() { 366 void SkPicture::abortPlayback() {
339 if (NULL == fPlayback) { 367 if (NULL == fPlayback) {
340 return; 368 return;
341 } 369 }
342 fPlayback->abort(); 370 fPlayback->abort();
343 } 371 }
344 #endif 372 #endif
OLDNEW
« 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