Some small code tidying
authorjoshualitt <joshualitt@chromium.org>
Thu, 26 Feb 2015 16:47:52 +0000 (08:47 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 26 Feb 2015 16:47:52 +0000 (08:47 -0800)
BUG=skia:

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

src/gpu/GrClipMaskManager.cpp
src/gpu/GrDefaultPathRenderer.h
src/gpu/GrDrawTarget.h
src/gpu/GrInOrderDrawBuffer.cpp

index 99c74e3..690c31a 100644 (file)
@@ -30,10 +30,12 @@ typedef SkClipStack::Element Element;
 namespace {
 // set up the draw state to enable the aa clipping mask. Besides setting up the
 // stage matrix this also alters the vertex layout
-void setup_drawstate_aaclip(const SkIRect &devBound,
-                            GrPipelineBuilder* pipelineBuilder,
-                            GrTexture* result) {
-    SkASSERT(pipelineBuilder);
+void setup_drawstate_aaclip(GrPipelineBuilder* pipelineBuilder,
+                            GrTexture* result,
+                            GrPipelineBuilder::AutoRestoreEffects* are,
+                            const SkIRect &devBound) {
+    SkASSERT(pipelineBuilder && are);
+    are->set(pipelineBuilder);
 
     SkMatrix mat;
     // We use device coords to compute the texture coordinates. We set our matrix to be a
@@ -169,7 +171,7 @@ bool GrClipMaskManager::installClipEffects(GrPipelineBuilder* pipelineBuilder,
             switch (iter.get()->getType()) {
                 case SkClipStack::Element::kPath_Type:
                     fp.reset(GrConvexPolyEffect::Create(edgeType, iter.get()->getPath(),
-                        &clipToRTOffset));
+                                                        &clipToRTOffset));
                     break;
                 case SkClipStack::Element::kRRect_Type: {
                     SkRRect rrect = iter.get()->getRRect();
@@ -331,11 +333,12 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder,
         }
 
         if (result) {
+            are->set(pipelineBuilder);
             // The mask's top left coord should be pinned to the rounded-out top left corner of
             // clipSpace bounds. We determine the mask's position WRT to the render target here.
             SkIRect rtSpaceMaskBounds = clipSpaceIBounds;
             rtSpaceMaskBounds.offset(-clip.origin());
-            setup_drawstate_aaclip(rtSpaceMaskBounds, pipelineBuilder, result);
+            setup_drawstate_aaclip(pipelineBuilder, result, are, rtSpaceMaskBounds);
             this->setPipelineBuilderStencil(pipelineBuilder, ars);
             return true;
         }
index 5a805e5..11105cf 100644 (file)
@@ -55,16 +55,6 @@ private:
                           const SkStrokeRec&,
                           bool stencilOnly);
 
-    bool createGeom(GrDrawTarget*,
-                    GrPipelineBuilder*,
-                    GrPrimitiveType*,
-                    int* vertexCnt,
-                    int* indexCnt,
-                    GrDrawTarget::AutoReleaseGeometry*,
-                    const SkPath&,
-                    const SkStrokeRec&,
-                    SkScalar srcSpaceTol);
-
     bool    fSeparateStencil;
     bool    fStencilWrapOps;
 
index 662b7e0..d5063c6 100644 (file)
@@ -306,7 +306,6 @@ public:
                   const SkRect& rect,
                   const SkRect* localRect,
                   const SkMatrix* localMatrix) {
-        AutoGeometryPush agp(this);
         this->onDrawRect(pipelineBuilder, color, viewMatrix, rect, localRect, localMatrix);
     }
 
index 5dc851c..0f10623 100644 (file)
@@ -301,7 +301,6 @@ void GrInOrderDrawBuffer::onDrawRect(GrPipelineBuilder* pipelineBuilder,
                                      const SkRect& rect,
                                      const SkRect* localRect,
                                      const SkMatrix* localMatrix) {
-    GrPipelineBuilder::AutoRestoreEffects are(pipelineBuilder);
     RectBatch::Geometry geometry;
     geometry.fColor = color;
     geometry.fViewMatrix = viewMatrix;