Retract GrDrawTarget and GrPipelineBuilder a bit more
authorrobertphillips <robertphillips@google.com>
Wed, 2 Mar 2016 19:36:59 +0000 (11:36 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 2 Mar 2016 19:36:59 +0000 (11:36 -0800)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1761523002
NOTRY=true

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

src/gpu/GrTracing.h
src/gpu/batches/GrDashLinePathRenderer.cpp
src/gpu/effects/GrDashingEffect.cpp
src/gpu/effects/GrDashingEffect.h
src/gpu/text/GrAtlasTextContext.cpp
src/gpu/text/GrStencilAndCoverTextContext.cpp
src/gpu/text/GrStencilAndCoverTextContext.h

index 3dbc0ef17e0296f71a754e691a29d35418d188e1..273aa65989f2f50eecd6ba05c60ba16c465b3e77 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef GrTracing_DEFINED
 #define GrTracing_DEFINED
 
-#include "GrDrawTarget.h"
 #include "GrGpu.h"
 #include "GrTraceMarker.h"
 #include "SkTLazy.h"
@@ -19,7 +18,7 @@
  */
 class GrGpuTraceMarkerGenerator : public ::SkNoncopyable {
 public:
-    GrGpuTraceMarkerGenerator(GrDrawTarget* target) {}
+    GrGpuTraceMarkerGenerator() {}
 
     ~GrGpuTraceMarkerGenerator() {
         if (fTraceMarker.isValid()) {
index 902dca6d862a02aa80517d2529a6142e8ab9ab56..9ee27c78ddfc2bbf8ad10812b910bbac9c90ef3e 100644 (file)
@@ -20,8 +20,19 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
 
 bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
     GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrDashLinePathRenderer::onDrawPath");
+    bool msaaIsEnabled = args.fPipelineBuilder->getRenderTarget()->isUnifiedMultisampled();
     SkPoint pts[2];
     SkAssertResult(args.fPath->isLine(pts));
-    return GrDashingEffect::DrawDashLine(args.fTarget, *args.fPipelineBuilder, args.fColor,
-                                         *args.fViewMatrix, pts, args.fAntiAlias, *args.fStroke);
+    SkAutoTUnref<GrDrawBatch> batch(GrDashingEffect::CreateDashLineBatch(args.fColor,
+                                                                         *args.fViewMatrix,
+                                                                         pts,
+                                                                         args.fAntiAlias,
+                                                                         msaaIsEnabled,
+                                                                         *args.fStroke));
+    if (!batch) {
+        return false;
+    }
+
+    args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
+    return true;
 }
index 17a2d8dfe70ea0ccaf7a7a4d128c97a180c95127..13d4a38e8535f5ab0de470277d109e3390ed16c5 100644 (file)
@@ -14,7 +14,6 @@
 #include "GrContext.h"
 #include "GrCoordTransform.h"
 #include "GrDefaultGeoProcFactory.h"
-#include "GrDrawTarget.h"
 #include "GrInvariantOutput.h"
 #include "GrProcessor.h"
 #include "GrStrokeInfo.h"
@@ -746,19 +745,13 @@ static GrDrawBatch* create_batch(GrColor color, const SkMatrix& viewMatrix, cons
     return DashBatch::Create(geometry, cap, aaMode, fullDash);
 }
 
-bool GrDashingEffect::DrawDashLine(GrDrawTarget* target,
-                                   const GrPipelineBuilder& pipelineBuilder, GrColor color,
-                                   const SkMatrix& viewMatrix, const SkPoint pts[2],
-                                   bool useAA, const GrStrokeInfo& strokeInfo) {
-    SkAutoTUnref<GrDrawBatch> batch(
-            create_batch(color, viewMatrix, pts, useAA, strokeInfo,
-                         pipelineBuilder.getRenderTarget()->isUnifiedMultisampled()));
-    if (!batch) {
-        return false;
-    }
-
-    target->drawBatch(pipelineBuilder, batch);
-    return true;
+GrDrawBatch* GrDashingEffect::CreateDashLineBatch(GrColor color,
+                                                  const SkMatrix& viewMatrix,
+                                                  const SkPoint pts[2],
+                                                  bool useAA,
+                                                  bool msaaIsEnabled,
+                                                  const GrStrokeInfo& strokeInfo) {
+    return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaIsEnabled);
 }
 
 //////////////////////////////////////////////////////////////////////////////
index 7d0d006f1b56e93ff287cf11dd11ee28cd063c9a..eaa0d0d5b5ffa0981b0127de15141fcc86180689 100644 (file)
 #include "SkPathEffect.h"
 
 class GrClip;
-class GrDrawTarget;
-class GrPaint;
-class GrPipelineBuilder;
+class GrDrawBatch;
 class GrStrokeInfo;
 
 namespace GrDashingEffect {
-    bool DrawDashLine(GrDrawTarget*, const GrPipelineBuilder&, GrColor,
-                      const SkMatrix& viewMatrix, const SkPoint pts[2], bool useAA,
-                      const GrStrokeInfo& strokeInfo);
+    GrDrawBatch* CreateDashLineBatch(GrColor,
+                                     const SkMatrix& viewMatrix,
+                                     const SkPoint pts[2],
+                                     bool useAA,
+                                     bool msaaIsEnabled,
+                                     const GrStrokeInfo& strokeInfo);
     bool CanDrawDashLine(const SkPoint pts[2], const GrStrokeInfo& strokeInfo,
                          const SkMatrix& viewMatrix);
 }
index 9cdd891b15bf5bbd44a935f361bb77bd29a26281..1a778103067a3692d7343d4a9dadb92a8dc5852d 100644 (file)
@@ -6,8 +6,8 @@
  */
 #include "GrAtlasTextContext.h"
 
+#include "GrContext.h"
 #include "GrDrawContext.h"
-#include "GrDrawTarget.h"
 #include "GrTextBlobCache.h"
 #include "GrTextUtils.h"
 
index 52281b2bbe228199b6934d55095cd9c27e3b81f7..12b3f2f877a635b7635400c6c34d921a6b1b5973 100644 (file)
@@ -8,7 +8,6 @@
 #include "GrStencilAndCoverTextContext.h"
 #include "GrAtlasTextContext.h"
 #include "GrDrawContext.h"
-#include "GrDrawTarget.h"
 #include "GrPath.h"
 #include "GrPathRange.h"
 #include "GrResourceProvider.h"
index 892e279f59fbc7eb47ac7d333abd6fc60dfe56fd..b1faba11b0ba93e34646ef252a9744b2fe8cf3c9 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef GrStencilAndCoverTextContext_DEFINED
 #define GrStencilAndCoverTextContext_DEFINED
 
-#include "GrDrawTarget.h"
+#include "GrDrawContext.h"
 #include "GrStrokeInfo.h"
 #include "SkDrawFilter.h"
 #include "SkTextBlob.h"