diff options
author | 2018-03-01 14:16:41 -0500 | |
---|---|---|
committer | 2018-03-01 19:41:04 +0000 | |
commit | 1056eb821f1f43b034962aa6defb80aeeb75d22d (patch) | |
tree | 0e05142557cce356f743a538f8d19c49e6aacc17 /include | |
parent | 4f16db62e5a794080228bd096f29dd9df8311f6c (diff) |
Move atlas manager creation to GrContext derived classes (take 2)
TBR=bsalomon@google.com
Change-Id: Ie10b7e770e24104d10c36ce7882126dd8551a8ba
Reviewed-on: https://skia-review.googlesource.com/110822
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrContext.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index ff4ec5f677..1b43d99f2e 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -36,6 +36,7 @@ class GrRenderTargetContext; class GrResourceEntry; class GrResourceCache; class GrResourceProvider; +class GrRestrictedAtlasManager; class GrSamplerState; class GrSurfaceProxy; class GrSwizzle; @@ -127,7 +128,7 @@ public: * The typical use case for this function is that the underlying 3D context was lost and further * API calls may crash. */ - void abandonContext(); + virtual void abandonContext(); /** * This is similar to abandonContext() however the underlying 3D context is not yet lost and @@ -138,7 +139,7 @@ public: * but can't guarantee that GrContext will be destroyed first (perhaps because it may be ref'ed * elsewhere by either the client or Skia objects). */ - void releaseResourcesAndAbandonContext(); + virtual void releaseResourcesAndAbandonContext(); /////////////////////////////////////////////////////////////////////////// // Resource Cache @@ -183,7 +184,7 @@ public: * Frees GPU created by the context. Can be called to reduce GPU memory * pressure. */ - void freeGpuResources(); + virtual void freeGpuResources(); /** * Purge all the unlocked resources from the cache. @@ -358,9 +359,15 @@ protected: GrContext(GrContextThreadSafeProxy*); GrContext(GrBackend); + virtual bool init(const GrContextOptions&); // init must be called after either constructor. + + virtual GrAtlasManager* onGetFullAtlasManager() = 0; + virtual GrRestrictedAtlasManager* onGetRestrictedAtlasManager() = 0; + + sk_sp<const GrCaps> fCaps; + private: sk_sp<GrGpu> fGpu; - sk_sp<const GrCaps> fCaps; GrResourceCache* fResourceCache; GrResourceProvider* fResourceProvider; GrProxyProvider* fProxyProvider; @@ -368,7 +375,6 @@ private: sk_sp<GrContextThreadSafeProxy> fThreadSafeProxy; GrGlyphCache* fGlyphCache; - GrAtlasManager* fFullAtlasManager; std::unique_ptr<GrTextBlobCache> fTextBlobCache; bool fDisableGpuYUVConversion; @@ -404,8 +410,6 @@ private: // TODO: have the GrClipStackClip use renderTargetContexts and rm this friending friend class GrContextPriv; - bool init(const GrContextOptions&); // init must be called after either constructor. - /** * These functions create premul <-> unpremul effects. If the second argument is 'true', they * use the specialized round-trip effects from GrConfigConversionEffect, otherwise they |