Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1554)

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 1015173002: Let text contexts fall back directly to paths (Closed) Base URL: https://skia.googlesource.com/skia.git@text-blob-to-context
Patch Set: tidying Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index 2a439da4f27e5743171f8338fbeadb7d4720f0ce..18dc0e553f9f1dc1035a00e048e1e2b19a1db689 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -42,9 +42,10 @@ static const int kVerticesPerGlyph = 4;
static const int kIndicesPerGlyph = 6;
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
+ SkGpuDevice* gpuDevice,
const SkDeviceProperties& properties,
bool enable)
- : GrTextContext(context, properties) {
+ : GrTextContext(context, gpuDevice, properties) {
#if SK_FORCE_DISTANCE_FIELD_TEXT
fEnableDFRendering = true;
#else
@@ -67,11 +68,12 @@ GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
}
GrDistanceFieldTextContext* GrDistanceFieldTextContext::Create(GrContext* context,
+ SkGpuDevice* gpuDevice,
const SkDeviceProperties& props,
bool enable) {
GrDistanceFieldTextContext* textContext = SkNEW_ARGS(GrDistanceFieldTextContext,
- (context, props, enable));
- textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, props);
+ (context, gpuDevice, props, enable));
+ textContext->fFallbackTextContext = GrBitmapTextContext::Create(context, gpuDevice, props);
return textContext;
}
@@ -270,8 +272,8 @@ void GrDistanceFieldTextContext::onDrawText(GrRenderTarget* rt, const GrClip& cl
y -= alignY;
SkPoint offset = SkPoint::Make(x, y);
- this->drawPosText(rt, clip, paint, skPaint, viewMatrix, text, byteLength, positions.begin(), 2,
- offset);
+ this->onDrawPosText(rt, clip, paint, skPaint, viewMatrix, text, byteLength, positions.begin(),
+ 2, offset);
}
void GrDistanceFieldTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip,
@@ -365,9 +367,9 @@ void GrDistanceFieldTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip&
this->finish();
if (fallbackTxt.count() > 0) {
- fFallbackTextContext->drawPosText(rt, clip, paint, skPaint, viewMatrix, fallbackTxt.begin(),
- fallbackTxt.count(), fallbackPos.begin(),
- scalarsPerPosition, offset);
+ fFallbackTextContext->onDrawPosText(rt, clip, paint, skPaint, viewMatrix,
+ fallbackTxt.begin(), fallbackTxt.count(),
+ fallbackPos.begin(), scalarsPerPosition, offset);
}
}

Powered by Google App Engine
This is Rietveld 408576698