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 18 matching lines...) Expand all Loading... |
29 GrTexture* tex = this->getTexture(); | 29 GrTexture* tex = this->getTexture(); |
30 SkASSERT(tex); | 30 SkASSERT(tex); |
31 if (fBudgeted) { | 31 if (fBudgeted) { |
32 tex->resourcePriv().makeBudgeted(); | 32 tex->resourcePriv().makeBudgeted(); |
33 } else { | 33 } else { |
34 tex->resourcePriv().makeUnbudgeted(); | 34 tex->resourcePriv().makeUnbudgeted(); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 bool getROPixels(SkBitmap*) const override; | 38 bool getROPixels(SkBitmap*) const override; |
39 GrTexture* asTextureRef(GrContext* ctx, SkImageUsageType usage) const overri
de; | 39 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params) const
override; |
40 SkImage* onNewSubset(const SkIRect&) const override; | 40 SkImage* onNewSubset(const SkIRect&) const override; |
41 | 41 |
42 GrTexture* peekTexture() const override { return fTexture; } | 42 GrTexture* peekTexture() const override { return fTexture; } |
43 bool isOpaque() const override; | 43 bool isOpaque() const override; |
44 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, | 44 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, |
45 int srcX, int srcY) const override; | 45 int srcX, int srcY) const override; |
46 | 46 |
47 private: | 47 private: |
48 SkAutoTUnref<GrTexture> fTexture; | 48 SkAutoTUnref<GrTexture> fTexture; |
49 const SkAlphaType fAlphaType; | 49 const SkAlphaType fAlphaType; |
50 const SkSurface::Budgeted fBudgeted; | 50 const SkSurface::Budgeted fBudgeted; |
51 mutable SkAtomic<bool> fAddedRasterVersionToCache; | 51 mutable SkAtomic<bool> fAddedRasterVersionToCache; |
52 | 52 |
53 | 53 |
54 typedef SkImage_Base INHERITED; | 54 typedef SkImage_Base INHERITED; |
55 }; | 55 }; |
56 | 56 |
57 #endif | 57 #endif |
OLD | NEW |