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

Unified Diff: src/gpu/GrAARectRenderer.cpp

Issue 14890021: Remove isIRect "optimization" & defer computation of device Rect in AA rect rendering (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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 | « include/gpu/GrAARectRenderer.h ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAARectRenderer.cpp
===================================================================
--- src/gpu/GrAARectRenderer.cpp (revision 9079)
+++ src/gpu/GrAARectRenderer.cpp (working copy)
@@ -364,7 +364,6 @@
GrDrawTarget* target,
const GrRect& rect,
const SkMatrix& combinedMatrix,
- const GrRect& devRect,
bool useVertexCoverage) {
GrDrawState* drawState = target->drawState();
@@ -389,6 +388,9 @@
GrPoint* fan0Pos = reinterpret_cast<GrPoint*>(verts);
GrPoint* fan1Pos = reinterpret_cast<GrPoint*>(verts + 4 * vsize);
+ SkRect devRect;
+ combinedMatrix.mapRect(&devRect, rect);
+
if (combinedMatrix.rectStaysRect()) {
set_inset_fan(fan0Pos, vsize, devRect, -SK_ScalarHalf, -SK_ScalarHalf);
set_inset_fan(fan1Pos, vsize, devRect, SK_ScalarHalf, SK_ScalarHalf);
@@ -616,16 +618,20 @@
void GrAARectRenderer::strokeAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& devRect,
+ const GrRect& rect,
+ const SkMatrix& combinedMatrix,
const GrVec& devStrokeSize,
bool useVertexCoverage) {
GrDrawState* drawState = target->drawState();
- const SkScalar& dx = devStrokeSize.fX;
- const SkScalar& dy = devStrokeSize.fY;
+ const SkScalar dx = devStrokeSize.fX;
+ const SkScalar dy = devStrokeSize.fY;
const SkScalar rx = SkScalarMul(dx, SK_ScalarHalf);
const SkScalar ry = SkScalarMul(dy, SK_ScalarHalf);
+ SkRect devRect;
+ combinedMatrix.mapRect(&devRect, rect);
+
SkScalar spare;
{
SkScalar w = devRect.width() - dx;
@@ -634,9 +640,8 @@
}
if (spare <= 0) {
- GrRect r(devRect);
- r.inset(-rx, -ry);
- this->fillAARect(gpu, target, r, SkMatrix::I(), r, useVertexCoverage);
+ devRect.inset(-rx, -ry);
+ this->fillAARect(gpu, target, devRect, SkMatrix::I(), useVertexCoverage);
return;
}
« no previous file with comments | « include/gpu/GrAARectRenderer.h ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698