This should, hopefully, clarify the role of onGpuSetup vis a vis onDraw.
The remaining tools are updated in:
https://skia-review.googlesource.com/c/skia/+/300220/ (Update remaining tools to GrDirectContext)
Change-Id: I19d6eec4d16cb9ebad8924763a18225cc871f0f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300172
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This also adds back default flush() calls which simply do a flush
without any submit.
Change-Id: Ia8c92bbdecd515d871abfa6364592f502e98656b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298818
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This will not be landed until chrome CL 2269958 lands.
Bug: skia:10425
Change-Id: I2a5081201ca3faed5232e8540086bd4c6f865767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299292
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This is pulled out of the gpuSetup refactoring in an attempt to break it into simpler bits.
Change-Id: I01e1717b7f046ad4b87a3f38ac201347a51041ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299077
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I44f64a8c98c019a8f4878b0b6f6d82489aa8252c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296179
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
(This is a simple reland of
https://skia-review.googlesource.com/c/skia/+/293272
and is functionally unchanged, but needed to be reconstructed
manually because JavaInputStreamAdaptor.cpp was deleted.)
SK_ABORT was already using SkDebugf to print the error message to the
console, so all the moving parts were there. This CL just adds a
mechanism for the calling code to pass in arguments.
Added a use case to demonstrate usage--when an allocation fails, the
requested size is now shown in the error message.
Change-Id: If8600a9febad15b7c8b7a04479a1d92442521f21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294705
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Adds a method to determine the worst-case number of tessellated line
segments that a path might require, and disables hardware tessellation
if it is more segments than are supported (falling back on indirect
draw shaders).
If the path requires even more segments than are supported by the
indirect draw shaders (1024), we crop the path to the viewport. The
required number of segments is proportional to the square root of the
bounding box's diagonal, so we won't start cropping paths until their
device-space bounding box diagonal is nearly 175,000 pixels long.
Change-Id: I8a9435e70bb93dda3464cc11a3e44fbe511744ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293691
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 67e50a6b5c.
Reason for revert: roller complains about LICENSE issue. cl/314177415
Original change's description:
> Allow printf-style formatting to be used in SK_ABORT.
>
> SK_ABORT was already using SkDebugf to print the error message to the
> console, so all the moving parts were there. This CL just adds a
> mechanism for the calling code to pass in arguments.
>
> Added a use case to demonstrate usage--when an allocation fails, the
> requested size is now shown in the error message.
>
> Change-Id: I42f141151fb57a399c086926249816833f349ddb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293272
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=djsollen@google.com,bungeman@google.com,herb@google.com,johnstiles@google.com
Change-Id: I7a2e98bcda82bbe6edfa3d00057586754df0ee71
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293342
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SK_ABORT was already using SkDebugf to print the error message to the
console, so all the moving parts were there. This CL just adds a
mechanism for the calling code to pass in arguments.
Added a use case to demonstrate usage--when an allocation fails, the
requested size is now shown in the error message.
Change-Id: I42f141151fb57a399c086926249816833f349ddb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293272
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit 074414fed5.
Reason for revert: updated to guard against nullptr before calling
quickContains(rrect).
Original change's description:
> Revert "GrClips provided as pointers to GrRTC"
>
> This reverts commit 226b689471.
>
> Reason for revert: Breaks Android roller
>
> Original change's description:
> > GrClips provided as pointers to GrRTC
> >
> > A null clip represents no high-level clipping is necessary (the implicit
> > clip to the render target's logical dimensions is fine).
> >
> > This also removes GrNoClip and GrFixedClip::Disabled() since they are
> > replaced with just nullptr.
> >
> > By allowing nullptr to represent no intended clipping, it makes it easier
> > to require GrClip and GrAppliedClip objects to know about the dimensions
> > of the device. If we required a non-null clip object to represent no
> > clipping, we'd have to have an instance for each device based on its
> > size and that just became cumbersome.
> >
> > Bug: skia:10205
> > Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
> Reviewed-by: Weston Tracey <westont@google.com>
> Commit-Queue: Weston Tracey <westont@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com,westont@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:10205
Change-Id: I5715a4de3b7c8847b73020dc4937d3816d879803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit 226b689471.
Reason for revert: Breaks Android roller
Original change's description:
> GrClips provided as pointers to GrRTC
>
> A null clip represents no high-level clipping is necessary (the implicit
> clip to the render target's logical dimensions is fine).
>
> This also removes GrNoClip and GrFixedClip::Disabled() since they are
> replaced with just nullptr.
>
> By allowing nullptr to represent no intended clipping, it makes it easier
> to require GrClip and GrAppliedClip objects to know about the dimensions
> of the device. If we required a non-null clip object to represent no
> clipping, we'd have to have an instance for each device based on its
> size and that just became cumbersome.
>
> Bug: skia:10205
> Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
A null clip represents no high-level clipping is necessary (the implicit
clip to the render target's logical dimensions is fine).
This also removes GrNoClip and GrFixedClip::Disabled() since they are
replaced with just nullptr.
By allowing nullptr to represent no intended clipping, it makes it easier
to require GrClip and GrAppliedClip objects to know about the dimensions
of the device. If we required a non-null clip object to represent no
clipping, we'd have to have an instance for each device based on its
size and that just became cumbersome.
Bug: skia:10205
Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This makes it more obvious that these files really are part of
SkParagraph and integrate with the Skia test framework and are not part
of core Skia. This is more like how Skottie is setup and helps prevent
misunderstandings about where additional files like this should go and
how the build should be structured.
Change-Id: Iaac060c97cffd2b0c29833c7b0403521d91bdb6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292439
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a reland of 477512c0b3
Original change's description:
> Reland "Add a tessellation mode that uses indirect draws"
>
> This is a reland of 02d7cf79be
>
> Original change's description:
> > Add a tessellation mode that uses indirect draws
> >
> > This mode is oftentimes faster than tessellation, and other times it
> > serves as a polyfill when tessellation just isn't supported.
> >
> > Change-Id: I7b3d57fd0194c6869bfe28ee53ff0ff2e43df479
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291036
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=brianosman@google.com
>
> Change-Id: Ia039d7897499a7dad55aff1072f9aa0d01001f9c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291693
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=brianosman@google.com
Change-Id: I55704b5adf5a7677a5382d07d39cadee9b252731
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291738
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 477512c0b3.
Reason for revert: Undefined behavior in benchmark
Original change's description:
> Reland "Add a tessellation mode that uses indirect draws"
>
> This is a reland of 02d7cf79be
>
> Original change's description:
> > Add a tessellation mode that uses indirect draws
> >
> > This mode is oftentimes faster than tessellation, and other times it
> > serves as a polyfill when tessellation just isn't supported.
> >
> > Change-Id: I7b3d57fd0194c6869bfe28ee53ff0ff2e43df479
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291036
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=brianosman@google.com
>
> Change-Id: Ia039d7897499a7dad55aff1072f9aa0d01001f9c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291693
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=egdaniel@google.com,brianosman@google.com,csmartdalton@google.com
Change-Id: I48e8cbff90f5533ba3e2166c819fb8e34bea34ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291737
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a reland of 02d7cf79be
Original change's description:
> Add a tessellation mode that uses indirect draws
>
> This mode is oftentimes faster than tessellation, and other times it
> serves as a polyfill when tessellation just isn't supported.
>
> Change-Id: I7b3d57fd0194c6869bfe28ee53ff0ff2e43df479
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291036
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com
Change-Id: Ia039d7897499a7dad55aff1072f9aa0d01001f9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291693
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 02d7cf79be.
Reason for revert:
Perf-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN
Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN
Running tessellate_prepareTessellatedCubicWedges nonrendering
../../../../../../skia/bench/TessellatePathBench.cpp:79: fatal error: "unimplemented."
Signal 5 [Trace/breakpoint trap]:
/mnt/pd0/s/w/ir/build/nanobench(backtrace+0x3d) [0x34851fd]
/mnt/pd0/s/w/ir/build/nanobench() [0x3db3d49]
/lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7fdb4722d840]
sk_abort_no_print()
BenchmarkTarget::caps() const
GrTessellatePathOp::prepareTessellatedCubicWedges(GrMeshDrawOp::Target*)
GrTessellatePathOp::TestingOnly_Benchmark::prepareTessellatedCubicWedges::runBench(GrMeshDrawOp::Target*, GrTessellatePathOp*)
GrTessellatePathOp::TestingOnly_Benchmark::onDraw(int, SkCanvas*)
Benchmark::draw(int, SkCanvas*)
/mnt/pd0/s/w/ir/build/nanobench() [0x3543b81]
/mnt/pd0/s/w/ir/build/nanobench(main+0x1347) [0x3540a17]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7fdb4721a09b]
/mnt/pd0/s/w/ir/build/nanobench(_start+0x2a) [0x346429a]
Command exited with code 5
Original change's description:
> Add a tessellation mode that uses indirect draws
>
> This mode is oftentimes faster than tessellation, and other times it
> serves as a polyfill when tessellation just isn't supported.
>
> Change-Id: I7b3d57fd0194c6869bfe28ee53ff0ff2e43df479
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291036
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=egdaniel@google.com,brianosman@google.com,csmartdalton@google.com
Change-Id: I4257d5ae5c0aafeebd61d8f1b78eca755ad977ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291642
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This mode is oftentimes faster than tessellation, and other times it
serves as a polyfill when tessellation just isn't supported.
Change-Id: I7b3d57fd0194c6869bfe28ee53ff0ff2e43df479
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291036
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit c80ee456ad.
fix: update flutter's gn file to add guard
Change-Id: Iac5171c8475d9a862d06255dab1c6f38f10de2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:10154
This will make it clear that these files are for Android use and
avoid compiling them for other clients.
Update testing tools to use android::skia::BitmapRegionDecoder, but
only if SK_ENABLE_ANDROID_UTILS is defined.
Take this opportunity to clean up the class:
- The base class, which was originally designed to allow switching
amongst different implementations, is no longer needed. Rename
SkBitmapRegionCodec to android::skia::BitmapRegionDecoder
(following the new convention and matching the Java API name).
Continue to inherit from SkBitmapRegionDecoder temporarily, to
allow Android to switch to the new API.
- Use std::unique_ptr instead of passing raw pointers.
Add a test to verify that we only create a BitmapRegionDecoder if
it is one of the supported types.
Change-Id: Ied13fc8acb105fde042553331846d95ae15d6b57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287498
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
This brings back the pow2 rectanizer for use with various ongoing
atlas experiments. If we can further optimize the skyline rectanizer,
then pow2 will be good to have around as a baseline comparison. And
if skyline gets fast enough, then we can delete pow2 again.
Change-Id: I79088c53fba7ba0d120534af99bee7840c135e42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290810
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Change-Id: I5303f6f5210628a0a5d941b2f4a6376b5e158b60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289577
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This is a reland of e278e1c1c7
Original change's description:
> Add an implementation and log2 variants for Wang's formula
>
> Wang's formulas for cubics and quadratics (1985) tell us how many line
> segments a curve must be chopped into when tessellating. This CL adds
> an implementation along with optimized log2 variants, as well as tests
> and a benchmark.
>
> Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com
Change-Id: Ie3822c62439fc579a59ea8adb49583224de41aa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289680
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit e278e1c1c7.
Reason for revert: i think we need to do that add with an unsigned, or test instead of always += (1<<23)-1.
Original change's description:
> Add an implementation and log2 variants for Wang's formula
>
> Wang's formulas for cubics and quadratics (1985) tell us how many line
> segments a curve must be chopped into when tessellating. This CL adds
> an implementation along with optimized log2 variants, as well as tests
> and a benchmark.
>
> Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,brianosman@google.com,csmartdalton@google.com
Change-Id: I24dfd8549054b632f38f7b05b4d857b640cf5cd1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289658
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Wang's formulas for cubics and quadratics (1985) tell us how many line
segments a curve must be chopped into when tessellating. This CL adds
an implementation along with optimized log2 variants, as well as tests
and a benchmark.
Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Change-Id: Ic5786b995fdb439871f2e3ab94cd07a945de19af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288776
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I9508790d67bf62b5a064ff5222a74e9566354351
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287888
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Rename methods to be more like std::bitset and boost::dynamic_bitset.
Also fix findFirst to actually find the first and add tests.
Change-Id: Ic812c0a6d0ce1740c1cda900516f609ebbf5811c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287676
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: I357f9b0d3f2c8315b67a9ead6ddbb6633524ec3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287577
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit cfdc07aa0e.
Reason for revert: nope, flutter windows bots don't have it. we got caught.
Original change's description:
> replace SkSharedMutex
>
> I am debugging an issue with SkSharedMutex and noticed
> how sparsely it is used. That got me curious to see if
> we can replace it with a std::shared_mutex (from C++17).
>
> Bug: skia:10177
> Change-Id: I1ce4d2a5897af198d6ae5fb850548ff917a58f50
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285691
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,bungeman@google.com,herb@google.com
Change-Id: Iab4e55d749e386233ff0e2ba2c1cd10d5e6f1615
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10177
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286124
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
I am debugging an issue with SkSharedMutex and noticed
how sparsely it is used. That got me curious to see if
we can replace it with a std::shared_mutex (from C++17).
Bug: skia:10177
Change-Id: I1ce4d2a5897af198d6ae5fb850548ff917a58f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285691
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is a reland of 0f9ebd100e
Original change's description:
> Optimize GrTessellatePathOp's code to emit inner triangles
>
> Previously we used a naive algorithm to generate "middle-out" topologies
> for inner polygons, including copying all endpoints to a new array.
>
> This CL adds a "GrMiddleOutPolygonTriangulator" class that
> accomplishes the same thing in 1/5th the time using a small O(log N)
> stack.
>
> Change-Id: I3a7059e5d133a730b7084a17d8fbaaa3aaa81336
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285531
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=ethannicholas@google.com
Change-Id: I8402e5455e14aef9c5e92ee21100fcd7ace222ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285740
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 0f9ebd100e.
Reason for revert: breaking a couple of bots (e.g. https://chromium-swarm.appspot.com/task?id=4bd6ccc785fa3110)
Original change's description:
> Optimize GrTessellatePathOp's code to emit inner triangles
>
> Previously we used a naive algorithm to generate "middle-out" topologies
> for inner polygons, including copying all endpoints to a new array.
>
> This CL adds a "GrMiddleOutPolygonTriangulator" class that
> accomplishes the same thing in 1/5th the time using a small O(log N)
> stack.
>
> Change-Id: I3a7059e5d133a730b7084a17d8fbaaa3aaa81336
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285531
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=csmartdalton@google.com,michaelludwig@google.com
Change-Id: I8ebca7078f2b9c12246447759efa9ce0cbb7e46b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285719
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Previously we used a naive algorithm to generate "middle-out" topologies
for inner polygons, including copying all endpoints to a new array.
This CL adds a "GrMiddleOutPolygonTriangulator" class that
accomplishes the same thing in 1/5th the time using a small O(log N)
stack.
Change-Id: I3a7059e5d133a730b7084a17d8fbaaa3aaa81336
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285531
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Renames the provider to SkMatrixProvider, which is now also able to
provide the local-to-device matrix. Everywhere that does paint
conversion and FP generation now has access to the entire matrix
provider, instead of just the CTM.
This will allow the SkSL FP (and others) to fetch other matrix state.
Change-Id: Iffb00bae0d438da0e8de3eebe75183ed6d440fd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284040
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
These are neat but mostly just a distraction for now.
I've left all the assembly in place and unit tested
to make putting these back easy when we want to.
Change-Id: Id2bd05eca363baf9c4e31125ee79e722ded54cb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283307
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
saveCamera() is no longer experimental
In a separate CL, will stage changes to concat virtual to take M44.
Change-Id: Iaf37ce2f24ab1223c54aeb1e79eaebf18f87fece
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281589
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: I50c1f230803faef731b32cad7cd60b7b421678e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281160
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
It was too easy to get into circular include chains. Added static
asserts to ensure we keep our quad AA flags in sync. Also, IWYU.
Change-Id: I01aefa264aa56420ab5a46a8ecd9e63c021c79ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280405
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
iMac Pro bench:
- RP: 167
- VM exp: 195
- VM quartics: 135
Change-Id: Ie8deb38f246b9ae7bbd35e59c3e7e66fc7c42de5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279918
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Updated to use sentinel GL context even when GL backend is not built.
This reverts commit 1171d314ef.
Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Everyone is responsible to set up their own scissor and textures now.
Change-Id: Ic3547f00c0e7908409631951de4b7237b9bce23b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277177
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Fuses the relevant functionality into the set() calls.
Change-Id: I3a764219425c35967942366c60a6b9ee6ec48e11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This CL moves the boiler-plate implementation of onPrePrepareDraws up to GrMeshDrawOp. This, unfortunately, required the addition of a 'programInfo' virtual but that may go away in the future.
The only GrMeshDrawOp-derived classes left are:
AAHairlineOp - which has 3 programInfos
AAFlatteningConvexPathOp - which has >=1 mesh (but just 1 programInfo)
GrAtlasTextOp - which has inline uploads
SmallPathOp - which, maybe, has inline uploads
TextureOp - which has chaining
Bug: skia:9455
Change-Id: Id10f70e764054134751545ad38b99f0a0778de76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This CL:
Renames the existing createProgramInfo method to onCreateProgramInfo and makes it a virtual on GrMeshDrawOp
Moves the non-virtual createProgramInfo (helper) calls to GrMeshDrawOp
Changes onCreateProgramInfo to not return a ProgramInfo*. This is setting up to handle ops that create >1 programInfo (e.g., AAHairlineOp)
This CL leaves the following 8 ops in need of an onCreateProgramInfo implementation:
AAHairlineOp
AAFlatteningConvexPathOp
GrAtlasTextOp
GrShadowRRectOp
SmallPathOp
GrTextureOp
PrimitiveProcessorTest::Op
VertexColorSpaceBench::Op
Bug: skia:9455
Change-Id: Id7e2b8a40cac86ede6bf3c0e544da5500ff47d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276403
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit e5a06ce678.
Reason for revert: Need to make change in google3 first
Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
>
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
>
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Seems to fix memory crash with iPhone8 Metal Perf bot
Change-Id: Ia9712e13b62415877c55ca94f1b0cc306cb7724d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273995
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Id133cb4c97931fb6a8c7d1d6d6b0bb09cbd47d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273486
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
* Rename all the Exclusive things.
Change-Id: If6b5fec5130bf58c396e0a472730efd2ae38c0d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273057
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This also allows us to remove all the one off Fence code that we
implemented in all the backend TestContexts
Change-Id: I9ff7ba4690cf3f19a180f51fc510991a112bb62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272456
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Need to migrate clients from private/ to core/ include
Unexperimentalize concat44() methods on SkCanvas
Change-Id: I64b8816722a9d93316cb8b8691d2d9a3e36f167f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272464
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
SkStrike becomes SkScalerCache. It will eventually externalize
the memory accounting to SkStrikeCache::Node because the amount of
memory used by the scaler cache, and the overall strike cache memory
usage must be kept in sync.
Change-Id: Ia889f057d8138ec7f22f996e7ebb9d2441dea4ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271018
Reviewed-by: Ben Wagner <bungeman@google.com>
I don't necessarily like this long term, but in the short term Flutter
would like to record pictures using their own type separate from
SkRTree. This makes SkBBoxHierarchy public, and converts it to use
other public types (SkTDArray -> vector).
Change-Id: I29c5ef9da7d641d8f4ba18522b168ddf7cefe84f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270387
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Use std::min and std::max everywhere.
SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.
Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Use std::max and std::min instead
Change-Id: I7fd2626ea9ea8ea09c709ff962523ca3de2f8a16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269136
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Use std::max and std::min instead
Change-Id: Icf3796609e5cb511687fb50bd31229ae4b6b9b39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268841
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 99c54f0290.
Change-Id: I010ac4fdb6c5b6bfbdf63f4dcac5dbf962b0ad9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266205
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is a reland of 77e1f84a84
Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
>
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
>
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
Change-Id: I09729ba2b0e4b8b1a229fef4b95e65195b33fdc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266180
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 77e1f84a84.
Reason for revert: breaking google3 roll?
Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
>
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
>
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,herb@google.com
Change-Id: I2573534f3ea95c98d089f9c19b027564e77015db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266116
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
It looks like the pow2 rectanizer has never been used. Remove
the unneeded abstraction for rectanizer everywhere.
Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit f79aacba2b.
Fix: had transposed when converting from colormatrix to m44
Change-Id: I6bc81d0c50bb1bf8d771e4dfa0c25c39de265b1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265765
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: I3748fcae9b608b7a29d6354fb26c37193870e377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265761
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 295cdf8775.
Reason for revert: wacky gm colors, must have busted colormatrixfilter
Original change's description:
> use SkM44 internally
>
> Today we use SkM44 in canvas, and SkMatrix44 in sksl (and colormatrix).
> This CL tries to move core to use a single type.
>
> SkMatrix44 has callers in android and chrome, is loaded with double/float
> variants in its API. I am suggesting moving to a private, clean-start,
> API for internal use. SkM44 is much faster, and has a leaner API.
>
> If eventually we can migrate clients to a shared impl/api, great. For now,
> I want to have one we are free to optimize/use as we see fit without
> worrying about changing client results.
>
> Change-Id: Id782ac1cc8b8d7f6621970e44e1f9729964d2a94
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265299
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=mtklein@google.com,bsalomon@google.com,brianosman@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I35fcd636f1b57001bb65684e78523b6a94cfebee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265764
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Today we use SkM44 in canvas, and SkMatrix44 in sksl (and colormatrix).
This CL tries to move core to use a single type.
SkMatrix44 has callers in android and chrome, is loaded with double/float
variants in its API. I am suggesting moving to a private, clean-start,
API for internal use. SkM44 is much faster, and has a leaner API.
If eventually we can migrate clients to a shared impl/api, great. For now,
I want to have one we are free to optimize/use as we see fit without
worrying about changing client results.
Change-Id: Id782ac1cc8b8d7f6621970e44e1f9729964d2a94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265299
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>