aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrAtlasTextBlob.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-02-27 16:43:18 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-27 22:05:55 +0000
commitacf17904d6286f2a63a5d895541804d0ea1be646 (patch)
treeefafdb48995fd150c37b1442bf58295d4d66cd89 /src/gpu/text/GrAtlasTextBlob.h
parentc420525bd4cde4cdac471880d080d8c742307788 (diff)
Fission GrAtlasGlyphCache in two
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. Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08 Reviewed-on: https://skia-review.googlesource.com/108001 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/text/GrAtlasTextBlob.h')
-rw-r--r--src/gpu/text/GrAtlasTextBlob.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index 0fae3cd8c7..9f91cae957 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -8,9 +8,9 @@
#ifndef GrAtlasTextBlob_DEFINED
#define GrAtlasTextBlob_DEFINED
-#include "GrAtlasGlyphCache.h"
#include "GrColor.h"
#include "GrDrawOpAtlas.h"
+#include "GrGlyphCache.h"
#include "GrMemoryPool.h"
#include "GrTextUtils.h"
#include "SkDescriptor.h"
@@ -22,8 +22,13 @@
#include "SkSurfaceProps.h"
#include "SkTInternalLList.h"
+class GrAtlasManager;
struct GrDistanceFieldAdjustTable;
+struct GrGlyph;
+class GrGlyphCache;
class GrMemoryPool;
+class GrRestrictedAtlasManager;
+
class SkDrawFilter;
class SkTextBlob;
class SkTextBlobRunIterator;
@@ -201,7 +206,7 @@ public:
bool mustRegenerate(const GrTextUtils::Paint&, const SkMaskFilterBase::BlurRec& blurRec,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
- void flush(GrAtlasGlyphCache*, GrTextUtils::Target*, const SkSurfaceProps& props,
+ void flush(GrRestrictedAtlasManager*, GrTextUtils::Target*, const SkSurfaceProps& props,
const GrDistanceFieldAdjustTable* distanceAdjustTable,
const GrTextUtils::Paint& paint, const GrClip& clip,
const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x,
@@ -276,8 +281,8 @@ public:
std::unique_ptr<GrDrawOp> test_makeOp(int glyphCount, uint16_t run, uint16_t subRun,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
const GrTextUtils::Paint&, const SkSurfaceProps&,
- const GrDistanceFieldAdjustTable*, GrAtlasGlyphCache*,
- GrTextUtils::Target*);
+ const GrDistanceFieldAdjustTable*,
+ GrRestrictedAtlasManager*, GrTextUtils::Target*);
private:
GrAtlasTextBlob()
@@ -506,9 +511,8 @@ private:
inline std::unique_ptr<GrAtlasTextOp> makeOp(
const Run::SubRunInfo& info, int glyphCount, uint16_t run, uint16_t subRun,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y, const SkIRect& clipRect,
- const GrTextUtils::Paint& paint, const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable, GrAtlasGlyphCache* cache,
- GrTextUtils::Target*);
+ const GrTextUtils::Paint&, const SkSurfaceProps&,
+ const GrDistanceFieldAdjustTable*, GrRestrictedAtlasManager* , GrTextUtils::Target*);
struct StrokeInfo {
SkScalar fFrameWidth;
@@ -562,7 +566,8 @@ public:
*/
VertexRegenerator(GrResourceProvider*, GrAtlasTextBlob*, int runIdx, int subRunIdx,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y, GrColor color,
- GrDeferredUploadTarget*, GrAtlasGlyphCache*, SkAutoGlyphCache*);
+ GrDeferredUploadTarget*, GrGlyphCache*, GrAtlasManager*,
+ SkAutoGlyphCache*);
struct Result {
/**
@@ -593,7 +598,8 @@ private:
const SkMatrix& fViewMatrix;
GrAtlasTextBlob* fBlob;
GrDeferredUploadTarget* fUploadTarget;
- GrAtlasGlyphCache* fGlyphCache;
+ GrGlyphCache* fGlyphCache;
+ GrAtlasManager* fFullAtlasManager;
SkAutoGlyphCache* fLazyCache;
Run* fRun;
Run::SubRunInfo* fSubRun;