aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-03-02 11:36:59 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-02 11:36:59 -0800
commit73c4e64f4bb90059cf822dac9eaf30e1c38bec77 (patch)
tree34aaa972e54502b149a3f204200e65595382e454
parenta1e6b3be8124cef85f2e39e3cb85000ad9526d48 (diff)
Retract GrDrawTarget and GrPipelineBuilder a bit more
-rw-r--r--src/gpu/GrTracing.h3
-rw-r--r--src/gpu/batches/GrDashLinePathRenderer.cpp15
-rw-r--r--src/gpu/effects/GrDashingEffect.cpp21
-rw-r--r--src/gpu/effects/GrDashingEffect.h13
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp2
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp1
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.h2
7 files changed, 30 insertions, 27 deletions
diff --git a/src/gpu/GrTracing.h b/src/gpu/GrTracing.h
index 3dbc0ef17e..273aa65989 100644
--- a/src/gpu/GrTracing.h
+++ b/src/gpu/GrTracing.h
@@ -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()) {
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index 902dca6d86..9ee27c78dd 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -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;
}
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 17a2d8dfe7..13d4a38e85 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -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);
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrDashingEffect.h b/src/gpu/effects/GrDashingEffect.h
index 7d0d006f1b..eaa0d0d5b5 100644
--- a/src/gpu/effects/GrDashingEffect.h
+++ b/src/gpu/effects/GrDashingEffect.h
@@ -14,15 +14,16 @@
#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);
}
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 9cdd891b15..1a77810306 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -6,8 +6,8 @@
*/
#include "GrAtlasTextContext.h"
+#include "GrContext.h"
#include "GrDrawContext.h"
-#include "GrDrawTarget.h"
#include "GrTextBlobCache.h"
#include "GrTextUtils.h"
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 52281b2bbe..12b3f2f877 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -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"
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.h b/src/gpu/text/GrStencilAndCoverTextContext.h
index 892e279f59..b1faba11b0 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.h
+++ b/src/gpu/text/GrStencilAndCoverTextContext.h
@@ -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"