| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBitmapCache.h" | 9 #include "SkBitmapCache.h" |
| 10 #include "SkImage_Base.h" | 10 #include "SkImage_Base.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 if (*subset != bounds) { | 48 if (*subset != bounds) { |
| 49 // we need a different uniqueID since we really are a subset of the
raw generator | 49 // we need a different uniqueID since we really are a subset of the
raw generator |
| 50 uniqueID = SkNextID::ImageID(); | 50 uniqueID = SkNextID::ImageID(); |
| 51 } | 51 } |
| 52 } else { | 52 } else { |
| 53 subset = &bounds; | 53 subset = &bounds; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Now that we know we can hand-off the generator (to be owned by the cacher
ator) we can | 56 // Now that we know we can hand-off the generator (to be owned by the cacher
ator) we can |
| 57 // release our holder. (we DONT want to delete it here anymore) | 57 // release our holder. (we DONT want to delete it here anymore) |
| 58 genHolder.detach(); | 58 genHolder.release(); |
| 59 | 59 |
| 60 return new SkImageCacherator(gen, gen->getInfo().makeWH(subset->width(), sub
set->height()), | 60 return new SkImageCacherator(gen, gen->getInfo().makeWH(subset->width(), sub
set->height()), |
| 61 SkIPoint::Make(subset->x(), subset->y()), uniqu
eID); | 61 SkIPoint::Make(subset->x(), subset->y()), uniqu
eID); |
| 62 } | 62 } |
| 63 | 63 |
| 64 SkImageCacherator::SkImageCacherator(SkImageGenerator* gen, const SkImageInfo& i
nfo, | 64 SkImageCacherator::SkImageCacherator(SkImageGenerator* gen, const SkImageInfo& i
nfo, |
| 65 const SkIPoint& origin, uint32_t uniqueID) | 65 const SkIPoint& origin, uint32_t uniqueID) |
| 66 : fNotThreadSafeGenerator(gen) | 66 : fNotThreadSafeGenerator(gen) |
| 67 , fInfo(info) | 67 , fInfo(info) |
| 68 , fOrigin(origin) | 68 , fOrigin(origin) |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 } | 332 } |
| 333 | 333 |
| 334 #else | 334 #else |
| 335 | 335 |
| 336 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
s&, | 336 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
s&, |
| 337 const SkImage* client, SkImage::Cach
ingHint) { | 337 const SkImage* client, SkImage::Cach
ingHint) { |
| 338 return nullptr; | 338 return nullptr; |
| 339 } | 339 } |
| 340 | 340 |
| 341 #endif | 341 #endif |
| OLD | NEW |