RenderMode renderMode,
const SkMatrix& viewMatrix,
const SkIRect& regionClipBounds) {
- GrTextContext::init(rt, clip, paint, skPaint, regionClipBounds);
+ fClip = clip;
+
+ fRenderTarget.reset(SkRef(rt));
+
+ fRegionClipBounds = regionClipBounds;
+ fClip.getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect);
+
+ fPaint = paint;
+ fSkPaint = skPaint;
fContextInitialMatrix = viewMatrix;
fViewMatrix = viewMatrix;
SkMatrix fViewMatrix;
SkMatrix fLocalMatrix;
bool fUsingDeviceSpaceGlyphs;
+ SkAutoTUnref<GrRenderTarget> fRenderTarget;
+ GrClip fClip;
+ SkIRect fClipRect;
+ SkIRect fRegionClipBounds;
+ GrPaint fPaint;
+ SkPaint fSkPaint;
GrStencilAndCoverTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&);
SkDELETE(fFallbackTextContext);
}
-void GrTextContext::init(GrRenderTarget* rt, const GrClip& clip, const GrPaint& grPaint,
- const SkPaint& skPaint, const SkIRect& regionClipBounds) {
- fClip = clip;
-
- fRenderTarget.reset(SkRef(rt));
-
- fRegionClipBounds = regionClipBounds;
- fClip.getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect);
-
- fPaint = grPaint;
- fSkPaint = skPaint;
-}
-
void GrTextContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPaint& paint,
const SkPaint& skPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint));
GrPaint grPaint;
- if (!SkPaint2GrPaint(fContext, fRenderTarget, runPaint, viewMatrix, true, &grPaint)) {
+ if (!SkPaint2GrPaint(fContext, rt, runPaint, viewMatrix, true, &grPaint)) {
return;
}
SkSurfaceProps fSurfaceProps;
GrDrawContext* fDrawContext; // owning drawContext
- SkAutoTUnref<GrRenderTarget> fRenderTarget;
- GrClip fClip;
- SkIRect fClipRect;
- SkIRect fRegionClipBounds;
- GrPaint fPaint;
- SkPaint fSkPaint;
GrTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&);
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset, const SkIRect& clipBounds);
- void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
- const SkIRect& regionClipBounds);
-
static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache);
// sets extent in stopVector and returns glyph count
static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc,