diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-10 14:09:54 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-10 14:09:54 +0000 |
commit | 91b7116a10c1c0922493ce335daaa8e606661de0 (patch) | |
tree | ce54d7103a356be4490bd7896771b0b0ff64d8cf /src | |
parent | 114eb9e69942c11635380284deb9cc91eaab3632 (diff) |
Further defer devRect computation in gpu rect drawing
https://codereview.chromium.org/14798007/
git-svn-id: http://skia.googlecode.com/svn/trunk@9090 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrAARectRenderer.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp index cae3b6f5d6..f9ed13f872 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -388,10 +388,10 @@ void GrAARectRenderer::geometryFillAARect(GrGpu* gpu, 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); + 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 @@ void GrAARectRenderer::geometryFillAARect(GrGpu* gpu, 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]; |