Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: src/gpu/GrSoftwarePathRenderer.cpp

Issue 2126083002: Remove fColor from PathRenderer DrawPathArgs struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary GrPaint::setColor calls Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrSoftwarePathRenderer.h ('k') | src/gpu/batches/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSoftwarePathRenderer.cpp
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 45a4b78b18614dff6e2ebc6bde24a61c7ad4843c..54d4851b1c092972a652071766f1cbbecd5232df 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -62,27 +62,26 @@ bool get_shape_and_clip_bounds(int width, int height,
}
void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext,
- const GrPaint* paint,
+ const GrPaint& paint,
const GrUserStencilSettings* userStencilSettings,
const GrClip& clip,
- GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, viewMatrix, rect,
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
+ viewMatrix, rect,
nullptr, &localMatrix));
- GrPipelineBuilder pipelineBuilder(*paint, drawContext->mustUseHWAA(*paint));
+ GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
pipelineBuilder.setUserStencil(userStencilSettings);
drawContext->drawBatch(pipelineBuilder, clip, batch);
}
void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext,
- const GrPaint* paint,
+ const GrPaint& paint,
const GrUserStencilSettings* userStencilSettings,
const GrClip& clip,
- GrColor color,
const SkMatrix& viewMatrix,
const SkIRect& devClipBounds,
const SkIRect& devPathBounds) {
@@ -95,25 +94,25 @@ void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext,
if (devClipBounds.fTop < devPathBounds.fTop) {
rect.iset(devClipBounds.fLeft, devClipBounds.fTop,
devClipBounds.fRight, devPathBounds.fTop);
- DrawNonAARect(drawContext, paint, userStencilSettings, clip, color,
+ DrawNonAARect(drawContext, paint, userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
if (devClipBounds.fLeft < devPathBounds.fLeft) {
rect.iset(devClipBounds.fLeft, devPathBounds.fTop,
devPathBounds.fLeft, devPathBounds.fBottom);
- DrawNonAARect(drawContext, paint, userStencilSettings, clip, color,
+ DrawNonAARect(drawContext, paint, userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
if (devClipBounds.fRight > devPathBounds.fRight) {
rect.iset(devPathBounds.fRight, devPathBounds.fTop,
devClipBounds.fRight, devPathBounds.fBottom);
- DrawNonAARect(drawContext, paint, userStencilSettings, clip, color,
+ DrawNonAARect(drawContext, paint, userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
if (devClipBounds.fBottom > devPathBounds.fBottom) {
rect.iset(devClipBounds.fLeft, devPathBounds.fBottom,
devClipBounds.fRight, devClipBounds.fBottom);
- DrawNonAARect(drawContext, paint, userStencilSettings, clip, color,
+ DrawNonAARect(drawContext, paint, userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
}
@@ -138,8 +137,8 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
*args.fClip, *args.fShape,
*args.fViewMatrix, &devShapeBounds, &devClipBounds)) {
if (inverseFilled) {
- DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSettings,
- *args.fClip, args.fColor,
+ DrawAroundInvPath(args.fDrawContext, *args.fPaint, args.fUserStencilSettings,
+ *args.fClip,
*args.fViewMatrix, devClipBounds, devShapeBounds);
}
@@ -153,14 +152,14 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
return false;
}
- GrSWMaskHelper::DrawToTargetWithShapeMask(texture, args.fDrawContext, args.fPaint,
+ GrSWMaskHelper::DrawToTargetWithShapeMask(texture, args.fDrawContext, *args.fPaint,
args.fUserStencilSettings,
- *args.fClip, args.fColor, *args.fViewMatrix,
+ *args.fClip, *args.fViewMatrix,
devShapeBounds);
if (inverseFilled) {
- DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSettings,
- *args.fClip, args.fColor,
+ DrawAroundInvPath(args.fDrawContext, *args.fPaint, args.fUserStencilSettings,
+ *args.fClip,
*args.fViewMatrix, devClipBounds, devShapeBounds);
}
« no previous file with comments | « src/gpu/GrSoftwarePathRenderer.h ('k') | src/gpu/batches/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698