aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TessellatingPathRendererTests.cpp
Commit message (Collapse)AuthorAge
* GrTessellator: fix for collinear edge merging.Gravatar Stephen White2018-07-26
| | | | | | | | | | | | | | | | In some cases, two edges can be collinear when tested on one side (e.g., left top vs right edge), but non-collinear when tested on the other (e.g., right top vs left edge). We were actually merging based on one criterion, but assserting based on the other. The safest fix is to merge if either condition is true, and then assert that both conditions are false. Bug: 866319 Change-Id: Ia1be330caf62f6d7961746752f73993ca098d0a3 Reviewed-on: https://skia-review.googlesource.com/143501 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: collinear edges during sanitize.Gravatar Stephen White2018-07-16
| | | | | | | | | | | | When three collinear edges occur during the sanitize_contours() pass, their vertices may not yet have been discovered to be coincident. So we must do the vertex comparison by point, rather than by pointer. Bug: 860655 Change-Id: I89dc7526905bb5473206661348fee431371731a0 Reviewed-on: https://skia-review.googlesource.com/141523 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: missing intersection rewind fix.Gravatar Stephen White2018-07-13
| | | | | | | | | | | | | | | Some "missing" intersections (see https://skia.googlesource.com/skia/+/89042d5f13a56d6b663657aa58f17593123a344e) cause the active edge list to go out of order. In that case, we need to rewind the active list, just as we do before edge splitting for regular intersections. BUG=860453 Change-Id: I1f7b32157a73b427a4fd94c14c1eb440f26c0743 Reviewed-on: https://skia-review.googlesource.com/141038 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Deinline some GrPathRenderer method and one GrDrawingMananger method.Gravatar Brian Salomon2018-07-10
| | | | | | | | | | | | | | Removes circular dependencies from coming change. Some IWYU fallout from removing #includes from GrPathRenderer.h and GrDrawingManager.h Bug: skia: Change-Id: Ice377538e6d64b6a74a59e6140e1de9a58ab99bf Reviewed-on: https://skia-review.googlesource.com/140181 Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* GrTessellator: handle three consecutive collinear edges.Gravatar Stephen White2018-07-02
| | | | | | | | | | | | | | | In some cases, splitting may produce three consecutive edges which are collinear. The first one was being merged out, causing the third one to be missed. The fix is to switch the arguments to merge_edges_*, ensuring that the second parameter (the destination edge) is never merged out. Bug: 851409 Change-Id: I65be2e8222846c99f7bc8d17ea61ddead617cc31 Reviewed-on: https://skia-review.googlesource.com/138700 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Revert "GrTessellator: handle three consecutive collinear edges."Gravatar Mike Klein2018-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 26bb0e66f28c41cb1e8e39f00d848997fd33d97c. Reason for revert: segfaulty Here's a log with a stacktrace: https://chromium-swarm.appspot.com/task?id=3e658f7aa40dbb10&refresh=10 Original change's description: > GrTessellator: handle three consecutive collinear edges. > > In some cases, splitting may produce three consecutive edges which > are collinear. The first one was being merged out, causing the third > one to be missed. > > The fix is to switch the arguments to merge_edges_*, ensuring that the > second parameter (the destination edge) is never merged out. > > Bug: 851409. > Change-Id: I70fbbc506e97a26b259c1443b6d1787adec0f9b0 > Reviewed-on: https://skia-review.googlesource.com/138561 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Stephen White <senorblanco@chromium.org> TBR=robertphillips@google.com,senorblanco@chromium.org Change-Id: I6ecfb4c487d6f96e9fae7b8b40d74162354ed57c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 851409. Reviewed-on: https://skia-review.googlesource.com/138640 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* GrTessellator: handle three consecutive collinear edges.Gravatar Stephen White2018-06-29
| | | | | | | | | | | | | | | In some cases, splitting may produce three consecutive edges which are collinear. The first one was being merged out, causing the third one to be missed. The fix is to switch the arguments to merge_edges_*, ensuring that the second parameter (the destination edge) is never merged out. Bug: 851409. Change-Id: I70fbbc506e97a26b259c1443b6d1787adec0f9b0 Reviewed-on: https://skia-review.googlesource.com/138561 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: handle collinear final vertex.Gravatar Stephen White2018-06-28
| | | | | | | | | | | | If the last vertex in a contour is collinear with its neighbours, remove it (this edge case was missing). Otherwise, the simplify step may try to split it indefinitely. Bug: 851409 Change-Id: I7efa4e616cdc1508a73c7a9f3de9d3f571569af8 Reviewed-on: https://skia-review.googlesource.com/138106 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: avoid split with zero primary and out-of-range secondary.Gravatar Stephen White2018-06-22
| | | | | | | | | | | | | | Sometimes the intersector will return an intersection which is on the same primary sort criterion (eg., Y coordinate), but out-of-range on the secondary. We shouldn't do splits in this case. The only case we really care about is if it's less than one epsilon and greater than zero, and thus numerically unsplittable. Bug: 851914 Change-Id: Ia772763b6a66a14ca159cf409a832835244e83bc Reviewed-on: https://skia-review.googlesource.com/136803 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: catch missing intersections.Gravatar Stephen White2018-06-08
| | | | | | | | | | | | | | | Sometimes the intersection check will miss an intersection (because floating point). This can leave the active edge list in an invalid state, where an edge pair is incorrectly ordered. The fix is to test for edge crossings after testing for intersections, and split the edges manually. This extra check may result in a performance hit, so we'll have to watch the perf bots carefully. Bug: 843135 Change-Id: If50320413026be503cdb2d33e6c97f620e4d51a9 Reviewed-on: https://skia-review.googlesource.com/133400 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: yet another out-of-range splitting fix.Gravatar Stephen White2018-06-06
| | | | | | | | | | | | It's actually possible for an intersection to be out-of-range on both the intersected edges (e.g., below both bottom points), because floating point. So we need to clamp against both edges. Bug: 846014 Change-Id: I9fe25a1fcd3b5242af7b1ee36b17f1e968aeb836 Reviewed-on: https://skia-review.googlesource.com/132323 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Remove SK_SUPPORT_GPU checks in tool-only codeGravatar Brian Osman2018-05-31
| | | | | | | | | | | | | | | | Most of this is (obviously) not necessary to do, but once I started, I figured I'd just get it all. Tools (nanobench, DM, skiaserve), all GMs, benches, and unit tests, plus support code (command line parsing and config stuff). This is almost entirely mechanical. Bug: skia: Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb Reviewed-on: https://skia-review.googlesource.com/131153 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* GrTessellator: fix for ping-pong split fuzzer hang.Gravatar Stephen White2018-05-31
| | | | | | | | | | | | | | | | | | When support for out-of-range intersections was added in 3b5a3fa8b1c11d4bd4499b040311f4c3553ebf8c, it was intended to support splitting edges that are almost flat, where merging with the top or bottom vertex would cause visual artifacts. However, it triggers too often for other, non-nearly-flat cases, causing simplify() to loop infinitely. The fix is to support out-of-range intersections only if they differ by 1/2 machine epsilon. This also generalizes the out_of_range_and_collinear() check, so it was removed. Bug: 838978 Change-Id: I238f2b90e4b7ad647ecf072427ee38726e549581 Reviewed-on: https://skia-review.googlesource.com/130458 Reviewed-by: Stephen White <senorblanco@chromium.org>
* Revert "GrTessellator: fix for ping-pong split fuzzer hang."Gravatar Ravi Mistry2018-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bfb2a05af105f452a0f369e39dae05f9224dfa19. Reason for revert: Seems to cause failures in chromeos and chromecast test bots. eg: https://chromium-swarm.appspot.com/task?id=3dc5be8269e3b410&refresh=10 https://chromium-swarm.appspot.com/task?id=3dc5d62dfdc99010&refresh=10 Original change's description: > GrTessellator: fix for ping-pong split fuzzer hang. > > Change 3b5a3fa8b1c11d4bd4499b040311f4c3553ebf8c introduced support for > splitting on out-of-range intersections. However, this is only necessary > for correctness when the edge is nearly-flat (the top and bottom > points only differ by 1/2 machine epsilon in the primary sort criterion). > In other cases, it can cause repeated splitting and re-merging of edges, > as the intersection code (being approximate and not exact) may produce a > ping-pong set of intersections. > > The fix is to support out-of-range intersections only if they differ by > 1/2 machine epsilon. This also generalizes the > out_of_range_and_collinear() check, so it was removed. > > Bug: 838978 > Change-Id: I134f7eff3f15707e0d68de11c55f7fadce4ff8e7 > Reviewed-on: https://skia-review.googlesource.com/130448 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Stephen White <senorblanco@chromium.org> TBR=robertphillips@google.com,senorblanco@chromium.org Change-Id: I3fa62423d3875665397adcecb94b467b9b6611cc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 838978 Reviewed-on: https://skia-review.googlesource.com/130522 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* GrTessellator: fix for ping-pong split fuzzer hang.Gravatar Stephen White2018-05-29
| | | | | | | | | | | | | | | | | | | | Change 3b5a3fa8b1c11d4bd4499b040311f4c3553ebf8c introduced support for splitting on out-of-range intersections. However, this is only necessary for correctness when the edge is nearly-flat (the top and bottom points only differ by 1/2 machine epsilon in the primary sort criterion). In other cases, it can cause repeated splitting and re-merging of edges, as the intersection code (being approximate and not exact) may produce a ping-pong set of intersections. The fix is to support out-of-range intersections only if they differ by 1/2 machine epsilon. This also generalizes the out_of_range_and_collinear() check, so it was removed. Bug: 838978 Change-Id: I134f7eff3f15707e0d68de11c55f7fadce4ff8e7 Reviewed-on: https://skia-review.googlesource.com/130448 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: fix crash on merging a dead edge.Gravatar Stephen White2018-05-22
| | | | | | | | | | | | | | | | | | When merging coincident vertices, sometimes merging an edge will cause the next edge in the list to die. But since merge_vertices() retrieves the next edge before merging the current one, we then try to merge its lifeless corpse, bringing it back as a zombie. The fix is to leave dead edges, dead. This was revealed by ec79c39a770205910f0abd762de7e19a96c986ca, but was likely a real bug that was being mishandled before that. Bug: 844873 Bug: skia:7982 Change-Id: I752c45f7551df4278fa4cb4587e7ead48cd16a21 Reviewed-on: https://skia-review.googlesource.com/129524 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* GrTessellator: fix for zombie edge fuzzer crash.Gravatar Stephen White2018-05-18
| | | | | | | | | | | | | | | | While splitting one edge, merge_collinear_edges() may in rare cases merge the other edge of the intersection out of existence. split_edge() then brings these dead edges partially back to life, leaving the mesh in an inconsistent state. The fix is to null out the top and bottom pointers of dead edges to mark them as dead, and only split living edges. Bug: skia:7911 Change-Id: I1c0b59581acfcd0b8191f2d129b33f7d0d1a2516 Reviewed-on: https://skia-review.googlesource.com/129181 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Reland "Fix handling of MaskFilter matrices"Gravatar Florin Malita2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c64ee20e135a336ed775ccb6dec8a87efd19ec02. Reason for revert: initial failures should be fixed in https://skia.googlesource.com/skia.git/+/8eaf64ae12696d4189d3cea9f023658494cf82b8 Original change's description: > Revert "Fix handling of MaskFilter matrices" > > This reverts commit 2097fd03ffea48bd904c48c93348b2350600870e. > > Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix) > > Original change's description: > > Fix handling of MaskFilter matrices > > > > 1) extend GrFPArgs to track pre/post local matrices, add helpers for > > creating pre/post wrapper args > > > > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM > > sandwich logic. > > > > 3) update call sites to use the above > > > > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to > > disambiguate vs. SkShader::makeWithLocalMatrix. > > > > BUG=skia:7744 > > > > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 > > Reviewed-on: https://skia-review.googlesource.com/119330 > > Commit-Queue: Florin Malita <fmalita@chromium.org> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com > > Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7744 > Reviewed-on: https://skia-review.googlesource.com/120340 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: If194862a928d1abe22ed8fa968436c725d19a8fc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7744 Reviewed-on: https://skia-review.googlesource.com/120480 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Revert "Fix handling of MaskFilter matrices"Gravatar Robert Phillips2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2097fd03ffea48bd904c48c93348b2350600870e. Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix) Original change's description: > Fix handling of MaskFilter matrices > > 1) extend GrFPArgs to track pre/post local matrices, add helpers for > creating pre/post wrapper args > > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM > sandwich logic. > > 3) update call sites to use the above > > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to > disambiguate vs. SkShader::makeWithLocalMatrix. > > BUG=skia:7744 > > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 > Reviewed-on: https://skia-review.googlesource.com/119330 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7744 Reviewed-on: https://skia-review.googlesource.com/120340 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix handling of MaskFilter matricesGravatar Florin Malita2018-04-11
| | | | | | | | | | | | | | | | | | | | 1) extend GrFPArgs to track pre/post local matrices, add helpers for creating pre/post wrapper args 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM sandwich logic. 3) update call sites to use the above 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to disambiguate vs. SkShader::makeWithLocalMatrix. BUG=skia:7744 Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 Reviewed-on: https://skia-review.googlesource.com/119330 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
* GrTessellator: fix for points that become infinite on stroking.Gravatar Stephen White2018-04-03
| | | | | | | | | | | stroke -> Inf -> NaN -> assert. BUG=skia:7775 Change-Id: I086883bce90d1d473cff87f67e954718ea3181f6 Reviewed-on: https://skia-review.googlesource.com/118145 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Reland "GrTessellator: hang fix."Gravatar Stephen White2018-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of 050c86768a2c24c62655f53ef9b685d40477eccb Original change's description: > GrTessellator: hang fix. > > Some edges are not coincident with their own endpoints (because floating > point). If this happens for an edge which is a right-enclosing-edge > during the Bentley-Ottman simplify() pass, we end up an infinite loop > attempting to split the edge, since the edge is never to the right of its > endpoint. > > The easiest fix is to simply remove the right-enclosing-edge splitting > code. This code was originally added before we had proper > active-edge-list rewinding, and should no longer be necessary. > > BUG=802896 > > Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827 > Reviewed-on: https://skia-review.googlesource.com/116920 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Stephen White <senorblanco@chromium.org> Bug: 802896 Change-Id: I3e48346a8a358ae7d481299a586003e817a519ca Reviewed-on: https://skia-review.googlesource.com/117121 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "GrTessellator: hang fix."Gravatar Mike Klein2018-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 050c86768a2c24c62655f53ef9b685d40477eccb. Reason for revert: layout test diff in Chrome roll? Original change's description: > GrTessellator: hang fix. > > Some edges are not coincident with their own endpoints (because floating > point). If this happens for an edge which is a right-enclosing-edge > during the Bentley-Ottman simplify() pass, we end up an infinite loop > attempting to split the edge, since the edge is never to the right of its > endpoint. > > The easiest fix is to simply remove the right-enclosing-edge splitting > code. This code was originally added before we had proper > active-edge-list rewinding, and should no longer be necessary. > > BUG=802896 > > Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827 > Reviewed-on: https://skia-review.googlesource.com/116920 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Stephen White <senorblanco@chromium.org> TBR=robertphillips@google.com,senorblanco@chromium.org Change-Id: Icb928db6c052a21c6d327da9492cb991f769186f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 802896 Reviewed-on: https://skia-review.googlesource.com/117120 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* GrTessellator: hang fix.Gravatar Stephen White2018-03-28
| | | | | | | | | | | | | | | | | | | Some edges are not coincident with their own endpoints (because floating point). If this happens for an edge which is a right-enclosing-edge during the Bentley-Ottman simplify() pass, we end up an infinite loop attempting to split the edge, since the edge is never to the right of its endpoint. The easiest fix is to simply remove the right-enclosing-edge splitting code. This code was originally added before we had proper active-edge-list rewinding, and should no longer be necessary. BUG=802896 Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827 Reviewed-on: https://skia-review.googlesource.com/116920 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Move internal calls from GrContext to GrContextPrivGravatar Robert Phillips2018-03-06
| | | | | | | | | | A mechanical bulk move just to get these out of the public API. TBR=bsalomon@google.com Change-Id: I813efbd54a09dd448275697c0e50947753a5cfd3 Reviewed-on: https://skia-review.googlesource.com/112262 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Fix unit tests that were causes vulkan unitialized memory warnings in validationGravatar Greg Daniel2018-02-27
| | | | | | | | Bug: skia: Change-Id: Id9df92b76c9f948f41f4108bcecdb2687233f841 Reviewed-on: https://skia-review.googlesource.com/110761 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | sample counts in GPU backend."""""" This reverts commit 3a2cc2c2ec124de36d2544b2a523ef1dd317ca32. Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab Reviewed-on: https://skia-review.googlesource.com/103181 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | counts in GPU backend.""""" This reverts commit 5bb82cbecd740d21b92e8d2944280ab6eb6af7a6. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""" > > This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. > > Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" > > > Bug: skia: > Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 > Reviewed-on: https://skia-review.googlesource.com/102940 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/103220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU ↵Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | backend."""" This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" Bug: skia: Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 Reviewed-on: https://skia-review.googlesource.com/102940 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | | | | | | This reverts commit d0d7270fcc32546005b8e847df516cb11592cd30. Revert "More sample count cleanup:" This reverts commit d653cac70ed17983125ceed053138c09f1401846. Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types" This reverts commit 85ae7159c9c8a9186a4c7e74304eabb35bca9a79. Need to understand NVPR perf changes before relanding Change-Id: I0db075fb42438ef2a1f9885df184dce52892ac4b Reviewed-on: https://skia-review.googlesource.com/102780 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Redefine the meaning of sample counts in GPU backend.""Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | Fixes gpu config default samples to be 1 and updates config parsing test accordingly. This reverts commit c1ce2f7966babaae0deb150f93f1227ee5af9285. Bug: skia: Change-Id: I456973b1f52ced85a2011ea10fc49449bfc5846f Reviewed-on: https://skia-review.googlesource.com/102147 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Redefine the meaning of sample counts in GPU backend."Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48825b11ad25c98b9a4884d5cc0edd4e290c4409. Reason for revert: nanobench Original change's description: > Redefine the meaning of sample counts in GPU backend. > > Old: 0 -> nonMSAA > 1+ -> MSAA > > New: > 0 -> error/unsupported > 1 -> nonMSAA > 2+ -> MSAA > > We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility: > > 1) SkSurface factories > 2) GrBackendRenderTarget constructors > 3) GrCaps::getSampleCnt()'s requestedCount parameter > > However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally. > > This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case. > > > Bug: skia: > Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33 > Reviewed-on: https://skia-review.googlesource.com/101560 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Ic257619a8a5ee9ac15419ecf10259e42daed7f82 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/102662 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Redefine the meaning of sample counts in GPU backend.Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | Old: 0 -> nonMSAA 1+ -> MSAA New: 0 -> error/unsupported 1 -> nonMSAA 2+ -> MSAA We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility: 1) SkSurface factories 2) GrBackendRenderTarget constructors 3) GrCaps::getSampleCnt()'s requestedCount parameter However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally. This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case. Bug: skia: Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33 Reviewed-on: https://skia-review.googlesource.com/101560 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* rename inner AsFPArgs to stand-alone GrFPArgsGravatar Mike Reed2018-01-19
| | | | | | | | | | This prepares us to share this with other effects (most notably maskfilters) Bug: skia: Change-Id: I12530fdf10c4e5f2a9ab6d394bf9e87c54ea60c4 Reviewed-on: https://skia-review.googlesource.com/97062 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* GrTessellator: set a cap on quadratic linearization.Gravatar Stephen White2018-01-09
| | | | | | | | | | | | | | | Some pathological cases don't converge to a reasonable number of points when using uniform linearization of quadratic points. Cap them to the maximum which GrPathUtils supports. Add reduced test case from crbug-762369. BUG=762369 Change-Id: Icc744018e5c01a0e0fe2ec00613bdb25e49614e9 Reviewed-on: https://skia-review.googlesource.com/92721 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: fix for assert on bevelling.Gravatar Stephen White2018-01-05
| | | | | | | | | | | | With some large values, intersection for bevelling will fail. These should just skip the point, not assert. BUG=798912 Change-Id: Ie5c8cc3c9387055e1e31480321a231f0e6ff153b Reviewed-on: https://skia-review.googlesource.com/91141 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: fix for points which become non-finite on AA stroking.Gravatar Stephen White2018-01-04
| | | | | | | | | | | | | If input points are near-infinite, they may become inf or NaN when stroked. Before converting the results of intersection from double to float, clamp them to the [-FLT_MAX/FLT_MAX] range. BUG=798679 Change-Id: I7d61130dd26147a9b7cfd38aa96567e3867b5c3e Reviewed-on: https://skia-review.googlesource.com/90983 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* GrTessellator: implement straight skeleton, phase 2.Gravatar Stephen White2017-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL implements two major changes to the AA tessellating path renderer: 1) Fix inverted edges after stroke and simplify. Instead of detecting and fixing edges which invert on stroking during the stroking pass, we run the full simplify pass on both inner and outer contours, then create edge collapse events for the overlap regions. We then process the edge events in a priority queue and process them in order of decreasing alpha (this is the "edge event" part of the straight skeleton algorithm). By doing it after simplification, we ensure that there's a full-alpha intersection vertex to join the collapse edge to (which may have <1 alpha), so no spurious gradients appear in the rendered path. 2) "Pointy" vertices (defined as those which meet at an acute angle less than 14 degrees) are now properly bevelled off during stroking. This removes antialiasing artifacts which extend beyond the path boundary. Some ancillary changes: The extracted boundaries which are input to stroking have their line equations pre-normalized, and multiplied by winding. This simplifies a lot of code which was performing this computation on the fly. The workaround for the "intruding vertex" problem was removed, since the straight skeleton now moves the intruding vertex before it can cause problems. Bug: 756823 Change-Id: I271ed32be6847da55273b387e8c04bbf9b512b70 Reviewed-on: https://skia-review.googlesource.com/87341 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Have mip status match surface when snapping image from wrapped objectGravatar Greg Daniel2017-10-30
| | | | | | | | | | Also fixes some bugs involved with creating mipped SkSurfaces. Bug: skia: Change-Id: I6e0109000eadd2bdee4a907d3ee2231104528165 Reviewed-on: https://skia-review.googlesource.com/65063 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.Gravatar Brian Salomon2017-10-25
| | | | | | | | | | | | | | Also to SkColorTo(Premul|Unpremul)GrColor4f. This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup. Also uses GrColorSpaceInfo to construct GrTextUtils::Paint. Bug: skia: Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d Reviewed-on: https://skia-review.googlesource.com/63660 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Improve heuristics for when to use ccprGravatar Chris Dalton2017-09-12
| | | | | | | | | | | | | Gives the convex and tessellating renderers first claim on larger paths, and the distance field renderer first claim on complex, non-volatile paths. This also requires plumbing the clip bounds through GrPathRenderer::CanDrawPathArgs. Bug: skia: Change-Id: I16e1d35ad5ee63251e33f113b1579cbba60456da Reviewed-on: https://skia-review.googlesource.com/42224 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Add support for vkCmdCopyBufferGravatar Greg Daniel2017-08-25
| | | | | | | | | | | | This is then used when need to update GPU only buffers with data of size greater than 65536. We create a temporary transfer buffer and then copy that buffer into our GPU buffer. Bug: skia: Change-Id: I4bb9cb660f2ac1ccbbd1b508bb4ca6876342136f Reviewed-on: https://skia-review.googlesource.com/38725 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* GrTessellator: when sanitizing contours, remove non-finite points.Gravatar Stephen White2017-08-23
| | | | | | | | | | | | NaNs can't be correctly sorted. Don't run the unit test on VK backend, since it requires large (>64K bytes) vertex buffer uploads. Bug: 757650 Change-Id: I667693f135a090a5d9076bb7a2ec6879fc06d645 Reviewed-on: https://skia-review.googlesource.com/37484 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "GrTessellator: when sanitizing contours, remove non-finite points."Gravatar Robert Phillips2017-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 620cc248517a509040d3f94f29710edf3a151c5b. Reason for revert: Breaking the Vulkan bots Original change's description: > GrTessellator: when sanitizing contours, remove non-finite points. > > NaNs can't be correctly sorted. > > Bug: 757650 > Change-Id: Id1ca2fe1d1de7884da2a64ceef9491b1da7e8e77 > Reviewed-on: https://skia-review.googlesource.com/37220 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Stephen White <senorblanco@chromium.org> TBR=bsalomon@google.com,senorblanco@chromium.org Change-Id: I64d5c35801f844b31745a9c7ff60812d96af5e55 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 757650 Reviewed-on: https://skia-review.googlesource.com/37540 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* GrTessellator: when sanitizing contours, remove non-finite points.Gravatar Stephen White2017-08-22
| | | | | | | | | | NaNs can't be correctly sorted. Bug: 757650 Change-Id: Id1ca2fe1d1de7884da2a64ceef9491b1da7e8e77 Reviewed-on: https://skia-review.googlesource.com/37220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: fix for collinear out-of-range intersections.Gravatar Stephen White2017-08-16
| | | | | | | | | | | | | | | | | | | | | | | | Change 3b5a3fa8b1c11d4bd4499b040311f4c3553ebf8c introduced support for out-of-range intersections, which is necessary when the top and bottom vertices of an edge differ by only one ULP in the primary sort order and can't be split in-order. However, some out-of-range intersections produce edges which cancel each other out on splitting, in particular when the intersection is collinear with the newly-computed edge. This undoes the effect of the split. The tessellator then rewinds, re-detects the intersection, resplits, an infinite loop. The fix is to check for out-of-range intersections which are also collinear, and ignore them. This is ok, because these are not the cases we care about it change 3b5a3f above, which are never collinear. Bug: 753867 Change-Id: I590231e0e6f19c98f1ccf46cb7acc8a63ba35a9d Reviewed-on: https://skia-review.googlesource.com/34925 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.Gravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008 Reviewed-on: https://skia-review.googlesource.com/32760 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Clean up GrResourceProvider usageGravatar Robert Phillips2017-06-15
| | | | | | | | | | | | | The only substantive changes are the removal of GrProxy instantiation in: SkGpuBlurUtils::GaussianBlur GrSimpleTextureEffect::Make* Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc Reviewed-on: https://skia-review.googlesource.com/19965 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* GrTessellator: fix two NaN issues.Gravatar Stephen White2017-06-12
| | | | | | | | | | | | | | | If a point in the path rounds to +inf/-inf, the intersection code can produce NaN, which is unsortable. Fix: ignore non-finite intersections. Quadratic interpolation can sometimes produce NaN, which will never satisfy the flatness criterion. Abort if any of the interpolated points are non-finite. Bug:732023 Change-Id: If5881796e589c75b8f74459f42d00918619713a2 Reviewed-on: https://skia-review.googlesource.com/19467 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* GrTessellator: fix logging; fix test comment.Gravatar Stephen White2017-06-09
| | | | | | | Change-Id: Iaded9025a1518d8c69dbe366deb1035e0bd4295b Reviewed-on: https://skia-review.googlesource.com/19289 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>