OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
11 #include "SkChecksum.h" | 11 #include "SkChecksum.h" |
12 #include "SkDevice.h" | 12 #include "SkDevice.h" |
13 #include "SkLazyPtr.h" | 13 #include "SkLazyPtr.h" |
14 #include "SkMatrixImageFilter.h" | 14 #include "SkMatrixImageFilter.h" |
15 #include "SkReadBuffer.h" | 15 #include "SkReadBuffer.h" |
16 #include "SkWriteBuffer.h" | 16 #include "SkWriteBuffer.h" |
17 #include "SkRect.h" | 17 #include "SkRect.h" |
18 #include "SkTDynamicHash.h" | 18 #include "SkTDynamicHash.h" |
19 #include "SkTInternalLList.h" | 19 #include "SkTInternalLList.h" |
20 #include "SkValidationUtils.h" | 20 #include "SkValidationUtils.h" |
21 #if SK_SUPPORT_GPU | 21 #if SK_SUPPORT_GPU |
22 #include "GrContext.h" | 22 #include "GrContext.h" |
23 #include "SkGrPixelRef.h" | 23 #include "SkGrPixelRef.h" |
24 #include "SkGr.h" | 24 #include "SkGr.h" |
25 #endif | 25 #endif |
26 | 26 |
27 enum { kDefaultCacheSize = 128 * 1024 * 1024 }; | 27 #ifdef SK_BUILD_FOR_IOS |
| 28 enum { kDefaultCacheSize = 2 * 1024 * 1024 }; |
| 29 #else |
| 30 enum { kDefaultCacheSize = 128 * 1024 * 1024 }; |
| 31 #endif |
28 | 32 |
29 static int32_t next_image_filter_unique_id() { | 33 static int32_t next_image_filter_unique_id() { |
30 static int32_t gImageFilterUniqueID; | 34 static int32_t gImageFilterUniqueID; |
31 | 35 |
32 // Never return 0. | 36 // Never return 0. |
33 int32_t id; | 37 int32_t id; |
34 do { | 38 do { |
35 id = sk_atomic_inc(&gImageFilterUniqueID) + 1; | 39 id = sk_atomic_inc(&gImageFilterUniqueID) + 1; |
36 } while (0 == id); | 40 } while (0 == id); |
37 return id; | 41 return id; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 498 |
495 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { | 499 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { |
496 return SkNEW_ARGS(CacheImpl, (maxBytes)); | 500 return SkNEW_ARGS(CacheImpl, (maxBytes)); |
497 } | 501 } |
498 | 502 |
499 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); | 503 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); |
500 | 504 |
501 SkImageFilter::Cache* SkImageFilter::Cache::Get() { | 505 SkImageFilter::Cache* SkImageFilter::Cache::Get() { |
502 return cache.get(); | 506 return cache.get(); |
503 } | 507 } |
OLD | NEW |