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