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 static sk_sp<GrTextureProxy> Make(sk_sp<GrTexture>); | 23 static sk_sp<GrTextureProxy> Make(sk_sp<GrTexture>); |
24 | 24 |
25 // TODO: add asRenderTargetProxy variants | 25 // TODO: add asRenderTargetProxy variants |
26 GrTextureProxy* asTextureProxy() override { return this; } | 26 GrTextureProxy* asTextureProxy() override { return this; } |
27 const GrTextureProxy* asTextureProxy() const override { return this; } | 27 const GrTextureProxy* asTextureProxy() const override { return this; } |
28 | 28 |
29 // Actually instantiate the backing texture, if necessary | 29 // Actually instantiate the backing texture, if necessary |
30 GrTexture* instantiate(GrTextureProvider* texProvider); | 30 GrTexture* instantiate(GrTextureProvider* texProvider); |
31 | 31 |
32 private: | 32 private: |
33 GrTextureProxy(const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budge
ted, | 33 // Deferred version |
34 const void* /*srcData*/, size_t /*rowBytes*/) | 34 GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit, SkBudgeted, |
35 : INHERITED(desc, fit, budgeted) { | 35 const void* srcData, size_t srcRowBytes); |
36 // TODO: Handle 'srcData' here | |
37 } | |
38 | |
39 // Wrapped version | 36 // Wrapped version |
40 GrTextureProxy(sk_sp<GrTexture> tex); | 37 GrTextureProxy(sk_sp<GrTexture> tex); |
41 | 38 |
42 // For wrapped textures we store it here. | 39 // For wrapped textures we store it here. |
43 // For deferred proxies we will fill this in when we need to instantiate the
deferred resource | 40 // For deferred proxies we will fill this in when we need to instantiate the
deferred resource |
44 sk_sp<GrTexture> fTexture; | 41 sk_sp<GrTexture> fTexture; |
45 | 42 |
46 typedef GrSurfaceProxy INHERITED; | 43 typedef GrSurfaceProxy INHERITED; |
47 }; | 44 }; |
48 | 45 |
49 #endif | 46 #endif |
OLD | NEW |