Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: include/private/GrTextureProxy.h

Issue 1944953002: Revert of Add Gr*Proxy classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/private/GrSurfaceProxy.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrTextureProxy_DEFINED
9 #define GrTextureProxy_DEFINED
10
11 #include "GrSurfaceProxy.h"
12 #include "GrTexture.h"
13
14 class GrTextureProvider;
15
16 // This class delays the acquisition of textures until they are actually require d
17 class GrTextureProxy : public GrSurfaceProxy {
18 public:
19 // TODO: need to refine ownership semantics of 'srcData' if we're in complet ely
20 // deferred mode
21 static sk_sp<GrTextureProxy> Make(const GrSurfaceDesc&, SkBackingFit, SkBudg eted,
22 const void* srcData = nullptr, size_t rowB ytes = 0);
23 static sk_sp<GrTextureProxy> Make(sk_sp<GrTexture>);
24
25 // TODO: add asRenderTargetProxy variants
26 GrTextureProxy* asTextureProxy() override { return this; }
27 const GrTextureProxy* asTextureProxy() const override { return this; }
28
29 // Actually instantiate the backing texture, if necessary
30 GrTexture* instantiate(GrTextureProvider* texProvider);
31
32 private:
33 GrTextureProxy(const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budge ted,
34 const void* /*srcData*/, size_t /*rowBytes*/)
35 : INHERITED(desc, fit, budgeted) {
36 // TODO: Handle 'srcData' here
37 }
38
39 // Wrapped version
40 GrTextureProxy(sk_sp<GrTexture> tex);
41
42 // For wrapped textures we store it here.
43 // For deferred proxies we will fill this in when we need to instantiate the deferred resource
44 sk_sp<GrTexture> fTexture;
45
46 typedef GrSurfaceProxy INHERITED;
47 };
48
49 #endif
OLDNEW
« no previous file with comments | « include/private/GrSurfaceProxy.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698