OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBitmapFactory.h" | 8 #include "SkBitmapFactory.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 dst->setConfig(config, info.fWidth, info.fHeight, target.fRowBytes, info.fAl
phaType); | 62 dst->setConfig(config, info.fWidth, info.fHeight, target.fRowBytes, info.fAl
phaType); |
63 | 63 |
64 // fImageCache and fCacheSelector are mutually exclusive. | 64 // fImageCache and fCacheSelector are mutually exclusive. |
65 SkASSERT(NULL == fImageCache || NULL == fCacheSelector); | 65 SkASSERT(NULL == fImageCache || NULL == fCacheSelector); |
66 | 66 |
67 SkImageCache* cache = NULL == fCacheSelector ? fImageCache : fCacheSelector-
>selectCache(info); | 67 SkImageCache* cache = NULL == fCacheSelector ? fImageCache : fCacheSelector-
>selectCache(info); |
68 | 68 |
69 if (cache != NULL) { | 69 if (cache != NULL) { |
70 // Now set a new LazyPixelRef on dst. | 70 // Now set a new LazyPixelRef on dst. |
71 SkAutoTUnref<SkLazyPixelRef> lazyRef(SkNEW_ARGS(SkLazyPixelRef, | 71 SkAutoTUnref<SkLazyPixelRef> lazyRef(SkNEW_ARGS(SkLazyPixelRef, |
72 (data, fDecodeProc, cach
e))); | 72 (info, data, fDecodeProc, cache))); |
73 dst->setPixelRef(lazyRef); | 73 dst->setPixelRef(lazyRef); |
74 return true; | 74 return true; |
75 } else { | 75 } else { |
76 dst->allocPixels(); | 76 dst->allocPixels(); |
77 target.fAddr = dst->getPixels(); | 77 target.fAddr = dst->getPixels(); |
78 return fDecodeProc(data->data(), data->size(), &info, &target); | 78 return fDecodeProc(data->data(), data->size(), &info, &target); |
79 } | 79 } |
80 } | 80 } |
OLD | NEW |