aboutsummaryrefslogtreecommitdiff
path: root/gn
diff options
context:
space:
mode:
authorMichael Ludwig <michaelludwig@google.com>2019-01-08 15:46:15 -0500
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2019-01-08 21:36:31 +0000
commitc96fc37f230a0732b9c378387d9c371b9851e470 (patch)
tree371d783877b0e7960d35b7aa87e7c829a0a88e60 /gn
parenta870b46c79517009330456bb4d5b6e6f4f7ab7b7 (diff)
downloadskqp-c96fc37f230a0732b9c378387d9c371b9851e470.tar.gz
Reland "Use specialized quad lists in rectangle ops"
This is a reland of 5820b0c3f3ceba23b9d80415e77a9db124b409b8 It is updated in patchset 2 to clean up pointers passed into memcpy, and to optimize the bounds calculation in GrPerspQuad. This should fix a performance regression caused by the move away from caching 1/w. The Sk4f::invert() does not always preserve 1/1 == 1, which led to bounds slightly outside of clips and thus forced Skia to keep the scissor test enabled. The fix also restores the optimization of skipping the 1/w division when the quad is known to be 2D. Original change's description: > Use specialized quad lists in rectangle ops > > Hopefully reduces memory footprint of GrFillRectOp and GrTextureOp > > The original rect code (GrAAFillRectOp) stored 2 SkMatrices (18 floats), 2 > SkRects (8 floats) an SkPMColor4f (4 floats) and a flag (1 int) for a total > of 124 bytes per quad that was stored in the op. > > The first pass at the rectangle consolidation switched to storing device and > local quads as GrPerspQuads (32 floats), an SkPMColor4f (4 floats) and a flag > (1 int) for a total of 148 bytes per quad. After landing, several memory > regressions appeared in Chrome and our perf monitor. > > Several intertwined approaches are taken here. First, GrPerspQuad no longer > caches 1/w, which makes a quad 12 floats instead of 16. Second, a specialized > list type is defined that allows storing the x, y, and extra metadata together > for quads, but keeps the w components separate. When the quad type isn't > perspective, w is not stored at all since it is implicitly 1 and can be > reconstituted at tessellation time. This brings the total per quad to either > 84 or 116 bytes, depending on if the op list needs perspective information. > > Bug: chromium:915025 > Bug: chromium:917242 > Change-Id: If37ee122847b0c32604bb45dc2a1326b544f9cf6 > Reviewed-on: https://skia-review.googlesource.com/c/180644 > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> Bug: chromium:915025, chromium:917242 Change-Id: I98a1bf83fd7d393604823d567c57d7e06fad5e55 Reviewed-on: https://skia-review.googlesource.com/c/182203 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'gn')
-rw-r--r--gn/tests.gni1
1 files changed, 1 insertions, 0 deletions
diff --git a/gn/tests.gni b/gn/tests.gni
index 351efaee0b..27a4448ff1 100644
--- a/gn/tests.gni
+++ b/gn/tests.gni
@@ -101,6 +101,7 @@ tests_sources = [
"$_tests/GrOpListFlushTest.cpp",
"$_tests/GrPipelineDynamicStateTest.cpp",
"$_tests/GrPorterDuffTest.cpp",
+ "$_tests/GrQuadListTest.cpp",
"$_tests/GrShapeTest.cpp",
"$_tests/GrSKSLPrettyPrintTest.cpp",
"$_tests/GrSurfaceTest.cpp",