aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrClipMaskManager.cpp14
-rw-r--r--src/gpu/GrContext.cpp5
-rw-r--r--src/gpu/GrDrawContext.cpp19
-rw-r--r--src/gpu/GrPathRendererChain.cpp4
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp5
5 files changed, 21 insertions, 26 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index e0a85d184d..b57f3cc1bc 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -47,7 +47,6 @@ static const GrFragmentProcessor* create_fp_for_mask(GrTexture* result, const Sk
}
static bool path_needs_SW_renderer(GrContext* context,
- const GrDrawTarget* gpu,
const GrPipelineBuilder& pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& origPath,
@@ -63,8 +62,8 @@ static bool path_needs_SW_renderer(GrContext* context,
GrPathRendererChain::kColorAntiAlias_DrawType :
GrPathRendererChain::kColor_DrawType;
- return nullptr == context->getPathRenderer(gpu, &pipelineBuilder, viewMatrix, *path, stroke,
- false, type);
+ return nullptr == context->getPathRenderer(&pipelineBuilder, viewMatrix, *path, stroke,
+ false, type);
}
GrClipMaskManager::GrClipMaskManager(GrDrawTarget* drawTarget)
@@ -99,7 +98,7 @@ bool GrClipMaskManager::useSWOnlyPath(const GrPipelineBuilder& pipelineBuilder,
if (Element::kRect_Type != element->getType()) {
SkPath path;
element->asPath(&path);
- if (path_needs_SW_renderer(this->getContext(), fDrawTarget, pipelineBuilder, translate,
+ if (path_needs_SW_renderer(this->getContext(), pipelineBuilder, translate,
path, stroke, element->isAA())) {
return true;
}
@@ -413,7 +412,7 @@ bool GrClipMaskManager::drawElement(GrPipelineBuilder* pipelineBuilder,
GrPathRendererChain::DrawType type;
type = element->isAA() ? GrPathRendererChain::kColorAntiAlias_DrawType :
GrPathRendererChain::kColor_DrawType;
- pr = this->getContext()->getPathRenderer(fDrawTarget, pipelineBuilder, viewMatrix,
+ pr = this->getContext()->getPathRenderer(pipelineBuilder, viewMatrix,
path, stroke, false, type);
}
if (nullptr == pr) {
@@ -455,7 +454,7 @@ bool GrClipMaskManager::canStencilAndDrawElement(GrPipelineBuilder* pipelineBuil
GrPathRendererChain::DrawType type = element->isAA() ?
GrPathRendererChain::kStencilAndColorAntiAlias_DrawType :
GrPathRendererChain::kStencilAndColor_DrawType;
- *pr = this->getContext()->getPathRenderer(fDrawTarget, pipelineBuilder, SkMatrix::I(), path,
+ *pr = this->getContext()->getPathRenderer(pipelineBuilder, SkMatrix::I(), path,
stroke, false, type);
return SkToBool(*pr);
}
@@ -760,8 +759,7 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt,
if (fillInverted) {
clipPath.toggleInverseFillType();
}
- pr = this->getContext()->getPathRenderer(fDrawTarget,
- &pipelineBuilder,
+ pr = this->getContext()->getPathRenderer(&pipelineBuilder,
viewMatrix,
clipPath,
stroke,
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index fee92fe692..081bc0ac38 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -541,8 +541,7 @@ void GrContext::flushSurfaceWrites(GrSurface* surface) {
* Due to its expense, the software path renderer has split out so it can
* can be individually allowed/disallowed via the "allowSW" boolean.
*/
-GrPathRenderer* GrContext::getPathRenderer(const GrDrawTarget* target,
- const GrPipelineBuilder* pipelineBuilder,
+GrPathRenderer* GrContext::getPathRenderer(const GrPipelineBuilder* pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& path,
const GrStrokeInfo& stroke,
@@ -554,7 +553,7 @@ GrPathRenderer* GrContext::getPathRenderer(const GrDrawTarget* target,
fPathRendererChain = new GrPathRendererChain(this);
}
- GrPathRenderer* pr = fPathRendererChain->getPathRenderer(target,
+ GrPathRenderer* pr = fPathRendererChain->getPathRenderer(this->caps()->shaderCaps(),
pipelineBuilder,
viewMatrix,
path,
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 99a1ce5390..f52d7dcd15 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -461,7 +461,7 @@ void GrDrawContext::drawRRect(const GrClip& clip,
SkPath path;
path.setIsVolatile(true);
path.addRRect(rrect);
- this->internalDrawPath(this->getDrawTarget(), &pipelineBuilder, viewMatrix, color,
+ this->internalDrawPath(&pipelineBuilder, viewMatrix, color,
paint.isAntiAlias(), path, strokeInfo);
}
}
@@ -498,7 +498,7 @@ void GrDrawContext::drawDRRect(const GrClip& clip,
path.setFillType(SkPath::kEvenOdd_FillType);
GrStrokeInfo fillRec(SkStrokeRec::kFill_InitStyle);
- this->internalDrawPath(this->getDrawTarget(), &pipelineBuilder, viewMatrix, color,
+ this->internalDrawPath(&pipelineBuilder, viewMatrix, color,
paint.isAntiAlias(), path, fillRec);
}
}
@@ -540,7 +540,7 @@ void GrDrawContext::drawOval(const GrClip& clip,
SkPath path;
path.setIsVolatile(true);
path.addOval(oval);
- this->internalDrawPath(this->getDrawTarget(), &pipelineBuilder, viewMatrix, color,
+ this->internalDrawPath(&pipelineBuilder, viewMatrix, color,
paint.isAntiAlias(), path, strokeInfo);
}
}
@@ -661,12 +661,11 @@ void GrDrawContext::drawPath(const GrClip& clip,
}
}
}
- this->internalDrawPath(this->getDrawTarget(), &pipelineBuilder, viewMatrix, color,
+ this->internalDrawPath(&pipelineBuilder, viewMatrix, color,
paint.isAntiAlias(), path, strokeInfo);
}
-void GrDrawContext::internalDrawPath(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
+void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder,
const SkMatrix& viewMatrix,
GrColor color,
bool useAA,
@@ -692,7 +691,7 @@ void GrDrawContext::internalDrawPath(GrDrawTarget* target,
const GrStrokeInfo* strokeInfoPtr = &strokeInfo;
// Try a 1st time without stroking the path and without allowing the SW renderer
- GrPathRenderer* pr = fDrawingManager->getContext()->getPathRenderer(target, pipelineBuilder,
+ GrPathRenderer* pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder,
viewMatrix, *pathPtr,
*strokeInfoPtr, false,
type);
@@ -708,7 +707,7 @@ void GrDrawContext::internalDrawPath(GrDrawTarget* target,
return;
}
strokeInfoPtr = &dashlessStrokeInfo;
- pr = fDrawingManager->getContext()->getPathRenderer(target, pipelineBuilder, viewMatrix,
+ pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, viewMatrix,
*pathPtr, *strokeInfoPtr,
false, type);
}
@@ -733,7 +732,7 @@ void GrDrawContext::internalDrawPath(GrDrawTarget* target,
}
// This time, allow SW renderer
- pr = fDrawingManager->getContext()->getPathRenderer(target, pipelineBuilder, viewMatrix,
+ pr = fDrawingManager->getContext()->getPathRenderer(pipelineBuilder, viewMatrix,
*pathPtr, *strokeInfoPtr,
true, type);
}
@@ -746,7 +745,7 @@ void GrDrawContext::internalDrawPath(GrDrawTarget* target,
}
GrPathRenderer::DrawPathArgs args;
- args.fTarget = target;
+ args.fTarget = this->getDrawTarget();
args.fResourceProvider = fDrawingManager->getContext()->resourceProvider();
args.fPipelineBuilder = pipelineBuilder;
args.fColor = color;
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index c2f395cac3..b1eb3202bf 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -39,7 +39,7 @@ GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) {
return pr;
}
-GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target,
+GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderCaps,
const GrPipelineBuilder* pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& path,
@@ -69,7 +69,7 @@ GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target,
for (int i = 0; i < fChain.count(); ++i) {
GrPathRenderer::CanDrawPathArgs args;
- args.fShaderCaps = target->caps()->shaderCaps();
+ args.fShaderCaps = shaderCaps;
args.fPipelineBuilder = pipelineBuilder;
args.fViewMatrix = &viewMatrix;
args.fPath = &path;
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index f54d3b09e6..de833a6e26 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -28,8 +28,7 @@ namespace {
// gets device coord bounds of path (not considering the fill) and clip. The
// path bounds will be a subset of the clip bounds. returns false if
// path bounds would be empty.
-bool get_path_and_clip_bounds(const GrDrawTarget* target,
- const GrPipelineBuilder* pipelineBuilder,
+bool get_path_and_clip_bounds(const GrPipelineBuilder* pipelineBuilder,
const SkPath& path,
const SkMatrix& matrix,
SkIRect* devPathBounds,
@@ -110,7 +109,7 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
}
SkIRect devPathBounds, devClipBounds;
- if (!get_path_and_clip_bounds(args.fTarget, args.fPipelineBuilder, *args.fPath,
+ if (!get_path_and_clip_bounds(args.fPipelineBuilder, *args.fPath,
*args.fViewMatrix, &devPathBounds, &devClipBounds)) {
if (args.fPath->isInverseFillType()) {
draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor,