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 19 matching lines...) Expand all Loading... |
30 GrTexture* tex = this->getTexture(); | 30 GrTexture* tex = this->getTexture(); |
31 SkASSERT(tex); | 31 SkASSERT(tex); |
32 if (fBudgeted) { | 32 if (fBudgeted) { |
33 tex->resourcePriv().makeBudgeted(); | 33 tex->resourcePriv().makeBudgeted(); |
34 } else { | 34 } else { |
35 tex->resourcePriv().makeUnbudgeted(); | 35 tex->resourcePriv().makeUnbudgeted(); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 bool getROPixels(SkBitmap*) const override; | 39 bool getROPixels(SkBitmap*) const override; |
40 GrTexture* getTexture() const override { return fTexture; } | 40 GrTexture* asTextureRef(GrContext* ctx, SkImageUsageType usage) const overri
de; |
| 41 |
| 42 GrTexture* peekTexture() const override { return fTexture; } |
41 SkShader* onNewShader(SkShader::TileMode, | 43 SkShader* onNewShader(SkShader::TileMode, |
42 SkShader::TileMode, | 44 SkShader::TileMode, |
43 const SkMatrix* localMatrix) const override; | 45 const SkMatrix* localMatrix) const override; |
44 bool isOpaque() const override; | 46 bool isOpaque() const override; |
45 SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) const ove
rride; | 47 SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) const ove
rride; |
46 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, | 48 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, |
47 int srcX, int srcY) const override; | 49 int srcX, int srcY) const override; |
48 | 50 |
49 private: | 51 private: |
50 SkAutoTUnref<GrTexture> fTexture; | 52 SkAutoTUnref<GrTexture> fTexture; |
51 const int fSampleCountForNewSurfaces; // 0 if we don't k
now | 53 const int fSampleCountForNewSurfaces; // 0 if we don't k
now |
52 const SkAlphaType fAlphaType; | 54 const SkAlphaType fAlphaType; |
53 const SkSurface::Budgeted fBudgeted; | 55 const SkSurface::Budgeted fBudgeted; |
54 mutable SkAtomic<bool> fAddedRasterVersionToCache; | 56 mutable SkAtomic<bool> fAddedRasterVersionToCache; |
55 | 57 |
56 | 58 |
57 typedef SkImage_Base INHERITED; | 59 typedef SkImage_Base INHERITED; |
58 }; | 60 }; |
59 | 61 |
60 #endif | 62 #endif |
OLD | NEW |