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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 936943002: Pass clip to context (Closed) Base URL: https://skia.googlesource.com/skia.git@pass_down_rendertarget
Patch Set: feedback inc Created 5 years, 10 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 d2b34e68a01b1940f8e5ad51f48fb905f2e41ee0..47d408f7f8969270ab01beb53c7386931a82dd44 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;

Powered by Google App Engine
This is Rietveld 408576698