| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 GrTextureProxy_DEFINED | 8 #ifndef GrTextureProxy_DEFINED |
| 9 #define GrTextureProxy_DEFINED | 9 #define GrTextureProxy_DEFINED |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 SkBackingFit, SkBudgeted, | 23 SkBackingFit, SkBudgeted, |
| 24 const void* srcData = nullptr, size_t rowB
ytes = 0); | 24 const void* srcData = nullptr, size_t rowB
ytes = 0); |
| 25 static sk_sp<GrTextureProxy> Make(sk_sp<GrTexture>); | 25 static sk_sp<GrTextureProxy> Make(sk_sp<GrTexture>); |
| 26 | 26 |
| 27 GrTextureProxy* asTextureProxy() override { return this; } | 27 GrTextureProxy* asTextureProxy() override { return this; } |
| 28 const GrTextureProxy* asTextureProxy() const override { return this; } | 28 const GrTextureProxy* asTextureProxy() const override { return this; } |
| 29 | 29 |
| 30 // Actually instantiate the backing texture, if necessary | 30 // Actually instantiate the backing texture, if necessary |
| 31 GrTexture* instantiate(GrTextureProvider*); | 31 GrTexture* instantiate(GrTextureProvider*); |
| 32 | 32 |
| 33 // dispreferred entry point |
| 34 GrContext* getContext() { return nullptr; } // fTexture->getContext(); } |
| 35 |
| 36 bool readPixels(int left, int top, int width, int height, |
| 37 GrPixelConfig config, |
| 38 void* buffer, |
| 39 size_t rowBytes = 0, |
| 40 uint32_t pixelOpsFlags = 0); |
| 41 |
| 42 bool writePixels(int left, int top, int width, int height, |
| 43 GrPixelConfig config, |
| 44 const void* buffer, |
| 45 size_t rowBytes = 0, |
| 46 uint32_t pixelOpsFlags = 0); |
| 47 |
| 33 protected: | 48 protected: |
| 34 // Deferred version | 49 // Deferred version |
| 35 GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit, SkBudgeted, | 50 GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit, SkBudgeted, |
| 36 const void* srcData, size_t srcRowBytes); | 51 const void* srcData, size_t srcRowBytes); |
| 37 // Wrapped version | 52 // Wrapped version |
| 38 GrTextureProxy(sk_sp<GrTexture> tex); | 53 GrTextureProxy(sk_sp<GrTexture> tex); |
| 39 | 54 |
| 40 private: | 55 private: |
| 41 size_t onGpuMemorySize() const override; | 56 size_t onGpuMemorySize() const override; |
| 42 | 57 |
| 43 // For wrapped proxies the GrTexture pointer is stored in GrIORefProxy. | 58 // For wrapped proxies the GrTexture pointer is stored in GrIORefProxy. |
| 44 // For deferred proxies that pointer will be filled n when we need to instan
tiate | 59 // For deferred proxies that pointer will be filled n when we need to instan
tiate |
| 45 // the deferred resource | 60 // the deferred resource |
| 46 | 61 |
| 47 typedef GrSurfaceProxy INHERITED; | 62 typedef GrSurfaceProxy INHERITED; |
| 48 }; | 63 }; |
| 49 | 64 |
| 50 #endif | 65 #endif |
| OLD | NEW |