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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1227153003: Remove setFromPaint from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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/GrAtlasTextContext.cpp ('k') | src/gpu/GrPipelineBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index b957b9124e88f492c1d02deaf7665244300ea976..5e950dc15215525db664a436994a48b79ba77a70 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -187,11 +187,11 @@ void GrDrawContext::drawPaint(GrRenderTarget* rt,
}
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(*paint, rt, clip);
fDrawTarget->drawBWRect(&pipelineBuilder,
paint->getColor(),
SkMatrix::I(),
@@ -435,11 +435,12 @@ void GrDrawContext::drawRect(GrRenderTarget* rt,
}
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
+
SkScalar width = NULL == strokeInfo ? -1 : strokeInfo->getWidth();
// Check if this is a full RT draw and can be replaced with a clear. We don't bother checking
@@ -536,11 +537,11 @@ void GrDrawContext::drawNonAARectToRect(GrRenderTarget* rt,
const SkMatrix* localMatrix) {
RETURN_IF_ABANDONED
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
fDrawTarget->drawBWRect(&pipelineBuilder,
paint.getColor(),
viewMatrix,
@@ -832,12 +833,12 @@ void GrDrawContext::drawVertices(GrRenderTarget* rt,
int indexCount) {
RETURN_IF_ABANDONED
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
-
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
+
// TODO clients should give us bounds
SkRect bounds;
if (!bounds.setBoundsCheck(positions, vertexCount)) {
@@ -885,11 +886,11 @@ void GrDrawContext::drawRRect(GrRenderTarget*rt,
}
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
GrColor color = paint.getColor();
if (!GrOvalRenderer::DrawRRect(fDrawTarget,
&pipelineBuilder,
@@ -920,11 +921,11 @@ void GrDrawContext::drawDRRect(GrRenderTarget* rt,
}
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
GrColor color = paint.getColor();
if (!GrOvalRenderer::DrawDRRect(fDrawTarget,
&pipelineBuilder,
@@ -967,11 +968,11 @@ void GrDrawContext::drawOval(GrRenderTarget* rt,
}
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
GrColor color = paint.getColor();
if (!GrOvalRenderer::DrawOval(fDrawTarget,
&pipelineBuilder,
@@ -1063,11 +1064,11 @@ void GrDrawContext::drawPath(GrRenderTarget* rt,
// the writePixels that uploads to the scratch will perform a flush so we're
// OK.
AutoCheckFlush acf(fContext);
- GrPipelineBuilder pipelineBuilder;
- if (!this->prepareToDraw(&pipelineBuilder, rt, clip, &paint)) {
+ if (!this->prepareToDraw(rt)) {
return;
}
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
if (!strokeInfo.isDashed()) {
bool useCoverageAA = paint.isAntiAlias() &&
!pipelineBuilder.getRenderTarget()->isUnifiedMultisampled();
@@ -1182,18 +1183,6 @@ void GrDrawContext::internalDrawPath(GrDrawTarget* target,
pr->drawPath(target, pipelineBuilder, color, viewMatrix, *pathPtr, *strokeInfoPtr, useCoverageAA);
}
-bool GrDrawContext::prepareToDraw(GrPipelineBuilder* pipelineBuilder,
- GrRenderTarget* rt,
- const GrClip& clip,
- const GrPaint* paint) {
- RETURN_FALSE_IF_ABANDONED
-
- ASSERT_OWNED_RESOURCE(rt);
- SkASSERT(rt && paint);
- pipelineBuilder->setFromPaint(*paint, rt, clip);
- return true;
-}
-
bool GrDrawContext::prepareToDraw(GrRenderTarget* rt) {
RETURN_FALSE_IF_ABANDONED
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrPipelineBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698