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