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 25 matching lines...) Expand all Loading... |
36 fTexture->resourcePriv().makeUnbudgeted(); | 36 fTexture->resourcePriv().makeUnbudgeted(); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 bool getROPixels(SkBitmap*, CachingHint) const override; | 40 bool getROPixels(SkBitmap*, CachingHint) const override; |
41 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params, | 41 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params, |
42 SkSourceGammaTreatment) const override; | 42 SkSourceGammaTreatment) const override; |
43 sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; | 43 sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; |
44 | 44 |
45 GrTexture* peekTexture() const override { return fTexture; } | 45 GrTexture* peekTexture() const override { return fTexture; } |
| 46 sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const override { |
| 47 *uniqueID = this->uniqueID(); |
| 48 return sk_ref_sp(fTexture.get()); |
| 49 } |
46 bool isOpaque() const override; | 50 bool isOpaque() const override; |
47 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, | 51 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, |
48 int srcX, int srcY, CachingHint) const override; | 52 int srcX, int srcY, CachingHint) const override; |
49 | 53 |
50 sk_sp<SkSurface> onNewSurface(const SkImageInfo& info) const override { | 54 sk_sp<SkSurface> onNewSurface(const SkImageInfo& info) const override { |
51 return SkSurface::MakeRenderTarget(fTexture->getContext(), SkBudgeted::k
No, info); | 55 return SkSurface::MakeRenderTarget(fTexture->getContext(), SkBudgeted::k
No, info); |
52 } | 56 } |
53 | 57 |
54 private: | 58 private: |
55 SkAutoTUnref<GrTexture> fTexture; | 59 SkAutoTUnref<GrTexture> fTexture; |
56 const SkAlphaType fAlphaType; | 60 const SkAlphaType fAlphaType; |
57 const SkBudgeted fBudgeted; | 61 const SkBudgeted fBudgeted; |
58 sk_sp<SkColorSpace> fColorSpace; | 62 sk_sp<SkColorSpace> fColorSpace; |
59 mutable SkAtomic<bool> fAddedRasterVersionToCache; | 63 mutable SkAtomic<bool> fAddedRasterVersionToCache; |
60 | 64 |
61 | 65 |
62 typedef SkImage_Base INHERITED; | 66 typedef SkImage_Base INHERITED; |
63 }; | 67 }; |
64 | 68 |
65 #endif | 69 #endif |
OLD | NEW |