Remove init function from GrTextContext.h

BUG=skia:

Review URL: https://codereview.chromium.org/1231923002
This commit is contained in:
joshualitt 2015-07-09 10:55:28 -07:00 committed by Commit bot
parent 828877d726
commit 9df4659523
4 changed files with 16 additions and 24 deletions

View File

@ -255,7 +255,15 @@ void GrStencilAndCoverTextContext::init(GrRenderTarget* rt,
RenderMode renderMode, RenderMode renderMode,
const SkMatrix& viewMatrix, const SkMatrix& viewMatrix,
const SkIRect& regionClipBounds) { 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; fContextInitialMatrix = viewMatrix;
fViewMatrix = viewMatrix; fViewMatrix = viewMatrix;

View File

@ -68,6 +68,12 @@ private:
SkMatrix fViewMatrix; SkMatrix fViewMatrix;
SkMatrix fLocalMatrix; SkMatrix fLocalMatrix;
bool fUsingDeviceSpaceGlyphs; bool fUsingDeviceSpaceGlyphs;
SkAutoTUnref<GrRenderTarget> fRenderTarget;
GrClip fClip;
SkIRect fClipRect;
SkIRect fRegionClipBounds;
GrPaint fPaint;
SkPaint fSkPaint;
GrStencilAndCoverTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&); GrStencilAndCoverTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&);

View File

@ -32,19 +32,6 @@ GrTextContext::~GrTextContext() {
SkDELETE(fFallbackTextContext); 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, void GrTextContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPaint& paint,
const SkPaint& skPaint, const SkMatrix& viewMatrix, const SkPaint& skPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength, const char text[], size_t byteLength,
@ -147,7 +134,7 @@ void GrTextContext::drawTextBlob(GrRenderTarget* rt,
runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint)); runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint));
GrPaint grPaint; GrPaint grPaint;
if (!SkPaint2GrPaint(fContext, fRenderTarget, runPaint, viewMatrix, true, &grPaint)) { if (!SkPaint2GrPaint(fContext, rt, runPaint, viewMatrix, true, &grPaint)) {
return; return;
} }

View File

@ -49,12 +49,6 @@ protected:
SkSurfaceProps fSurfaceProps; SkSurfaceProps fSurfaceProps;
GrDrawContext* fDrawContext; // owning drawContext GrDrawContext* fDrawContext; // owning drawContext
SkAutoTUnref<GrRenderTarget> fRenderTarget;
GrClip fClip;
SkIRect fClipRect;
SkIRect fRegionClipBounds;
GrPaint fPaint;
SkPaint fSkPaint;
GrTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&); GrTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&);
@ -82,9 +76,6 @@ protected:
const SkScalar pos[], int scalarsPerPosition, const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset, const SkIRect& clipBounds); const SkPoint& offset, const SkIRect& clipBounds);
void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
const SkIRect& regionClipBounds);
static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache);
// sets extent in stopVector and returns glyph count // sets extent in stopVector and returns glyph count
static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc,