OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkImageFilter.h" | 10 #include "SkImageFilter.h" |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 self->fBytes.rewind(); | 704 self->fBytes.rewind(); |
705 | 705 |
706 SkAutoMutexAcquire lock(gFreeStackLock); | 706 SkAutoMutexAcquire lock(gFreeStackLock); |
707 self->fNext = gFreeStack; | 707 self->fNext = gFreeStack; |
708 gFreeStack = self; | 708 gFreeStack = self; |
709 return; | 709 return; |
710 } | 710 } |
711 | 711 |
712 delete this; | 712 delete this; |
713 } | 713 } |
| 714 |
| 715 void SkLiteDL::PurgeFreelist() { |
| 716 SkAutoMutexAcquire lock(gFreeStackLock); |
| 717 while (gFreeStack) { |
| 718 SkLiteDL* top = gFreeStack; |
| 719 gFreeStack = gFreeStack->fNext; |
| 720 delete top; // Calling unref() here would just put it back on the list
! |
| 721 } |
| 722 } |
OLD | NEW |