| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmapCache.h" | 8 #include "SkBitmapCache.h" |
| 9 #include "SkMutex.h" |
| 9 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
| 10 #include "SkThread.h" | |
| 11 #include "SkTraceEvent.h" | 11 #include "SkTraceEvent.h" |
| 12 | 12 |
| 13 //#define SK_SUPPORT_LEGACY_UNBALANCED_PIXELREF_LOCKCOUNT | 13 //#define SK_SUPPORT_LEGACY_UNBALANCED_PIXELREF_LOCKCOUNT |
| 14 //#define SK_TRACE_PIXELREF_LIFETIME | 14 //#define SK_TRACE_PIXELREF_LIFETIME |
| 15 | 15 |
| 16 #ifdef SK_BUILD_FOR_WIN32 | 16 #ifdef SK_BUILD_FOR_WIN32 |
| 17 // We don't have SK_BASE_MUTEX_INIT on Windows. | 17 // We don't have SK_BASE_MUTEX_INIT on Windows. |
| 18 | 18 |
| 19 // must be a power-of-2. undef to just use 1 mutex | 19 // must be a power-of-2. undef to just use 1 mutex |
| 20 #define PIXELREF_MUTEX_RING_COUNT 32 | 20 #define PIXELREF_MUTEX_RING_COUNT 32 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 } | 387 } |
| 388 | 388 |
| 389 result->fUnlockProc = unlock_legacy_result; | 389 result->fUnlockProc = unlock_legacy_result; |
| 390 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc | 390 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc |
| 391 result->fCTable = fRec.fColorTable; | 391 result->fCTable = fRec.fColorTable; |
| 392 result->fPixels = fRec.fPixels; | 392 result->fPixels = fRec.fPixels; |
| 393 result->fRowBytes = fRec.fRowBytes; | 393 result->fRowBytes = fRec.fRowBytes; |
| 394 result->fSize.set(fInfo.width(), fInfo.height()); | 394 result->fSize.set(fInfo.width(), fInfo.height()); |
| 395 return true; | 395 return true; |
| 396 } | 396 } |
| OLD | NEW |