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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 13222004: Trim the copy of the dst made for dst-reading effects using the clip and dev-bounds of draw. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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/GrDrawTarget.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
===================================================================
--- src/gpu/GrOvalRenderer.cpp (revision 8451)
+++ src/gpu/GrOvalRenderer.cpp (working copy)
@@ -136,24 +136,21 @@
verts[i].fInnerRadius = innerRadius - 0.5f;
}
- SkScalar L = -outerRadius;
- SkScalar R = +outerRadius;
- SkScalar T = -outerRadius;
- SkScalar B = +outerRadius;
-
// We've extended the outer radius out half a pixel to antialias.
// Expand the drawn rect here so all the pixels will be captured.
- L += center.fX - SK_ScalarHalf;
- R += center.fX + SK_ScalarHalf;
- T += center.fY - SK_ScalarHalf;
- B += center.fY + SK_ScalarHalf;
+ SkRect bounds = SkRect::MakeLTRB(
+ center.fX - outerRadius - SK_ScalarHalf,
+ center.fY - outerRadius - SK_ScalarHalf,
+ center.fX + outerRadius + SK_ScalarHalf,
+ center.fY + outerRadius + SK_ScalarHalf
+ );
- verts[0].fPos = SkPoint::Make(L, T);
- verts[1].fPos = SkPoint::Make(R, T);
- verts[2].fPos = SkPoint::Make(L, B);
- verts[3].fPos = SkPoint::Make(R, B);
+ verts[0].fPos = SkPoint::Make(bounds.fLeft, bounds.fTop);
+ verts[1].fPos = SkPoint::Make(bounds.fRight, bounds.fTop);
+ verts[2].fPos = SkPoint::Make(bounds.fLeft, bounds.fBottom);
+ verts[3].fPos = SkPoint::Make(bounds.fRight, bounds.fBottom);
- target->drawNonIndexed(kTriangleStrip_GrPrimitiveType, 0, 4);
+ target->drawNonIndexed(kTriangleStrip_GrPrimitiveType, 0, 4, &bounds);
}
void GrOvalRenderer::drawEllipse(GrDrawTarget* target,
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698