Chromium Code Reviews| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 */ | 57 */ |
| 58 SkData* refEncoded(); | 58 SkData* refEncoded(); |
| 59 | 59 |
| 60 // Only return true if the generate has already been cached. | |
| 61 bool lockAsBitmapOnlyIfAlreadyCached(SkBitmap*); | |
| 62 // Call the underlying generator directly | |
| 63 bool directGeneratePixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRB, | |
|
f(malita)
2015/11/24 19:36:07
I guess this matches existing internal APIs, but w
reed1
2015/11/24 19:43:49
Yep. Would probably start with SkImageGenerator, a
| |
| 64 int srcX, int srcY); | |
| 65 | |
| 60 private: | 66 private: |
| 61 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui nt32_t uniqueID); | 67 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui nt32_t uniqueID); |
| 62 | 68 |
| 63 bool generateBitmap(SkBitmap*); | 69 bool generateBitmap(SkBitmap*); |
| 64 bool tryLockAsBitmap(SkBitmap*, const SkImage*, SkImage::CachingHint); | 70 bool tryLockAsBitmap(SkBitmap*, const SkImage*, SkImage::CachingHint); |
| 65 #if SK_SUPPORT_GPU | 71 #if SK_SUPPORT_GPU |
| 66 // Returns the texture. If the cacherator is generating the texture and want s to cache it, | 72 // Returns the texture. If the cacherator is generating the texture and want s to cache it, |
| 67 // it should use the passed in key (if the key is valid). | 73 // it should use the passed in key (if the key is valid). |
| 68 GrTexture* lockTexture(GrContext*, const GrUniqueKey& key, const SkImage* cl ient, | 74 GrTexture* lockTexture(GrContext*, const GrUniqueKey& key, const SkImage* cl ient, |
| 69 SkImage::CachingHint); | 75 SkImage::CachingHint); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 86 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator; | 92 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator; |
| 87 | 93 |
| 88 const SkImageInfo fInfo; | 94 const SkImageInfo fInfo; |
| 89 const SkIPoint fOrigin; | 95 const SkIPoint fOrigin; |
| 90 const uint32_t fUniqueID; | 96 const uint32_t fUniqueID; |
| 91 | 97 |
| 92 friend class Cacherator_GrTextureMaker; | 98 friend class Cacherator_GrTextureMaker; |
| 93 }; | 99 }; |
| 94 | 100 |
| 95 #endif | 101 #endif |
| OLD | NEW |