From f35fd8d2f26ef7217368d1a09d231ee68ed0cb2f Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 22 Jan 2018 10:48:15 -0500 Subject: Move more internal methods from GrContext to GrContextPriv (take 3) Change-Id: Ied630e61cf95780bf85032867e6ce663e1ef9c2f Reviewed-on: https://skia-review.googlesource.com/98000 Reviewed-by: Greg Daniel Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/atlastext/SkAtlasTextTarget.cpp | 2 +- src/atlastext/SkInternalAtlasTextContext.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/atlastext') diff --git a/src/atlastext/SkAtlasTextTarget.cpp b/src/atlastext/SkAtlasTextTarget.cpp index 0a318e0c8e..d80c7a45d7 100644 --- a/src/atlastext/SkAtlasTextTarget.cpp +++ b/src/atlastext/SkAtlasTextTarget.cpp @@ -183,7 +183,7 @@ void GrAtlasTextOp::executeForTextTarget(SkAtlasTextTarget* target) { FlushInfo flushInfo; SkAutoGlyphCache glyphCache; auto& context = target->context()->internal(); - auto* atlasGlyphCache = context.grContext()->getAtlasGlyphCache(); + auto* atlasGlyphCache = context.grContext()->contextPriv().getAtlasGlyphCache(); for (int i = 0; i < fGeoCount; ++i) { GrAtlasTextBlob::VertexRegenerator regenerator( fGeoData[i].fBlob, fGeoData[i].fRun, fGeoData[i].fSubRun, fGeoData[i].fViewMatrix, diff --git a/src/atlastext/SkInternalAtlasTextContext.cpp b/src/atlastext/SkInternalAtlasTextContext.cpp index fba0cbcdbe..58b8788943 100644 --- a/src/atlastext/SkInternalAtlasTextContext.cpp +++ b/src/atlastext/SkInternalAtlasTextContext.cpp @@ -7,6 +7,7 @@ #include "SkInternalAtlasTextContext.h" #include "GrContext.h" +#include "GrContextPriv.h" #include "SkAtlasTextContext.h" #include "SkAtlasTextRenderer.h" #include "text/GrAtlasGlyphCache.h" @@ -36,17 +37,20 @@ SkInternalAtlasTextContext::SkInternalAtlasTextContext(sk_spgetAtlasGlyphCache()->getAtlasPageCount(kA8_GrMaskFormat)); +#ifdef SK_DEBUG + auto atlasGlyphCache = fGrContext->contextPriv().getAtlasGlyphCache(); + SkASSERT(1 == atlasGlyphCache->getAtlasPageCount(kA8_GrMaskFormat)); +#endif fRenderer->deleteTexture(fDistanceFieldAtlas.fTextureHandle); } } GrAtlasGlyphCache* SkInternalAtlasTextContext::atlasGlyphCache() { - return fGrContext->getAtlasGlyphCache(); + return fGrContext->contextPriv().getAtlasGlyphCache(); } GrTextBlobCache* SkInternalAtlasTextContext::textBlobCache() { - return fGrContext->getTextBlobCache(); + return fGrContext->contextPriv().getTextBlobCache(); } GrDeferredUploadToken SkInternalAtlasTextContext::addInlineUpload( @@ -80,7 +84,7 @@ void SkInternalAtlasTextContext::recordDraw(const void* srcVertexData, int glyph } void SkInternalAtlasTextContext::flush() { - auto* atlasGlyphCache = fGrContext->getAtlasGlyphCache(); + auto* atlasGlyphCache = fGrContext->contextPriv().getAtlasGlyphCache(); if (!fDistanceFieldAtlas.fProxy) { SkASSERT(1 == atlasGlyphCache->getAtlasPageCount(kA8_GrMaskFormat)); fDistanceFieldAtlas.fProxy = atlasGlyphCache->getProxies(kA8_GrMaskFormat)->get(); -- cgit v1.2.3