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

Unified Diff: src/gpu/GrAARectRenderer.cpp

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak Created 5 years, 8 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/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAARectRenderer.cpp
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 569466f23793d70d4cbef373705e2e3ff591dc31..5cd112d3f12e1dcd6201754e0af3b05de449313f 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -186,6 +186,8 @@ private:
: fIndexBuffer(indexBuffer) {
this->initClassID<AAFillRectBatch>();
fGeoData.push_back(geometry);
+
+ this->setBounds(geometry.fDevRect);
}
GrColor color() const { return fBatch.fColor; }
@@ -216,6 +218,7 @@ private:
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
@@ -476,7 +479,7 @@ void GrAARectRenderer::geometryFillAARect(GrDrawTarget* target,
geometry.fColor = color;
SkAutoTUnref<GrBatch> batch(AAFillRectBatch::Create(geometry, fAAFillRectIndexBuffer));
- target->drawBatch(pipelineBuilder, batch, &devRect);
+ target->drawBatch(pipelineBuilder, batch);
}
void GrAARectRenderer::strokeAARect(GrDrawTarget* target,
@@ -501,14 +504,6 @@ void GrAARectRenderer::strokeAARect(GrDrawTarget* target,
const SkScalar rx = SkScalarMul(dx, SK_ScalarHalf);
const SkScalar ry = SkScalarMul(dy, SK_ScalarHalf);
- // Temporarily #if'ed out. We don't want to pass in the devRect but
- // right now it is computed in GrContext::apply_aa_to_rect and we don't
- // want to throw away the work
-#if 0
- SkRect devRect;
- combinedMatrix.mapRect(&devRect, rect);
-#endif
-
SkScalar spare;
{
SkScalar w = devRect.width() - dx;
@@ -693,6 +688,11 @@ private:
this->initClassID<AAStrokeRectBatch>();
fBatch.fViewMatrix = viewMatrix;
fGeoData.push_back(geometry);
+
+ // If we have miterstroke then we inset devOutside and outset devOutsideAssist, so we need
+ // the join for proper bounds
+ fBounds = geometry.fDevOutside;
+ fBounds.join(geometry.fDevOutsideAssist);
}
GrColor color() const { return fBatch.fColor; }
@@ -727,6 +727,7 @@ private:
fBatch.fColor = GrColor_ILLEGAL;
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698