| 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 #ifndef SkImageCacherator_DEFINED | 8 #ifndef SkImageCacherator_DEFINED |
| 9 #define SkImageCacherator_DEFINED | 9 #define SkImageCacherator_DEFINED |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 * added to the cache on its behalf. | 47 * added to the cache on its behalf. |
| 48 * | 48 * |
| 49 * The caller is responsible for calling texture->unref() when they are don
e. | 49 * The caller is responsible for calling texture->unref() when they are don
e. |
| 50 */ | 50 */ |
| 51 GrTexture* lockAsTexture(GrContext*, const GrTextureParams&, const SkImage*
client, | 51 GrTexture* lockAsTexture(GrContext*, const GrTextureParams&, const SkImage*
client, |
| 52 SkImage::CachingHint = SkImage::kAllow_CachingHint)
; | 52 SkImage::CachingHint = SkImage::kAllow_CachingHint)
; |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * If the underlying src naturally is represented by an encoded blob (in Sk
Data), this returns | 55 * If the underlying src naturally is represented by an encoded blob (in Sk
Data), this returns |
| 56 * a ref to that data. If not, it returns null. | 56 * a ref to that data. If not, it returns null. |
| 57 * |
| 58 * If a GrContext is specified, then the caller is only interested in gpu-s
pecific encoded |
| 59 * formats, so others (e.g. PNG) can just return nullptr. |
| 57 */ | 60 */ |
| 58 SkData* refEncoded(); | 61 SkData* refEncoded(GrContext*); |
| 59 | 62 |
| 60 // Only return true if the generate has already been cached. | 63 // Only return true if the generate has already been cached. |
| 61 bool lockAsBitmapOnlyIfAlreadyCached(SkBitmap*); | 64 bool lockAsBitmapOnlyIfAlreadyCached(SkBitmap*); |
| 62 // Call the underlying generator directly | 65 // Call the underlying generator directly |
| 63 bool directGeneratePixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRB, | 66 bool directGeneratePixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRB, |
| 64 int srcX, int srcY); | 67 int srcX, int srcY); |
| 65 | 68 |
| 66 private: | 69 private: |
| 67 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui
nt32_t uniqueID); | 70 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui
nt32_t uniqueID); |
| 68 | 71 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 92 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator; | 95 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator; |
| 93 | 96 |
| 94 const SkImageInfo fInfo; | 97 const SkImageInfo fInfo; |
| 95 const SkIPoint fOrigin; | 98 const SkIPoint fOrigin; |
| 96 const uint32_t fUniqueID; | 99 const uint32_t fUniqueID; |
| 97 | 100 |
| 98 friend class GrImageTextureMaker; | 101 friend class GrImageTextureMaker; |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 #endif | 104 #endif |
| OLD | NEW |