Remove init function from GrTextContext.h
authorjoshualitt <joshualitt@chromium.org>
Thu, 9 Jul 2015 17:55:28 +0000 (10:55 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 9 Jul 2015 17:55:28 +0000 (10:55 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1231923002

src/gpu/GrStencilAndCoverTextContext.cpp
src/gpu/GrStencilAndCoverTextContext.h
src/gpu/GrTextContext.cpp
src/gpu/GrTextContext.h

index e62ed38..b07a546 100644 (file)
@@ -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;
index f59f633..02d1d3f 100644 (file)
@@ -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&);
 
index f929de6..8f348f6 100644 (file)
@@ -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;
         }
 
index e7b5c3a..476093f 100644 (file)
@@ -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,