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

Unified Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 939623005: Pass Rendertarget into context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: sampleapp 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
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index 2f2f1f8ebd1182fe0aa2616e2403a185f6f115b0..3061ec6b10871ebd80339b89f23322dda983a548 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -64,7 +64,8 @@ bool GrStencilAndCoverTextContext::canDraw(const SkPaint& paint, const SkMatrix&
return rec.getFormat() != SkMask::kARGB32_Format;
}
-void GrStencilAndCoverTextContext::onDrawText(const GrPaint& paint,
+void GrStencilAndCoverTextContext::onDrawText(GrRenderTarget* rt,
+ const GrPaint& paint,
const SkPaint& skPaint,
const SkMatrix& viewMatrix,
const char text[],
@@ -91,7 +92,7 @@ void GrStencilAndCoverTextContext::onDrawText(const GrPaint& paint,
// will turn off the use of device-space glyphs when perspective transforms
// are in use.
- this->init(paint, skPaint, byteLength, kMaxAccuracy_RenderMode, viewMatrix);
+ this->init(rt, paint, skPaint, byteLength, kMaxAccuracy_RenderMode, viewMatrix);
// Transform our starting point.
if (fUsingDeviceSpaceGlyphs) {
@@ -153,7 +154,8 @@ void GrStencilAndCoverTextContext::onDrawText(const GrPaint& paint,
this->finish();
}
-void GrStencilAndCoverTextContext::onDrawPosText(const GrPaint& paint,
+void GrStencilAndCoverTextContext::onDrawPosText(GrRenderTarget* rt,
+ const GrPaint& paint,
const SkPaint& skPaint,
const SkMatrix& viewMatrix,
const char text[],
@@ -177,7 +179,7 @@ void GrStencilAndCoverTextContext::onDrawPosText(const GrPaint& paint,
// transform is not part of SkPaint::measureText API, and thus we use the
// same glyphs as what were measured.
- this->init(paint, skPaint, byteLength, kMaxPerformance_RenderMode, viewMatrix);
+ this->init(rt, paint, skPaint, byteLength, kMaxPerformance_RenderMode, viewMatrix);
SkDrawCacheProc glyphCacheProc = fSkPaint.getDrawCacheProc();
@@ -229,12 +231,13 @@ static GrPathRange* get_gr_glyphs(GrContext* ctx,
return glyphs.detach();
}
-void GrStencilAndCoverTextContext::init(const GrPaint& paint,
+void GrStencilAndCoverTextContext::init(GrRenderTarget* rt,
+ const GrPaint& paint,
const SkPaint& skPaint,
size_t textByteLength,
RenderMode renderMode,
const SkMatrix& viewMatrix) {
- GrTextContext::init(paint, skPaint);
+ GrTextContext::init(rt, paint, skPaint);
fContextInitialMatrix = viewMatrix;
fViewMatrix = viewMatrix;
@@ -351,7 +354,7 @@ void GrStencilAndCoverTextContext::init(const GrPaint& paint,
fStateRestore.set(&fPipelineBuilder);
- fPipelineBuilder.setFromPaint(fPaint, fContext->getRenderTarget());
+ fPipelineBuilder.setFromPaint(fPaint, fRenderTarget);
GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
kZero_StencilOp,
@@ -439,8 +442,8 @@ void GrStencilAndCoverTextContext::flush() {
inverse.mapPoints(&fGlyphPositions[fFallbackGlyphsIdx], fallbackGlyphCount);
}
- fFallbackTextContext->drawPosText(paintFallback, skPaintFallback, fViewMatrix,
- (char*)&fGlyphIndices[fFallbackGlyphsIdx],
+ fFallbackTextContext->drawPosText(fRenderTarget, paintFallback, skPaintFallback,
+ fViewMatrix, (char*)&fGlyphIndices[fFallbackGlyphsIdx],
2 * fallbackGlyphCount,
get_xy_scalar_array(&fGlyphPositions[fFallbackGlyphsIdx]),
2, SkPoint::Make(0, 0));
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698