aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-18 14:49:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-19 11:43:54 +0000
commit5af44defbd5fc7ef0053ec4b61f0859170f2fb15 (patch)
treee25f9e3ff1bdd6a8ff57b717a8d6167cf07d080a /include
parent11f898f1548605a188fe3488b22ddc5f7620895d (diff)
Add GrResourceAllocator class + unit test
Change-Id: I2700e8cb4213479b680519ba67f078cc3fb71376 Reviewed-on: https://skia-review.googlesource.com/23661 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/private/GrRenderTargetProxy.h4
-rw-r--r--include/private/GrSurfaceProxy.h8
-rw-r--r--include/private/GrTextureProxy.h2
3 files changed, 13 insertions, 1 deletions
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index d7c4e06b80..61c3ecb8d7 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -23,7 +23,7 @@ public:
const GrRenderTargetProxy* asRenderTargetProxy() const override { return this; }
// Actually instantiate the backing rendertarget, if necessary.
- bool instantiate(GrResourceProvider* resourceProvider) override;
+ bool instantiate(GrResourceProvider*) override;
GrFSAAType fsaaType() const {
if (!fSampleCnt) {
@@ -68,6 +68,8 @@ protected:
// Wrapped version
GrRenderTargetProxy(sk_sp<GrSurface>);
+ sk_sp<GrSurface> createSurface(GrResourceProvider*) const override;
+
private:
size_t onUninstantiatedGpuMemorySize() const override;
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 7aa944793a..f899f75abf 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -329,6 +329,7 @@ public:
bool isWrapped_ForTesting() const;
+ SkDEBUGCODE(bool isInstantiated() const { return SkToBool(fTarget); })
SkDEBUGCODE(void validate(GrContext*) const;)
// Provides access to functions that aren't part of the public API.
@@ -367,6 +368,13 @@ protected:
return this->internalHasPendingWrite();
}
+ virtual sk_sp<GrSurface> createSurface(GrResourceProvider*) const = 0;
+ void assign(sk_sp<GrSurface> surface);
+
+ sk_sp<GrSurface> createSurfaceImpl(GrResourceProvider*, int sampleCnt,
+ GrSurfaceFlags flags, bool isMipMapped,
+ SkDestinationSurfaceColorMode mipColorMode) const;
+
bool instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt,
GrSurfaceFlags flags, bool isMipMapped,
SkDestinationSurfaceColorMode mipColorMode);
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h
index 2736e61c12..60be19ecef 100644
--- a/include/private/GrTextureProxy.h
+++ b/include/private/GrTextureProxy.h
@@ -49,6 +49,8 @@ protected:
SkDestinationSurfaceColorMode mipColorMode() const { return fMipColorMode; }
+ sk_sp<GrSurface> createSurface(GrResourceProvider*) const override;
+
private:
bool fIsMipMapped;
SkDestinationSurfaceColorMode fMipColorMode;