aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-07-09 10:55:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-09 10:55:28 -0700
commit9df4659523fbabcf0bc5eb763d56c4c4566d4858 (patch)
treed47b31ad053217b1dc73ef6e9cd8e8ed7daec31f
parent828877d7267bcb7c272a1df4e36a6a79894bf00d (diff)
Remove init function from GrTextContext.h
-rw-r--r--src/gpu/GrStencilAndCoverTextContext.cpp10
-rw-r--r--src/gpu/GrStencilAndCoverTextContext.h6
-rw-r--r--src/gpu/GrTextContext.cpp15
-rw-r--r--src/gpu/GrTextContext.h9
4 files changed, 16 insertions, 24 deletions
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index e62ed38635..b07a546b9a 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -255,7 +255,15 @@ void GrStencilAndCoverTextContext::init(GrRenderTarget* rt,
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;
diff --git a/src/gpu/GrStencilAndCoverTextContext.h b/src/gpu/GrStencilAndCoverTextContext.h
index f59f633bfd..02d1d3f6a9 100644
--- a/src/gpu/GrStencilAndCoverTextContext.h
+++ b/src/gpu/GrStencilAndCoverTextContext.h
@@ -68,6 +68,12 @@ private:
SkMatrix fViewMatrix;
SkMatrix fLocalMatrix;
bool fUsingDeviceSpaceGlyphs;
+ SkAutoTUnref<GrRenderTarget> fRenderTarget;
+ GrClip fClip;
+ SkIRect fClipRect;
+ SkIRect fRegionClipBounds;
+ GrPaint fPaint;
+ SkPaint fSkPaint;
GrStencilAndCoverTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&);
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index f929de69b1..8f348f68cf 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -32,19 +32,6 @@ GrTextContext::~GrTextContext() {
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,
@@ -147,7 +134,7 @@ void GrTextContext::drawTextBlob(GrRenderTarget* rt,
runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint));
GrPaint grPaint;
- if (!SkPaint2GrPaint(fContext, fRenderTarget, runPaint, viewMatrix, true, &grPaint)) {
+ if (!SkPaint2GrPaint(fContext, rt, runPaint, viewMatrix, true, &grPaint)) {
return;
}
diff --git a/src/gpu/GrTextContext.h b/src/gpu/GrTextContext.h
index e7b5c3ac5d..476093f159 100644
--- a/src/gpu/GrTextContext.h
+++ b/src/gpu/GrTextContext.h
@@ -49,12 +49,6 @@ protected:
SkSurfaceProps fSurfaceProps;
GrDrawContext* fDrawContext; // owning drawContext
- SkAutoTUnref<GrRenderTarget> fRenderTarget;
- GrClip fClip;
- SkIRect fClipRect;
- SkIRect fRegionClipBounds;
- GrPaint fPaint;
- SkPaint fSkPaint;
GrTextContext(GrContext*, GrDrawContext*, const SkSurfaceProps&);
@@ -82,9 +76,6 @@ protected:
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,