OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #ifndef SkPictureFlat_DEFINED | 8 #ifndef SkPictureFlat_DEFINED |
9 #define SkPictureFlat_DEFINED | 9 #define SkPictureFlat_DEFINED |
10 | 10 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 return flat; | 418 return flat; |
419 } | 419 } |
420 | 420 |
421 // findAndReturnMutableFlat gave us index (fNextIndex-1), but we'll use
the old one. | 421 // findAndReturnMutableFlat gave us index (fNextIndex-1), but we'll use
the old one. |
422 fIndexedData.remove(flat->index()); | 422 fIndexedData.remove(flat->index()); |
423 fNextIndex--; | 423 fNextIndex--; |
424 flat->setIndex(found->index()); | 424 flat->setIndex(found->index()); |
425 fIndexedData[flat->index()] = flat; | 425 fIndexedData[flat->index()] = flat; |
426 | 426 |
427 // findAndReturnMutableFlat already called fHash.add(), so we just clean
up the old entry. | 427 // findAndReturnMutableFlat already called fHash.add(), so we just clean
up the old entry. |
428 fHash.remove(*found); | 428 fHash.remove(found); |
429 fController->unalloc((void*)found); | 429 fController->unalloc((void*)found); |
430 SkASSERT(this->count() == oldCount); | 430 SkASSERT(this->count() == oldCount); |
431 | 431 |
432 *replaced = true; | 432 *replaced = true; |
433 return flat; | 433 return flat; |
434 } | 434 } |
435 | 435 |
436 /** | 436 /** |
437 * Unflatten the objects and return them in SkTRefArray, or return NULL | 437 * Unflatten the objects and return them in SkTRefArray, or return NULL |
438 * if there no objects. Caller takes ownership of result. | 438 * if there no objects. Caller takes ownership of result. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { | 673 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { |
674 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); | 674 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); |
675 } | 675 } |
676 | 676 |
677 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { | 677 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { |
678 buffer.getReader32()->readRegion((SkRegion*)obj); | 678 buffer.getReader32()->readRegion((SkRegion*)obj); |
679 } | 679 } |
680 }; | 680 }; |
681 | 681 |
682 #endif | 682 #endif |
OLD | NEW |