aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceProvider.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-02-07 17:08:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-08 12:36:29 +0000
commit4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 (patch)
tree21b7089d6745f769be88f8f3d9a127d521ff48be /src/gpu/GrResourceProvider.h
parent1f1bb9c0b8d5f50ac74716e6961a6c92f1d373d8 (diff)
Move control of explicit GPU resource allocation to GrContextOptions
Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af Reviewed-on: https://skia-review.googlesource.com/104880 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrResourceProvider.h')
-rw-r--r--src/gpu/GrResourceProvider.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 385282d6f6..7b5fb60ea1 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -39,7 +39,7 @@ class SkTypeface;
*/
class GrResourceProvider {
public:
- GrResourceProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* owner);
+ GrResourceProvider(GrGpu*, GrResourceCache*, GrSingleOwner*, bool explicitlyAllocate);
/**
* Finds a resource in the cache, based on the specified key. Prior to calling this, the caller
@@ -258,6 +258,10 @@ public:
inline GrResourceProviderPriv priv();
inline const GrResourceProviderPriv priv() const;
+ bool explicitlyAllocateGPUResources() const { return fExplicitlyAllocateGPUResources; }
+
+ bool testingOnly_setExplicitlyAllocateGPUResources(bool newValue);
+
private:
sk_sp<GrGpuResource> findResourceByUniqueKey(const GrUniqueKey&);
@@ -297,6 +301,7 @@ private:
GrGpu* fGpu;
sk_sp<const GrCaps> fCaps;
GrUniqueKey fQuadIndexBufferKey;
+ bool fExplicitlyAllocateGPUResources;
// In debug builds we guard against improper thread handling
SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;)