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