Some builds in Google3 can't find SkSharedMutex at link time.
This reverts commit ff7006ff80.
This reverts commit 05f45b21b7.
Change-Id: I889e9a3169cf017b8d5daacf75099663fc996d73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210785
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
1. want to standardize on naming convention (matching shaders asA...)
2. want to eliminate legacy asColorMatrix with its 255 bias
Bug: skia:
Change-Id: I43258aa3a406b92a3246e13e5dd996fcc207c784
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210621
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN
Change-Id: I317106fd1e5357149d9a0151038317d7a5c92f37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210553
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
What do you think of this sort of thing for letting
users register codecs at runtime instead of at build time?
Change-Id: I448ea3466862326c283ad9b2f1b7eea56cffc80c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210449
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Since explicit allocation is always enabled now, the resource allocator explicitly manages reuse of GrSurfaces and this flag isn't used/needed.
Change-Id: I5703bf4624e21f9aff9da76575f4ef757b1d2589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210140
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Current strategy: everything from the top
Things to look at first are the manual changes:
- added tools/rewrite_includes.py
- removed -Idirectives from BUILD.gn
- various compile.sh simplifications
- tweak tools/embed_resources.py
- update gn/find_headers.py to write paths from the top
- update gn/gn_to_bp.py SkUserConfig.h layout
so that #include "include/config/SkUserConfig.h" always
gets the header we want.
No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
With the upcoming removal of pendingIO refs the GrResourceAllocator needs a new means of determining when a backing GrSurface can be recycled and when it needs to be left assigned to a GrSurfaceProxy.
Change-Id: I2327b0f15ceb639b400a55a9c53359a4b43288c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210041
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Repurpose GrTRecorder for storing these tasks. It's currently unused.
Reimplement on top of SkArenaAlloc and using emplace methods now that we
have C++14.
Currently it stores copy and upload tasks. In the future it will store
transfer-out commands.
Removes the optimization that reset copy-ins on clear/discard. However,
none of our existing tests exercised it.
Change-Id: I0474f77cc2d368461d542de50a7a0c5609312001
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209643
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I099f8a635df7dd0ddd3902459615250ea2c120c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209874
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 7eec3cd688.
Reason for revert: Chrome assert
Original change's description:
> Implement alternate method for determining recycle-ability of allocated GrSurfaces
>
> With the upcoming removal of pendingIO refs the GrResourceAllocator needs a new means of determining when a backing GrSurface can be recycled and when it needs to be left assigned to a GrSurfaceProxy.
>
> Change-Id: I6f62a793e8aba70019dc8d0e7d585366d1097d70
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208227
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Ia7098e1fcbf5623a7846b52b3b26f724e183d5ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209807
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
With the upcoming removal of pendingIO refs the GrResourceAllocator needs a new means of determining when a backing GrSurface can be recycled and when it needs to be left assigned to a GrSurfaceProxy.
Change-Id: I6f62a793e8aba70019dc8d0e7d585366d1097d70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208227
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
skcms is part of Skia's public API now. This attempts to recognize that,
and pave the way for moving the header to another location more easily
in a follow up CL, or - at a minimum - for clients that redistribute
Skia as a library + includes to relocate the skcms.h header as part of
that.
Change-Id: I15da63b0d4ab8916a71fb7e6ab3656db87252707
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209640
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: If0eb6fb2efb6816b92ad7ca7d8caaace71397b7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209409
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
This approach eliminates a lot of edge cases where ops (e.g., the SmallPathOp) are treating their proxies in a special manner (i.e., just holding a raw ref and never adding pendingIO). Given that the atlas managers are managing the lifetime of the proxies there is no reason for the GrResourceAllocator to be aware of them.
Pulled out of:
https://skia-review.googlesource.com/c/skia/+/208227 (Implement alternate method for determining recycle-ability of allocated GrSurfaces)
Change-Id: I0a8d3c2d56036d568b6d49ddc78c32761642d1c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209419
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is an experiment in making SkMatrix less sharp.
Change-Id: Ie1881b0905b594aa1c444440fae5253970850e12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208340
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 7bb47f2a2e.
Reason for revert: chrome roll maybe
Original change's description:
> Add explicit GrSurfaceProxy flag to skip explicit resource allocation
>
> This approach eliminates a lot of edge cases where ops (e.g., the SmallPathOp) are treating their proxies in a special manner (i.e., just holding a raw ref and never adding pendingIO). Given that the atlas managers are managing the lifetime of the proxies there is no reason for the GrResourceAllocator to be aware of them.
>
> Pulled out of:
>
> https://skia-review.googlesource.com/c/skia/+/208227 (Implement alternate method for determining recycle-ability of allocated GrSurfaces)
>
> Change-Id: Ia6bec5e8f5d5bc63e86ae011bcc3f8e061c066b2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209400
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Id65bd176f56aa91ff76ec1979aef6206b7665d63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209600
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This helps enable optimizations that rely on the entire clip reducing
to a single rectangle, such as converting a drawRect to a clear.
Bug: b/122296071
Change-Id: I1fea4565644280d57610f8585b76babb557301d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209382
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This approach eliminates a lot of edge cases where ops (e.g., the SmallPathOp) are treating their proxies in a special manner (i.e., just holding a raw ref and never adding pendingIO). Given that the atlas managers are managing the lifetime of the proxies there is no reason for the GrResourceAllocator to be aware of them.
Pulled out of:
https://skia-review.googlesource.com/c/skia/+/208227 (Implement alternate method for determining recycle-ability of allocated GrSurfaces)
Change-Id: Ia6bec5e8f5d5bc63e86ae011bcc3f8e061c066b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209400
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This effectively re-applies the logic from
https://codereview.chromium.org/298973004
The change to the unit test for 389050 is interesting.
The last convexity rewrite "fixed" that case by allowing
it to be detected as convex. In the process, it actually
broke the original bug, so that rendering of the HTML
failed. This CL causes us to give up and decide that the
path is concave, but we return to rendering correctly, so
that's a win.
The bug that initiated this (950508) is effectively the
exact same bug as 2235, which is why I haven't added a new
test case. The existing test case is much more concise than
the 100K data file needed for the new one.
Bugs: skia:2235 chromium:389050 chromium:950508
Change-Id: I0de65db8644f37e335c47e9d41c676b8e8b020fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209164
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This was rebaselined and removed from Chrome long ago.
Planning to fix more bugs in the Convexicator, but want
to get this out of the way first.
Change-Id: I4f299d56a81be509a861d1e9c9f0e48a47170096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209322
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
There are bugs in the other code path that will require more state,
and maintaining this special case in parallel is going to be tricky.
Change-Id: I0083b0aa2af16391504f0993e765faa0f5522502
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209163
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This ensures that proxy typefaces are really proxying these calls. Also,
sometimes the defaults aren't really the right thing.
Change-Id: Ifac417452136adca8152f4cd7670fd40553bd3b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209105
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a reland of fde841de44
Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
>
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: I5162c93b3ea6146d09334545744b791d993397b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
GrGpuBuffer for reading is synchronous or not.
Update transfer-from test to not call GrGpu->finishFlush() when maps
are synchronous.
Bug: skia:8962
Change-Id: I5eb003081725e5199157473faf7f916a65408dc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208509
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit fde841de44.
Reason for revert: used in headless on google3, need to add a guard
Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
>
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
TBR=bungeman@google.com,herb@google.com,reed@google.com
Change-Id: I1d28ed5c31deaa76aa3c4b627454b0ad3356a6fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208800
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Yet another surprising finding when looking at ARM code generation is
that passing these values to functions by const& does make a difference,
even when fully inlined. I can only guess that the compiler's somehow
more sure that way that the values won't change? Anyway, convert all
skvx functions that take Vec arguments to take const Vec& instead.
This tweak is enough to let the natural implementation of mull()
actually produce good code generation, so I've promoted that to SkVx.h
and added a unit test. Notice in the NEON case we've got a base case at
N=8 and two recursive cases, one down to 8 as usual when N > 8, but also
one up to 8 when N < 8.
This also is another big speedup for ARMv7 NEON, bringing it to nearly
the same speed as ARMv8 NEON on the same device.
Bug: chromium:952502
Change-Id: I0f19bab45cf02222ccc8090053ea2a4a380f1dfe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208582
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
In a future CL I intend to use prepareForExternalIO to be a specific operation
to do to an SkSurface/SkImage so this is a pre CL that removes our use of that
phrase when related to flushing.
Bug: skia:8802
Change-Id: I3efe4c4061fe962e2fc1339185feb5ded6e23005
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208223
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
GrCaps now only provides the offset alignment requirement. The row bytes
is always bpp * width.
GrGpu::transferPixelsFrom now just returns bool since row bytes value is
implicit. It now asserts offset is aligned with GrCap's provided value
in base class.
Implement caps for GL.
Bug: skia:8962
Change-Id: I3299b62efe9fe05bfe02f2a6a4c2704f647d0f8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206686
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The pretty printer didn't actually need the original (separate) strings,
so make it just operate on a single SkSL::String. Also remove the unused
line numbering, and the unit test. (Testing of test code, yay!)
With that done, cut down on passing around arrays of char* + length, and
just do the compaction to a single SkSL::String in the program builder.
Change-Id: Ieef9d9a8e3c5620c011b17477f1b0f9a9faa6273
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208226
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Made up a threshold between linear and slope searching.
For a count of 100 here are the before and after timings.
The first two lines are being changed. The latter 2 are
the native look-ups for mac.
Before
15/15 MB 115 2.33µs 2.34µs 2.34µs 2.34µs 0% ▆▁▄█▇▇▂▄█▆ nonrendering cmap_findcache_charToGlyph
15/15 MB 66 3.47µs 3.48µs 3.49µs 3.55µs 1% █▁▁▁▂▁▁▁▁▄ nonrendering cmap_addcache_charToGlyph
15/15 MB 1 1.1µs 1.13µs 1.21µs 1.98µs 22% █▂▁▁▁▁▁▁▁▂ nonrendering cmap_face_charToGlyph
15/15 MB 190 1.09µs 1.1µs 1.19µs 1.64µs 17% ▁▁▁▆█▁▁▁▁▁ nonrendering cmap_font_charToGlyph
After
15/15 MB 447 448ns 449ns 448ns 449ns 0% ▂▅█▅▁▆█▂▁▆ nonrendering cmap_findcache_charToGlyph
15/15 MB 95 2.79µs 3.03µs 3µs 3.06µs 3% ▇▇▇▇▇███▄▁ nonrendering cmap_addcache_charToGlyph
15/15 MB 1 1.15µs 1.16µs 1.25µs 1.99µs 21% █▂▁▁▁▁▁▁▁▁ nonrendering cmap_face_charToGlyph
15/15 MB 186 1.09µs 1.1µs 1.12µs 1.27µs 5% █▁▁▁▂▁▁▁▁▁ nonrendering cmap_font_charToGlyph
Bug: skia:
Change-Id: If7da4eef3cce248393815071f342607f0c8140bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208044
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This is preparing the ground for having proxies be atomically reffed
Change-Id: Ice48c41120d4ec10a758f696a69028b6363e8a7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207762
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Try: out/release/nanobench --match _charToGlyph
Pseudo plan to use this:
- attach to whatever typeface backends need it (probably just freetype)
- have a purge/limiting scheme (e.g. only cache N entries)
- if we care, make the search fancier (e.g. binary, slope, etc.)
Bug: 951647
Change-Id: Ib1042ca5891d2742499faf1314579c402121a855
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207703
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
The two existing external users of SkPaintFilterCanvas always end up
making a copy of the paint when the canvas is in use. As a result, the
extra overhead of doing COW is being wasted. In general, it seems easier
for users to optimize by simply not using the filter canvas when it
won't be making any changes. Also, no users are using the 'Type'.
After users are updated to this new API, the old onFilter can be
removed.
Change-Id: Iee1ce3cd22bce8c00664de078375b105abd7c866
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/149806
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
- be more explicit about casting
- general rewrite for clarity
Cq-Include-Trybots: skia.primary:Test-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Debug-All-MSRTC
Change-Id: I924d6d247e6b9afcefb27c690715fdad84635a5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207721
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
These replicate the base logic of Sk4px::Wide::div255() and
Sk4px::approxMulDiv255(), and will come in handy replacing them.
No platform specializations yet... want to remind myself what
codegen they get from these vanilla versions first, and then
I'll fill in the platform specific stuff as needed. The tests
should cover everything pretty exhaustively.
Change-Id: I5854d1bc0902a85cbb2351f669c4da7cc31a8775
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207683
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
An FcConfig has the concept of a sysroot against which file names should
be resolved. Add support for this so that it is possible to use
relocatable FcConfigs. Also adds a test that this works.
Change-Id: I523d5fb1233830434a88dc52b27728aaf83bb5a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206278
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This is to match the current features of SkSurface::flush and to prepare
for adding additional features to flush.
Bug: skia:8802
Change-Id: I5d68272e1277b416af357e6ffaf426841ceda943
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207301
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:8243
Change-Id: Id71073dffe6e2b42d099f0c92059b53c48b46c4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206717
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Was starting to use this and ran into a few problems with clashing
symbols, namely SI and cast(). Seemed simple enough to not use SI,
and to move all the free-standing types into skvx: skvx::cast,
skvx::shuffle, etc.
Change-Id: Ia5d8ef6d0ae5375bf80d76be88d16f0c9cde56e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207340
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>