Commit Graph

323 Commits

Author SHA1 Message Date
Brian Salomon
24069ebd23 Add GrContext::oomed() and implement for GL and VK.
Surfaces to client whether GrContext has seen a GL_OUT_MEMORY,
VK_ERROR_OUT_OF_HOST_MEMORY, or VK_ERROR_OUT_OF_DEVICE_MEMORY error.

Bug: chromium:1093997
Change-Id: I8e9799a0f7d8a74df056629d7d1d07c0d0a0fe30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-24 16:04:06 +00:00
Mike Reed
22f246f5ad add simple pathbuilder
88.26 ?	makepath_arrays_reserve	nonrendering
    235.97  	makepath_detach_reserve	nonrendering
    274.56  	makepath_snapshot_reserve	nonrendering
    537.61  	makepath_path_reserve	nonrendering
    472.98  	makepath_detach_noreserve	nonrendering
    482.56  	makepath_snapshot_noreserve	nonrendering
    750.83 ?	makepath_path_noreserve	nonrendering

Bug: skia:9000
Change-Id: I346537e899b08946c5778042a021f464006b029c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209403
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-06-24 01:50:30 +00:00
Florin Malita
4190f27b41 Fix SkParse::FindNamedColor OOB
Plus some minor cleanup and asserts.

Bug: oss-fuzz:23395

Change-Id: I667bee2d7f21864defe2fd97df9eb4e99d69d9ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296451
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-06-17 14:23:14 +00:00
Brian Osman
ff7bee9817 Remove SkReader32, and some API from SkWriter32
After removing all unused API from SkReader32, it only had a handful
of functions, and it was (rightly) only used by SkReadBuffer. Remove
the temptation to use it by just folding it into SkReadBuffer.

SkWriter32 had some unnecessary functions as well (only used in unit
tests), so those are gone. There is still a strange relationship:
SkWriteBuffer is just an interface - SkReadBuffer is actually the
complement of SkBinaryWriteBuffer/SkWriter32. Those two classes produce
data in the exact same format, but with slightly different interfaces.
(The choice about which one is used is mostly about high-level
serialization vs. low-level helpers).

Change-Id: I1e823755febecd2e053ea732b21295d8f4d9d832
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295557
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-10 16:45:56 +00:00
Greg Daniel
6c6caf420a Add GrBackendMutableState object to handle shared texture state.
This is will be the main struct used to synchronize changes of certain
texture/image between clients and Skia. With this change we
implement support for the Vulkan shared state as POC.

Bug: skia:10254
Change-Id: I10543357635c347838b193874e4da4496a0dcf06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292311
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-29 16:53:08 +00:00
Greg Daniel
55822f17bd Add submittedProc to GrFlushInfo.
Bug: skia:10118
Change-Id: Iad848310d0f2fb22f19e9890209548fda103bd27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291078
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-27 12:48:43 +00:00
Leon Scroggins III
87caae61cd Move SkBitmapRegionCodec into client_utils/android
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>
2020-05-20 20:06:48 +00:00
Chris Dalton
f6bf516926 Reland "Add an implementation and log2 variants for Wang's formula"
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>
2020-05-14 02:57:59 +00:00
Mike Klein
6c3db04c8b Revert "Add an implementation and log2 variants for Wang's formula"
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>
2020-05-13 22:10:47 +00:00
Chris Dalton
e278e1c1c7 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>
2020-05-13 21:39:24 +00:00
Mike Klein
5cf6b31fc8 Revert "retry absl"
This reverts commit 1d256d66ec.

Reason for revert: Build-Debian10-Clang-arm64-Debug-Android_ASAN can't find <cxxabi.h>.

Original change's description:
> retry absl
> 
> This time around, cut the absl deps down to just what's
> needed to compile, link, and run AbseilTest.cpp.
> 
> Add basic absl::btree_map test.
> 
> Bug: skia:10165
> Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN
> Change-Id: I53d632a04cba8dadd484b2c4d0ceefb314676486
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286070
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,johnstiles@google.com

Change-Id: I2465ed155f7311c6ca35259ea1bf1b610020a66d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10165
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286477
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-30 16:11:14 +00:00
Mike Klein
1d256d66ec retry absl
This time around, cut the absl deps down to just what's
needed to compile, link, and run AbseilTest.cpp.

Add basic absl::btree_map test.

Bug: skia:10165
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN
Change-Id: I53d632a04cba8dadd484b2c4d0ceefb314676486
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286070
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-30 16:01:41 +00:00
Mike Klein
77083c7d74 Revert "replace SkSharedMutex"
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>
2020-04-29 18:50:39 +00:00
Mike Klein
cfdc07aa0e 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>
2020-04-29 14:15:42 +00:00
Mike Klein
5763b37ffb Revert "Reland "Add Abseil to third_party.""
This reverts commit 78debd6f6d.

Reason for revert: unexpectedly, Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN

Original change's description:
> Reland "Add Abseil to third_party."
>
> This is a reland of 816226e822
>
> Original change's description:
> > Add Abseil to third_party.
> >
> > At present, this is a proof-of-concept which only supports a small
> > subset of absl modules:
> > - Base
> > - Hash
> > - Numeric
> > - String
> >
> > This is only used by one unit test, which builds a string and then
> > hashes it.
> >
> > Bug: skia:10165
> > Bug: b/154848688
> >
> > Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> Bug: skia:10165, b/154848688
> Change-Id: I618bb4411445fe5b45a91741934ca888a09adf05
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285537
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=djsollen@google.com,mtklein@google.com,johnstiles@google.com

Change-Id: I434da738bcc7fa76b46d0fa0fcbdd58c85b70fe7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10165, skia:10177, b/154848688
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285685
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-04-27 18:46:29 +00:00
John Stiles
78debd6f6d Reland "Add Abseil to third_party."
This is a reland of 816226e822

Original change's description:
> Add Abseil to third_party.
>
> At present, this is a proof-of-concept which only supports a small
> subset of absl modules:
> - Base
> - Hash
> - Numeric
> - String
>
> This is only used by one unit test, which builds a string and then
> hashes it.
>
> Bug: skia:10165
> Bug: b/154848688
>
> Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Bug: skia:10165, b/154848688
Change-Id: I618bb4411445fe5b45a91741934ca888a09adf05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285537
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-04-27 06:07:43 +00:00
Mike Klein
6d54e84dc5 Revert "Add Abseil to third_party."
This reverts commit 816226e822.

Reason for revert: 

https://chromium-swarm.appspot.com/task?id=4bc69ffc0a889110

/mnt/pd0/s/w/ir/clang_linux/bin/clang++ -rdynamic -Wl,-rpath,\$ORIGIN --target=armv7a-linux-gnueabihf --sysroot=/mnt/pd0/s/w/ir/armhf_sysroot -static-libstdc++ -static-libgcc -B/mnt/pd0/s/w/ir/armhf_sysroot/bin -B/mnt/pd0/s/w/ir/armhf_sysroot/gcc-cross -L/mnt/pd0/s/w/ir/armhf_sysroot/gcc-cross -L/mnt/pd0/s/w/ir/armhf_sysroot/lib -L/mnt/pd0/s/w/ir/chromebook_arm_gles/lib -Wl,--start-group @./dm.rsp  -Wl,--end-group -lpthread -ldl -lGLESv2 -lEGL -o ./dm
libabsl.a(libabsl.numbers.o): In function `absl::string_view::substr(unsigned int, unsigned int) const':
/mnt/pd0/s/w/ir/skia/third_party/externals/abseil-cpp/absl/strings/string_view.h:387: undefined reference to `absl::base_internal::ThrowStdOutOfRange(char const*)'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)


Original change's description:
> Add Abseil to third_party.
> 
> At present, this is a proof-of-concept which only supports a small
> subset of absl modules:
> - Base
> - Hash
> - Numeric
> - String
> 
> This is only used by one unit test, which builds a string and then
> hashes it.
> 
> Bug: skia:10165
> Bug: b/154848688
> 
> Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

TBR=djsollen@google.com,johnstiles@google.com

Change-Id: If9936f1beaf6ac9c85718ce445e823bf2f57a6fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10165, b/154848688
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285491
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-24 20:15:42 +00:00
John Stiles
816226e822 Add Abseil to third_party.
At present, this is a proof-of-concept which only supports a small
subset of absl modules:
- Base
- Hash
- Numeric
- String

This is only used by one unit test, which builds a string and then
hashes it.

Bug: skia:10165
Bug: b/154848688

Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-04-24 19:53:21 +00:00
John Stiles
0ebc69c9ef Fix modulo-by-zero crash during SPIR-V conversion.
Array-stride calculation did not check for zero-sized objects before
performing a modulo. This would lead to undefined behavior (crash)
while attempting to build the AST.

Change-Id: I84b4662978955d49a3ca28f6bb577d15c87cccb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284354
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-18 13:41:40 +00:00
Michael Ludwig
2686d69bf0 Reland "Rename GrShape to GrStyledShape"
This reverts commit 73b86c1ade.

Reason for revert: wasn't the problem, relanding

Original change's description:
> Revert "Rename GrShape to GrStyledShape"
> 
> This reverts commit f3f08af010.
> 
> Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.
> 
> Original change's description:
> > Rename GrShape to GrStyledShape
> > 
> > Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: Ifdd52f8bacb5d66a7bf58efd328675c4c443ac8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284376
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 20:24:53 +00:00
Michael Ludwig
73b86c1ade Revert "Rename GrShape to GrStyledShape"
This reverts commit f3f08af010.

Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.

Original change's description:
> Rename GrShape to GrStyledShape
> 
> Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 19:38:34 +00:00
Michael Ludwig
f3f08af010 Rename GrShape to GrStyledShape
Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-16 18:05:51 +00:00
Mike Reed
56aa710832 separate m44 tests
Change-Id: I33db5286538cd5721ad0cf6095eef82c42ff1e35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283916
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 10:53:37 +00:00
Mike Reed
938b4532b4 Revert "transition matrix44 to opt-in only"
This reverts commit 0f1f87d7bd.

Reason for revert: google3 and flutter also need the guard

Original change's description:
> transition matrix44 to opt-in only
> 
> In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/
> 
> Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I7c8cf2bc67aa267d442d0ca663e8378aa8feb409
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 10:01:29 +00:00
Mike Reed
0f1f87d7bd transition matrix44 to opt-in only
In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/

Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-15 18:34:26 +00:00
Mike Klein
96f6401789 harmonize rewrite-includes and gn-format checks
The CheckGeneratedFiles bot only required rewriting
.gn files, while the presubmit wants both .gn and .gni files.

It also appears that the #includes rewrite script runs on
both the presubmit and CheckGeneratedFiles bots.

These presubmits run on the CQ before landing right?
If so, no need for them in the CheckGeneratedFIles bot at all.

And of course, format .gni files.

Change-Id: Icd4526d62f85088862ad93566cc9ace11dc3e33f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281505
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-03 17:00:54 +00:00
Chris Dalton
07e5b8f0ed Rename TessellatingPathRendererTests.cpp -> "Triangulating"
Change-Id: Ie0525d71bb8cc15da2ebe61821c92e213f8dd3c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279896
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-27 19:42:03 +00:00
Michael Ludwig
4519134e07 Implement GrTAllocator in terms of GrBlockAllocator
Previously, the GrAllocator header defined three types: GrAllocator,
GrTAllocator, and GrSTAllocator. GrAllocator was generic, and would
manage the blocks of memory (fixed size to hold N * sizeof(item)). It
stored an SkTArray of pointers to each block. GrTAllocator wrapped
the GrAllocator to add template support for a specific T. GrSTAllocator
extended GrTAllocator to include a template arg for inline storage.

In this CL, GrAllocator is no longer defined, and its memory functionality
is replaced with the use of GrBlockAllocator. For the most part, the
implementation of GrTAllocator on top of GrBlockAllocator remains the
same, although there is explicit array to the block pointers so indexing
is slightly different. GrSTAllocator is also removed entirely, so that
GrTAllocator's template includes initial storage size.

The iteration over the allocated items
is updated to wrap GrBlockAllocator's block iterator, and then iterate
by index within each block. Documentation on GrAllocator already recommended
using the iterator instead of random access, and these changes further
reinforce it. It turns out that many of the use cases of GrAllocator
were written to use random access, so many of the files outside of
GrAllocator.h have just been updated to use the new for-range iteration
instead of a random access for loop.


Change-Id: I28b0bc277c323fd7035d4a8442ae67f058b2b64c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272058
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-03-24 18:00:33 +00:00
Dominic Mazzoni
c227f4a826 Add support for tagging link annotations in PDFs.
Properly tagging links in PDFs just required a small change: at the time
an annotation is drawn, we need to keep track of the bounding rect, the
url and/or named destination, and now additionally the node ID. Instead
of keeping track of separate maps of rects/urls and rects/dests, this
patch combines them into a vector of SkPDFLinks.

Then, at the time the annotation is written to the file, an object
reference to that annotation can be saved and passed to the document
structure tree, where it can be included as an additional child of
the node with that node ID.

That allows for properly tagging the link and optionally giving it alt
text (like for an image link).

Bug: chromium:1039816
Change-Id: I97e47d3c70949020c3e0a69b8c9fc743748f3a7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277426
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-03-24 15:52:55 +00:00
Brian Salomon
f4ba4ec796 Revert "Revert "Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots""""
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>
2020-03-20 17:11:58 +00:00
Brian Salomon
1171d314ef Revert "Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"""
This reverts commit fb27c9a25f.

Revert "Remove MoltenVK support"

Reason: TSAN Vulkan bots hanging.

This reverts commit 6cafe73da9.

Change-Id: I8ec9db35c112f3c8da8636dab2065e6f18de7d0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277936
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-19 13:10:59 +00:00
Brian Salomon
fb27c9a25f Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots""
This reverts commit 00ba5ef4a6.

Bug: skia:10051

Change-Id: I13fd5494b7e7e64159e6330f168ab8c16a2db149
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277609
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-18 18:12:11 +00:00
Brian Salomon
00ba5ef4a6 Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"
This reverts commit f6784a8c84.

Reason for revert: breakage of builds

Original change's description:
> Don't build GL on Metal, Vulkan, Dawn, Direct3D bots
> 
> Misc fixes to omit GL-dependent targets and fix assumptions that
> SK_SUPPORT_GPU implies SK_GL.
> 
> Bug: skia:10051
> Change-Id: Ida88ac3f1bf4d9e23f66d0700c2bce18b938ed6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277456
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: I4e02f675fd8820ed3c8efee192c64e570a23c3e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10051
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-18 14:42:28 +00:00
Brian Salomon
f6784a8c84 Don't build GL on Metal, Vulkan, Dawn, Direct3D bots
Misc fixes to omit GL-dependent targets and fix assumptions that
SK_SUPPORT_GPU implies SK_GL.

Bug: skia:10051
Change-Id: Ida88ac3f1bf4d9e23f66d0700c2bce18b938ed6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277456
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-18 14:26:28 +00:00
Michael Ludwig
cd01979004 Refactor GrMemoryPool into reusable GrBlockAllocator
This moves the byte block linked list structure outside of GrMemoryPool
into a new type, GrBlockAllocator. This new type is solely responsible
for managing the byte blocks, tracking where the next allocation
occurs, and creating/destroying the byte blocks. It also tries to
encapsulate all of/most alignment related math, while making it
convenient for clients to add per-allocation padding/metadata.

It has added functionality compared to the original block linked list
that was embedded in GrMemoryPool:
 - Supports resetting the entire allocator
 - Supports resizing the last allocation
 - Is able to rewind an entire stack of allocations, instead of just the
   last allocation.
 - Supports multiple block growth policies instead of just a fixed size.
 - Supports templated alignment, and variable alignment within a single
   GrBlockAllocator
 - Query the amount of available memory
 - Performs as much math as possible in 32-bit ints with static asserts
   that ensure overflow won't happen.

Some of this flexibility was added so that the GrBlockAllocator can be
used to implement an arena allocator similar to SkArenaAlloc, or to
replace the use of SkTArray in GrQuadBuffer. It is also likely possible
that GrAllocator can be written on top of GrBlockAllocator. I will try
to perform these consolidations in later CLs.

Change-Id: Ia6c8709642369b66b88eb1bc46264fb2aa9b62ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262216
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-17 14:41:14 +00:00
Herb Derby
3b946c1618 Check fullness and purge on every strike lookup
In the old code, the cache was checked and perged on every reattach
of a strike. That was left out of the multi-threaded code. Add the
check and purge back in to maintain cache size.

* Removed minimum cache size from setCacheSizeLimit.

Bug: skia:10046
Change-Id: I2438c83f04b6da8133c161a29604c3c3d7f58cd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277066
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-16 19:59:56 +00:00
Mike Klein
a30aeae875 impl SkTDynamicHash with SkTHashTable
The only vaguely tricky thing to adapt from templating on T to T*.

Don't think there's a need for the unit tests now right?

Bug: skia:9703
Change-Id: Ib8fcebd9e0e35bea5ef23e6fd5962654a28d587b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277214
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-16 19:59:26 +00:00
Greg Daniel
c52968170d Fix CompatibleCoverageAsAlpha flag when reducing src-over to src.
Change-Id: I087ff64e0f23aee15ac2bf7b9d3c450e28400cef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274036
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-28 18:45:15 +00:00
Dominic Mazzoni
2a016bad67 Allow passing multiple node IDs per PDF structure node.
At the time Chromium is painting, we're passing node IDs
along with painting commands to enable tagging. However,
this assumes that all nodes will end up in the structure
tree, which we might not want.

Instead, allow the client to prune the structure tree
later before telling Skia to generate the PDF, but
keep all of the node IDs to be matched up with.

As an example, suppose the doc looks like this:

root id=1
  paragraph id=2
    div id=3
      text1 id=4
    link id=5
      text2 id=6

The pruned tree passed to Skia would look like this:

root id=1
  paragraph id=2 extra_ids=3,4
    link id=5 extra_ids=6

We need to pass the extra node IDs into Skia so
that when content is tagged with id=4, we know to
map that to the paragraph node with id=2 instead.

Note that the resulting PDF document will *not*
have any of these extra IDs, they're all remapped
and consolidated.

While it's not strictly necessary that this is done
in Skia, it's easiest to implement it here. Doing the
same upstream would require replaying an SkPicture
and rewriting all of the node IDs.

Bug: chromium:607777
Change-Id: I0ecb62651e60b84cc5b9d053d7f7d3b9efda1470
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272462
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
2020-02-24 18:21:16 +00:00
Dominic Mazzoni
7dfb46e7f3 Re-land: Support adding attributes to PDF document structure nodes.
Originally landed: https://skia-review.googlesource.com/c/skia/+/268878
Reverted: https://skia-review.googlesource.com/c/skia/+/271858

The issue was with compilation when PDF support is disabled. See
the diff between patchsets 1 and 2.

This is an important part of writing a tagged PDF. Many of the nodes
in the document structure tree need additional attributes, just like
in HTML.

This change aims to add support for a few useful attributes, not to
be comprehensive.

Bug: chromium:1039816
Change-Id: I15f8b6c41d4fdaa4b6e21775ab6d26ec57eb0f5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271916
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-19 20:50:14 +00:00
Mike Reed
86b4388fdc Revert "Support adding attributes to PDF document structure nodes."
This reverts commit 80474156d1.

Reason for revert: breaking chrome roll

https://ci.chromium.org/p/chromium/builders/try/cast_shell_linux/533554

Original change's description:
> Support adding attributes to PDF document structure nodes.
> 
> This is an important part of writing a tagged PDF. Many of the nodes
> in the document structure tree need additional attributes, just like
> in HTML.
> 
> This change aims to add support for a few useful attributes, not to
> be comprehensive.
> 
> Bug: chromium:1039816
> 
> Change-Id: I64a6b36b0b4ec42fd27ae4ad702afce95c95af5d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268878
> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,reed@google.com,dmazzoni@chromium.org,dmazzoni@google.com

Change-Id: Iedd397303e870144e8d282db0cb81c535a783e8b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1039816
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271858
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-19 14:23:31 +00:00
Dominic Mazzoni
80474156d1 Support adding attributes to PDF document structure nodes.
This is an important part of writing a tagged PDF. Many of the nodes
in the document structure tree need additional attributes, just like
in HTML.

This change aims to add support for a few useful attributes, not to
be comprehensive.

Bug: chromium:1039816

Change-Id: I64a6b36b0b4ec42fd27ae4ad702afce95c95af5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268878
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-02-18 18:14:36 +00:00
Herb Derby
81e84a6e7f Make SkStrikeCache::Node be SkStrike.
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>
2020-02-15 16:37:58 +00:00
Herb Derby
251eff6f1f Multithread SkStrike test
Change-Id: Id034c7fb35e1c0d6ae70a19d612b955d25c570af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269900
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-02-12 21:36:57 +00:00
Brian Salomon
94724c6594 Fix GrColorMatrixFragmentProcessor handling of premul transparent black.
Use the original alpha in the unpremul color.

Bug: chromium:1024935
Change-Id: I6a721431781f0ef42a3f162d39f8bbac924a2c30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261680
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-02 14:55:06 +00:00
Brian Osman
088913a63b Start adding unit tests of SkRuntimeEffect
- Change SkRuntimeEffect::Make so *it* can fail, and returns
  [Effect, ErrorText].
- Initial tests just test for expected failure conditions.
  Next steps are to add tests for effects that should work,
  and to validate results on CPU and GPU.

Change-Id: Ibac8c3046104577434034263e9e4a4b177e89129
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261095
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-20 14:15:06 +00:00
Robert Phillips
3e5e2f2c95 Add test for the GrContext::createCompressedBackendTexture API
Bug: skia:9680
Change-Id: Ib51613e6bacb36ff59b2e1e3c3cf13221d0382fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261083
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-12-19 16:48:09 +00:00
Nathaniel Nifong
20b177a9bf Parse android layer annotations in debugger, play back layers
Bug: skia:9626
Change-Id: I3ae8fa83520690f9af534e9ab0b70834d7890fb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256100
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-12-12 16:32:44 +00:00
John Rosasco
24cbdab97e SKQP Build for Fuchsia SDK
Change-Id: I2619784eca0f7a4dd66f2db0104cb746d9266b4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244369
Commit-Queue: John Rosasco <rosasco@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-18 12:34:28 +00:00
Robert Phillips
e837e61b5a Respect the max indexBuffer limits in the bulk texture draw API (take 2)
This is required before we can lower the max AA quad count (again).

Bug: b/143572065 skia:9601
Change-Id: Ibd029a59f6589e1ae6c66d072e5039f0e9de06dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254581
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-15 16:57:33 +00:00