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

Unified Diff: src/gpu/GrAARectRenderer.cpp

Issue 14798007: Further defer devRect computation in gpu rect drawing (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 | « no previous file | no next file » | 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 9089)
+++ src/gpu/GrAARectRenderer.cpp (working copy)
@@ -388,10 +388,10 @@
GrPoint* fan0Pos = reinterpret_cast<GrPoint*>(verts);
GrPoint* fan1Pos = reinterpret_cast<GrPoint*>(verts + 4 * vsize);
- SkRect devRect;
- combinedMatrix.mapRect(&devRect, rect);
+ if (combinedMatrix.rectStaysRect()) {
+ 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);
} else {
@@ -406,10 +406,14 @@
vec[1].normalize();
vec[1].scale(SK_ScalarHalf);
+ // create the rotated rect
fan0Pos->setRectFan(rect.fLeft, rect.fTop,
rect.fRight, rect.fBottom, vsize);
combinedMatrix.mapPointsWithStride(fan0Pos, vsize, 4);
+ // Now create the inset points and then outset the original
+ // rotated points
+
// TL
*((SkPoint*)((intptr_t)fan1Pos + 0 * vsize)) =
*((SkPoint*)((intptr_t)fan0Pos + 0 * vsize)) + vec[0] + vec[1];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698