diff options
author | Robert Phillips <robertphillips@google.com> | 2018-06-12 10:11:12 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-12 14:43:03 +0000 |
commit | 7c525e62d405d57ae7a7742cf607b9770a83a0ab (patch) | |
tree | 8dabe9ed08bddd398b8fac935decaf2743f5a6f7 /src/gpu/text | |
parent | 7deacf4833dcdb6c1101a18a2b46a8c516a96f9a (diff) |
Plumb GrContext everywhere
There is no good way to split the monster CL up. This breaks out
the GrContext plumbing but doesn't use it.
Change-Id: I90856d428d372bcec3f8821e6364667b367927d4
Reviewed-on: https://skia-review.googlesource.com/133382
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrTextBlob.cpp | 4 | ||||
-rw-r--r-- | src/gpu/text/GrTextBlob.h | 2 | ||||
-rw-r--r-- | src/gpu/text/GrTextContext.cpp | 4 | ||||
-rw-r--r-- | src/gpu/text/GrTextContext.h | 12 | ||||
-rw-r--r-- | src/gpu/text/GrTextUtils.h | 2 |
5 files changed, 15 insertions, 9 deletions
diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp index 00995d0239..08491f525e 100644 --- a/src/gpu/text/GrTextBlob.cpp +++ b/src/gpu/text/GrTextBlob.cpp @@ -252,11 +252,11 @@ inline std::unique_ptr<GrAtlasTextOp> GrTextBlob::makeOp( std::unique_ptr<GrAtlasTextOp> op; if (info.drawAsDistanceFields()) { op = GrAtlasTextOp::MakeDistanceField( - std::move(grPaint), glyphCount, distanceAdjustTable, + target->getContext(), std::move(grPaint), glyphCount, distanceAdjustTable, target->colorSpaceInfo().isGammaCorrect(), paint.luminanceColor(), props, info.isAntiAliased(), info.hasUseLCDText()); } else { - op = GrAtlasTextOp::MakeBitmap(std::move(grPaint), format, glyphCount, + op = GrAtlasTextOp::MakeBitmap(target->getContext(), std::move(grPaint), format, glyphCount, info.needsTransform()); } GrAtlasTextOp::Geometry& geometry = op->geometry(); diff --git a/src/gpu/text/GrTextBlob.h b/src/gpu/text/GrTextBlob.h index e34ab88ef2..19128ab98e 100644 --- a/src/gpu/text/GrTextBlob.h +++ b/src/gpu/text/GrTextBlob.h @@ -11,7 +11,6 @@ #include "GrColor.h" #include "GrDrawOpAtlas.h" #include "GrGlyphCache.h" -#include "GrMemoryPool.h" #include "GrTextUtils.h" #include "SkDescriptor.h" #include "SkMaskFilterBase.h" @@ -25,7 +24,6 @@ class GrAtlasManager; struct GrDistanceFieldAdjustTable; struct GrGlyph; -class GrMemoryPool; class SkDrawFilter; class SkTextBlob; diff --git a/src/gpu/text/GrTextContext.cpp b/src/gpu/text/GrTextContext.cpp index b8fe456b79..2fc1f5bca4 100644 --- a/src/gpu/text/GrTextContext.cpp +++ b/src/gpu/text/GrTextContext.cpp @@ -761,7 +761,9 @@ std::unique_ptr<GrDrawOp> GrTextContext::createOp_TestingOnly(GrContext* context GrRenderTargetContext* rtc, const SkPaint& skPaint, const SkMatrix& viewMatrix, - const char* text, int x, int y) { + const char* text, + int x, + int y) { auto glyphCache = context->contextPriv().getGlyphCache(); static SkSurfaceProps surfaceProps(SkSurfaceProps::kLegacyFontHost_InitType); diff --git a/src/gpu/text/GrTextContext.h b/src/gpu/text/GrTextContext.h index 478d4c42b6..dd82b3ce7d 100644 --- a/src/gpu/text/GrTextContext.h +++ b/src/gpu/text/GrTextContext.h @@ -52,10 +52,14 @@ public: const SkMatrix& viewMatrix, const SkSurfaceProps&, const SkTextBlob*, SkScalar x, SkScalar y, SkDrawFilter*, const SkIRect& clipBounds); - std::unique_ptr<GrDrawOp> createOp_TestingOnly(GrContext*, GrTextContext*, - GrRenderTargetContext*, const SkPaint&, - const SkMatrix& viewMatrix, const char* text, - int x, int y); + std::unique_ptr<GrDrawOp> createOp_TestingOnly(GrContext*, + GrTextContext*, + GrRenderTargetContext*, + const SkPaint&, + const SkMatrix& viewMatrix, + const char* text, + int x, + int y); static void SanitizeOptions(Options* options); static bool CanDrawAsDistanceFields(const SkPaint& skPaint, const SkMatrix& viewMatrix, diff --git a/src/gpu/text/GrTextUtils.h b/src/gpu/text/GrTextUtils.h index 3a0ad0ac71..363a91e065 100644 --- a/src/gpu/text/GrTextUtils.h +++ b/src/gpu/text/GrTextUtils.h @@ -57,6 +57,8 @@ public: virtual void makeGrPaint(GrMaskFormat, const SkPaint&, const SkMatrix& viewMatrix, GrPaint*) = 0; + virtual GrContext* getContext() = 0; + protected: Target(int width, int height, const GrColorSpaceInfo& colorSpaceInfo) : fWidth(width), fHeight(height), fColorSpaceInfo(colorSpaceInfo) {} |