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 SkImage_Gpu_DEFINED | 8 #ifndef SkImage_Gpu_DEFINED |
| 9 #define SkImage_Gpu_DEFINED | 9 #define SkImage_Gpu_DEFINED |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 SkDestinationSurfaceColorMode) const override; | 43 SkDestinationSurfaceColorMode) const override; |
| 44 sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; | 44 sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; |
| 45 | 45 |
| 46 GrTexture* peekTexture() const override { return fTexture.get(); } | 46 GrTexture* peekTexture() const override { return fTexture.get(); } |
| 47 sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const override { | 47 sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const override { |
| 48 *uniqueID = this->uniqueID(); | 48 *uniqueID = this->uniqueID(); |
| 49 return fTexture; | 49 return fTexture; |
| 50 } | 50 } |
| 51 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, | 51 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, |
| 52 int srcX, int srcY, CachingHint) const override; | 52 int srcX, int srcY, CachingHint) const override; |
| 53 #if SK_SUPPORT_GPU | |
| 54 bool canGenerateTexture(const GrContextThreadSafeProxy& proxy) const overrid e | |
| 55 { | |
| 56 if (fTexture) { | |
| 57 return fTexture->getContext()->uniqueID() == proxy.uniqueID(); | |
| 58 } | |
| 59 return false; | |
| 60 } | |
| 61 #endif | |
|
cblume
2016/11/16 01:07:16
This might be a tad large for being in the .h -- s
| |
| 53 | 62 |
| 54 private: | 63 private: |
| 55 sk_sp<GrTexture> fTexture; | 64 sk_sp<GrTexture> fTexture; |
| 56 const SkAlphaType fAlphaType; | 65 const SkAlphaType fAlphaType; |
| 57 const SkBudgeted fBudgeted; | 66 const SkBudgeted fBudgeted; |
| 58 sk_sp<SkColorSpace> fColorSpace; | 67 sk_sp<SkColorSpace> fColorSpace; |
| 59 mutable SkAtomic<bool> fAddedRasterVersionToCache; | 68 mutable SkAtomic<bool> fAddedRasterVersionToCache; |
| 60 | 69 |
| 61 | 70 |
| 62 typedef SkImage_Base INHERITED; | 71 typedef SkImage_Base INHERITED; |
| 63 }; | 72 }; |
| 64 | 73 |
| 65 #endif | 74 #endif |
| OLD | NEW |