aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContextPriv.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-01 11:36:45 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-01 19:09:14 +0000
commitc4039ea466d39ede0ea44fc7a18f1174f893f11d (patch)
tree76666cf5550f484c879b375135c00e72dd9c4336 /src/gpu/GrContextPriv.h
parent2d0e1248d6eef36ecc510785e9bf8a28530c56fe (diff)
Fission GrAtlasGlyphCache in two (take 2)
Reland all the things This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager. The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager) and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation time and provides access to the proxies backing the atlases. The full GrAtlasManager is only available at flush time and allows instantiation of the proxies and uploading to them. In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the GrAtlasManager in the main thread. This future atlas manager will have had all of its GrDrawOpAtlases created (but not instantiated) so there should be no race conditions. TBR=jvanverth@google.com Change-Id: I05c6cd8d301bf2decca39765e5cae62993d9da04 Reviewed-on: https://skia-review.googlesource.com/111362 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrContextPriv.h')
-rw-r--r--src/gpu/GrContextPriv.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index a2a45b5007..c2e525d9b9 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -10,6 +10,7 @@
#include "GrContext.h"
#include "GrSurfaceContext.h"
+#include "text/GrAtlasManager.h"
class GrBackendRenderTarget;
class GrOnFlushCallbackObject;
@@ -187,8 +188,19 @@ public:
GrGpu* getGpu() { return fContext->fGpu.get(); }
const GrGpu* getGpu() const { return fContext->fGpu.get(); }
- GrAtlasGlyphCache* getAtlasGlyphCache() { return fContext->fAtlasGlyphCache; }
+ GrGlyphCache* getGlyphCache() { return fContext->fGlyphCache; }
GrTextBlobCache* getTextBlobCache() { return fContext->fTextBlobCache.get(); }
+ GrRestrictedAtlasManager* getRestrictedAtlasManager() { return fContext->fFullAtlasManager; }
+
+ // This accessor should only ever be called by the GrOpFlushState.
+ GrAtlasManager* getFullAtlasManager() {
+ if (fContext->fResourceProvider) {
+ // Disallow access to the full atlasManager when recording DDLs
+ return fContext->fFullAtlasManager;
+ }
+
+ return nullptr;
+ }
void moveOpListsToDDL(SkDeferredDisplayList*);
void copyOpListsFromDDL(const SkDeferredDisplayList*, GrRenderTargetProxy* newDest);