diff options
author | Brian Osman <brianosman@google.com> | 2016-10-27 14:47:55 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-27 19:14:09 +0000 |
commit | 1105224f9701e57ec5ce0354d6a380b664f5c638 (patch) | |
tree | 2b6f3db0bfd99da5e22adabc0da37d9271c8b543 /src/gpu/text/GrAtlasTextContext.cpp | |
parent | 6e74412a9cf1ffa44271a55b42f18e8a0813a0a2 (diff) |
Rename GrDrawContext to GrRenderTargetContext
This is in preparation for GrTextureContext and GrSurfaceContext
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030
Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd
Reviewed-on: https://skia-review.googlesource.com/4030
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/text/GrAtlasTextContext.cpp')
-rw-r--r-- | src/gpu/text/GrAtlasTextContext.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp index 83c34dfca8..1d6cef0bbf 100644 --- a/src/gpu/text/GrAtlasTextContext.cpp +++ b/src/gpu/text/GrAtlasTextContext.cpp @@ -7,7 +7,7 @@ #include "GrAtlasTextContext.h" #include "GrContext.h" -#include "GrDrawContext.h" +#include "GrRenderTargetContext.h" #include "GrTextBlobCache.h" #include "GrTextUtils.h" @@ -53,10 +53,10 @@ GrColor GrAtlasTextContext::ComputeCanonicalColor(const SkPaint& paint, bool lcd return canonicalColor; } -uint32_t GrAtlasTextContext::ComputeScalerContextFlags(GrDrawContext* dc) { +uint32_t GrAtlasTextContext::ComputeScalerContextFlags(GrRenderTargetContext* rtc) { // If we're doing gamma-correct rendering, then we can disable the gamma hacks. // Otherwise, leave them on. In either case, we still want the contrast boost: - if (dc->isGammaCorrect()) { + if (rtc->isGammaCorrect()) { return SkPaint::kBoostContrast_ScalerContextFlag; } else { return SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags; @@ -76,7 +76,7 @@ bool GrAtlasTextContext::HasLCD(const SkTextBlob* blob) { return false; } -void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc, +void GrAtlasTextContext::drawTextBlob(GrContext* context, GrRenderTargetContext* rtc, const GrClip& clip, const SkPaint& skPaint, const SkMatrix& viewMatrix, const SkSurfaceProps& props, const SkTextBlob* blob, @@ -96,7 +96,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc, bool canCache = !(skPaint.getPathEffect() || (mf && !mf->asABlur(&blurRec)) || drawFilter); - uint32_t scalerContextFlags = ComputeScalerContextFlags(dc); + uint32_t scalerContextFlags = ComputeScalerContextFlags(rtc); GrTextBlobCache* cache = context->getTextBlobCache(); if (canCache) { @@ -124,7 +124,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc, // Though for the time being runs in the textblob can override the paint, they only touch font // info. GrPaint grPaint; - if (!SkPaintToGrPaint(context, dc, skPaint, viewMatrix, &grPaint)) { + if (!SkPaintToGrPaint(context, rtc, skPaint, viewMatrix, &grPaint)) { return; } @@ -167,7 +167,7 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrDrawContext* dc, blob, x, y, drawFilter); } - cacheBlob->flushCached(context, dc, blob, props, fDistanceAdjustTable, skPaint, + cacheBlob->flushCached(context, rtc, blob, props, fDistanceAdjustTable, skPaint, grPaint, drawFilter, clip, viewMatrix, clipBounds, x, y); } @@ -313,7 +313,7 @@ GrAtlasTextContext::CreateDrawPosTextBlob(GrTextBlobCache* blobCache, GrBatchFon } void GrAtlasTextContext::drawText(GrContext* context, - GrDrawContext* dc, + GrRenderTargetContext* rtc, const GrClip& clip, const GrPaint& paint, const SkPaint& skPaint, const SkMatrix& viewMatrix, @@ -327,21 +327,21 @@ void GrAtlasTextContext::drawText(GrContext* context, CreateDrawTextBlob(context->getTextBlobCache(), context->getBatchFontCache(), *context->caps()->shaderCaps(), paint, skPaint, - ComputeScalerContextFlags(dc), + ComputeScalerContextFlags(rtc), viewMatrix, props, text, byteLength, x, y)); - blob->flushThrowaway(context, dc, props, fDistanceAdjustTable, skPaint, paint, + blob->flushThrowaway(context, rtc, props, fDistanceAdjustTable, skPaint, paint, clip, viewMatrix, regionClipBounds, x, y); return; } // fall back to drawing as a path - GrTextUtils::DrawTextAsPath(context, dc, clip, skPaint, viewMatrix, text, byteLength, x, y, + GrTextUtils::DrawTextAsPath(context, rtc, clip, skPaint, viewMatrix, text, byteLength, x, y, regionClipBounds); } void GrAtlasTextContext::drawPosText(GrContext* context, - GrDrawContext* dc, + GrRenderTargetContext* rtc, const GrClip& clip, const GrPaint& paint, const SkPaint& skPaint, const SkMatrix& viewMatrix, @@ -357,18 +357,18 @@ void GrAtlasTextContext::drawPosText(GrContext* context, context->getBatchFontCache(), *context->caps()->shaderCaps(), paint, skPaint, - ComputeScalerContextFlags(dc), + ComputeScalerContextFlags(rtc), viewMatrix, props, text, byteLength, pos, scalarsPerPosition, offset)); - blob->flushThrowaway(context, dc, props, fDistanceAdjustTable, skPaint, paint, + blob->flushThrowaway(context, rtc, props, fDistanceAdjustTable, skPaint, paint, clip, viewMatrix, regionClipBounds, offset.fX, offset.fY); return; } // fall back to drawing as a path - GrTextUtils::DrawPosTextAsPath(context, dc, props, clip, skPaint, viewMatrix, text, + GrTextUtils::DrawPosTextAsPath(context, rtc, props, clip, skPaint, viewMatrix, text, byteLength, pos, scalarsPerPosition, offset, regionClipBounds); } @@ -388,9 +388,9 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) { gTextContext = GrAtlasTextContext::Create(); } - // Setup dummy SkPaint / GrPaint / GrDrawContext - sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApprox, 1024, 1024, - kRGBA_8888_GrPixelConfig, nullptr)); + // Setup dummy SkPaint / GrPaint / GrRenderTargetContext + sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContext( + SkBackingFit::kApprox, 1024, 1024, kRGBA_8888_GrPixelConfig, nullptr)); GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); @@ -401,7 +401,7 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) { skPaint.setSubpixelText(random->nextBool()); GrPaint grPaint; - if (!SkPaintToGrPaint(context, drawContext.get(), skPaint, viewMatrix, &grPaint)) { + if (!SkPaintToGrPaint(context, renderTargetContext.get(), skPaint, viewMatrix, &grPaint)) { SkFAIL("couldn't convert paint\n"); } |