aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDistanceFieldTextContext.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-02-25 11:21:21 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-25 11:21:21 -0800
commit586d5d640b19860dfbbd903a5188da1bbbe87336 (patch)
treeab3fde1525edf311a9c384404a847757251108be /src/gpu/GrDistanceFieldTextContext.cpp
parent63d0024cde57eba4f7802fdc4fe49467867f52ba (diff)
I'd really like to land this before the branch so speedy reviews are appreciated.
Diffstat (limited to 'src/gpu/GrDistanceFieldTextContext.cpp')
-rwxr-xr-xsrc/gpu/GrDistanceFieldTextContext.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index d2b34e68a0..47d408f7f8 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -112,9 +112,9 @@ bool GrDistanceFieldTextContext::canDraw(const SkPaint& paint, const SkMatrix& v
return true;
}
-inline void GrDistanceFieldTextContext::init(GrRenderTarget* rt, const GrPaint& paint,
- const SkPaint& skPaint) {
- GrTextContext::init(rt, paint, skPaint);
+inline void GrDistanceFieldTextContext::init(GrRenderTarget* rt, const GrClip& clip,
+ const GrPaint& paint, const SkPaint& skPaint) {
+ GrTextContext::init(rt, clip, paint, skPaint);
fStrike = NULL;
@@ -207,7 +207,8 @@ static void setup_gamma_texture(GrContext* context, const SkGlyphCache* cache,
}
}
-void GrDistanceFieldTextContext::onDrawText(GrRenderTarget* rt, const GrPaint& paint,
+void GrDistanceFieldTextContext::onDrawText(GrRenderTarget* rt, const GrClip& clip,
+ const GrPaint& paint,
const SkPaint& skPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y) {
@@ -268,11 +269,12 @@ void GrDistanceFieldTextContext::onDrawText(GrRenderTarget* rt, const GrPaint& p
y -= alignY;
SkPoint offset = SkPoint::Make(x, y);
- this->drawPosText(rt, paint, skPaint, viewMatrix, text, byteLength, positions.begin(), 2,
+ this->drawPosText(rt, clip, paint, skPaint, viewMatrix, text, byteLength, positions.begin(), 2,
offset);
}
-void GrDistanceFieldTextContext::onDrawPosText(GrRenderTarget* rt, const GrPaint& paint,
+void GrDistanceFieldTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip,
+ const GrPaint& paint,
const SkPaint& skPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
@@ -287,7 +289,7 @@ void GrDistanceFieldTextContext::onDrawPosText(GrRenderTarget* rt, const GrPaint
}
fViewMatrix = viewMatrix;
- this->init(rt, paint, skPaint);
+ this->init(rt, clip, paint, skPaint);
SkDrawCacheProc glyphCacheProc = fSkPaint.getDrawCacheProc();
@@ -362,7 +364,7 @@ void GrDistanceFieldTextContext::onDrawPosText(GrRenderTarget* rt, const GrPaint
this->finish();
if (fallbackTxt.count() > 0) {
- fFallbackTextContext->drawPosText(rt, paint, skPaint, viewMatrix, fallbackTxt.begin(),
+ fFallbackTextContext->drawPosText(rt, clip, paint, skPaint, viewMatrix, fallbackTxt.begin(),
fallbackTxt.count(), fallbackPos.begin(),
scalarsPerPosition, offset);
}
@@ -571,7 +573,7 @@ bool GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
tmpPath.transform(ctm);
GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
- fContext->drawPath(fRenderTarget, fPaint, fViewMatrix, tmpPath, strokeInfo);
+ fContext->drawPath(fRenderTarget, fClip, fPaint, fViewMatrix, tmpPath, strokeInfo);
// remove this glyph from the vertices we need to allocate
fTotalVertexCount -= kVerticesPerGlyph;