aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/GrSurfaceProxy.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-17 11:40:14 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-17 17:04:26 +0000
commit777707be8445b7d2f9cb235cd040cd1994dd2996 (patch)
tree3b7ee9039c39b1c77e75e6a880210f5a856a146b /include/private/GrSurfaceProxy.h
parent95379ebc0dfa6fe5af14dbebe251aec43c5ce919 (diff)
Move GrSurfaceProxy::MakeLazy to GrProxyProvider::createLazy
This is pretty much a straight up move of the GrSurfaceProxy code with some plumbing to get the ProxyProvider in the right places. Change-Id: I63cecb242dada503f97dbd1c0ce7ede75323100d Reviewed-on: https://skia-review.googlesource.com/94200 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/private/GrSurfaceProxy.h')
-rw-r--r--include/private/GrSurfaceProxy.h28
1 files changed, 3 insertions, 25 deletions
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index cc12fcb010..55b30a5d5b 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -185,31 +185,6 @@ public:
// DDL TODO: remove this entry point
static sk_sp<GrTextureProxy> MakeWrapped(sk_sp<GrTexture>, GrSurfaceOrigin);
- using LazyInstantiateCallback = std::function<sk_sp<GrTexture>(GrResourceProvider*,
- GrSurfaceOrigin* outOrigin)>;
-
- enum class Renderable : bool {
- kNo = false,
- kYes = true
- };
-
- /**
- * Creates a texture proxy that will be instantiated by a user-supplied callback during flush.
- * (Stencil is not supported by this method.) The width and height must either both be greater
- * than 0 or both less than or equal to zero. A non-positive value is a signal that the width
- * and height are currently unknown.
- *
- * When called, the callback must be able to cleanup any resources that it captured at creation.
- * It also must support being passed in a null GrResourceProvider. When this happens, the
- * callback should cleanup any resources it captured and return an empty sk_sp<GrTextureProxy>.
- * DDL TODO: remove this entry point
- */
- static sk_sp<GrTextureProxy> MakeLazy(LazyInstantiateCallback&&, const GrSurfaceDesc& desc,
- GrMipMapped, SkBackingFit fit, SkBudgeted budgeted);
-
- static sk_sp<GrTextureProxy> MakeFullyLazy(LazyInstantiateCallback&&, Renderable,
- GrPixelConfig);
-
enum class LazyState {
kNot, // The proxy has no lazy callback that must be made.
kPartially, // The proxy has a lazy callback but knows basic information about itself.
@@ -383,6 +358,9 @@ protected:
// Note: this ctor pulls a new uniqueID from the same pool at the GrGpuResources
}
+ using LazyInstantiateCallback = std::function<sk_sp<GrTexture>(GrResourceProvider*,
+ GrSurfaceOrigin* outOrigin)>;
+
// Lazy-callback version
GrSurfaceProxy(LazyInstantiateCallback&& callback, const GrSurfaceDesc& desc,
SkBackingFit fit, SkBudgeted budgeted, uint32_t flags);