We already do this for cached SkSurface snapshot images. However,
sharing the SkPixelRef among any SkImage_Rasters with different
SkMipmaps interacts badly with SkImage texture caching and likely
other image caches.
Bug: skia:11983
Change-Id: I07bb7a93ffb79afb7f8268cd5159ee22f58da1e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526456
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:13114
Change-Id: I653ab746927abdd1491e070e2e27252bf056d233
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526024
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This fixes a bug with the following sequence:
Make SkSurface_Raster, draw to it
snap an image, A, from the surface
make image B by calling withDefaultMipmaps() on image A
Let image A be destroyed.
draw to surface again
snap another image, C, from the surface
Image C and image B would now share the same SkPixelRef, reflecting
the final contents of the SkSurface.
Add a GM that exercises the bug when run through either the pic- or
serialize- vias and DDL.
Bug: skia:13111
Change-Id: Ib079163c84f420baf62fa7960110386303b8fb93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525517
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
SkSL::Operator was previously just a thin wrapper around Token::Kind and
everything was therefore written in terms of Token. Since Token is not
accessible from include/ (and we don't want it to be), this creates an
actual Operator enum and eliminates the dependence on Token. This will
enable followup changes to reference Operator from within the DSL
include files.
Change-Id: I49555c9151618fd15970a303d2284972c78c3f21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525976
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Icc6d1345c59d6f6529db39bf4b5bd8097f1f6b5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525837
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This should fix many issues that Chrome is seeing. The problem is the
picture recorder had no idea about Slug, so the canvas super class
would try to use the device to draw. This hooks up the recorder
to capture drawSlug into the picture.
I tested this with a specialized gl sink in DM which I'm struggling
to check in. But, it was functional enough to show that this works.
Bug: chromium:1302036
Bug: chromium:1307279
Bug: chromium:1306329
Bug: chromium:1307446
Change-Id: I6a27bf43702400c80b2044433e7b00347f522763
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525636
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12845
Change-Id: If3ac2b6ba2c8e28328ee5805a29fc83353220364
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524756
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
No visible effect yet, but this will enable better error reporting in a
future CL.
Change-Id: I09e1c5d3bb423a7ce42701f15c4bb142b0a9473c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524638
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Most of these are pretty mechanical generated changes.
IWYU noticed one issue with DSLCore.h, which was fixed here.
Change-Id: I5629565ad3c2817daa71907c62f932d93f9d78ab
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524617
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This adds a way to build a wrapping canvas for testing that is allowed
to manipulate the internal state of the canvas. It provides a way
to add friends to SkCanvas without having to change SkCanvas.
Change-Id: I40de8b236ba5acff45b3a8f7e440dcf6fa196fcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524316
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
SkTArray::reset() got rid of any reserved space, so previously we never
actually got to a high-water allocation. Updated the stack to use
SkTDArray just for consistency so we only had to include that instead of
<vector>, too.
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite
Change-Id: I94c9a38d0e630c7d7f1a3eeeb85076067e066a2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12974
Change-Id: I15b090e2c3346d71ccf45d5f0d306da3f079821e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is needed for accurate error reporting when we start reporting
ranges rather than line numbers.
Change-Id: If465317e04685e91ab7c408d29e82028b5d59d1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523425
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:13078
Change-Id: If459a96eba09fb10e967bc364435f79b83fdc1ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522099
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: Ic88b400f7943804481934ba2c9c54aeb8e04121b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523656
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Change-Id: I2ee0fd8d208bb10e011a5552a60a1a62d7a56ba9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522423
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This is a reland of commit 171450a1a0
Original change's description:
> Add glGetFloatv and glSamplerParameterf to GrGLInterface.
>
>
> Bug: skia:13036
> Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:13036
Change-Id: Id594ea5fd68c76703ff61d8414c203facbf28801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522359
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
PS1 regenerates the Bazel files. Use it as the base change when
comparing patchsets.
IWYU seems to do a good job of working with MyFile.cpp and
MyFile.h, but if there is just a MyHeader.h, it doesn't always
seem to throw errors if the includes aren't correct. This was
observed with include/sksl/DSL.h This might be due to the fact
that headers are not compiled on their own, so they are never
sent directly to the IWYU binary.
This change sets enforce_iwyu_on_package() on the all sksl
packages and then fixes the includes until all those checks
are happy. There were a few files that needed fixes outside
of the sksl folder. Examples include:
- src/gpu/effects/GrConvexPolyEffect.cpp
- tests/SkSLDSLTest.cpp
To really enforce this, we need to add a CI/CQ job that runs
bazel build //example:hello_world_gl --config=clang \
--sandbox_base=/dev/shm --features skia_enforce_iwyu
If that failed, a dev could make the changes described in
the logs and/or run the command locally to see those
prescribed fixes.
I had to add several entries to toolchain/IWYU_mapping.imp
in order to fix some private includes and other atypical
choices. I tried adding a rule there to allow inclusion of
SkTypes.h to make sure defines like SK_SUPPORT_GPU, but
could not get it to work for all cases, so I deferred to
using the IWYU pragma: keep (e.g. SkSLPipelineStageCodeGenerator.h)
Change-Id: I4c3e536d8e69ff7ff2d26fe61a525a6c2e80db06
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522256
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:13051
Change-Id: I13cdb1b625f65e6d15d3b59ba493897ed88b24c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521005
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This adds an assert to Position::line() to ensure that we don't run
past the end of the source string. Since the source string can
contain embedded nulls, we also switch the source handling from
const char* to std::string so we can accurately determine its length.
Change-Id: I9df47e98c1a0cbc35222a0ea709d9403762210d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521656
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
By setting the compile time flag:
SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_STRIKE_SERIALIZE
will cause all SkTextBlobs to be rendered by analyzing the Slug
to create strike cache differences and serialize the Blob to a Slug.
Then the serialized strike cache differences are used to populate
the strike cache using a different TypefaceIDs using SkTypeface_Remote
as a proxy for the real SkTypeface. This will create a hard break
between the original glyph data, and the proxied glyph data.
It will then deserialize the Slug doing TypefaceID translation to
the SkTypeface_Remote, and draw the unflattened Slug.
Bug: chromium:1278340
Change-Id: I0f1980dee966b1092a99741793aed9d138451f4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510228
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Chrome uses a picture to manage some of their drawing in the GPU
process. This CL serializes GrSlugs into an SkPicture, and to
draw from that picture. Pictures with GrSlugs can not be stored;
they must be created and played back directly. In addition, the
SkStrikes used by the slugs must be pinned in the SkStrikeCache.
Bug: chromium:1302036
Change-Id: I19fa9c06c08f64ad066326e90bc6425dd90b3342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514360
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This will use the recently added Bazel toolchain feature
to enforce proper includes for all files in //src/svg/...
In the future, I envision a CI/CQ job that will run
bazel build with a few different configurations and the
--feature skia_enforce_iwyu on to make sure we don't
regress.
Change-Id: Ibb9f816ab626415c11bd2b9b74c503297c4b0723
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521036
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
PS1 regenerates the Bazel files.
It is recommended to review this CL with a diff from PS1.
Example output when a file does not pass the test:
tools/sk_app/CommandSet.h should add these lines:
#include "include/core/SkTypes.h"
#include "include/private/SkTArray.h"
#include "tools/skui/InputState.h"
#include "tools/skui/Key.h"
#include "tools/skui/ModifierKey.h"
namespace sk_app { class Window; }
tools/sk_app/CommandSet.h should remove these lines:
- #include "tools/sk_app/Window.h"
The full include-list for tools/sk_app/CommandSet.h:
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/SkTArray.h"
#include "tools/skui/InputState.h"
#include "tools/skui/Key.h"
#include "tools/skui/ModifierKey.h"
#include <functional>
#include <vector>
class SkCanvas;
namespace sk_app { class Window; }
---
This makes use of Bazel's toolchain features
https://bazel.build/docs/cc-toolchain-config-reference#features
to allow us to configure compiler flags when compiling
individual files. This analysis is off by default, and can
be turned on with --features skia_enforce_iwyu. When enabled,
it will only be run for files that have opted in.
Example:
bazelisk build //example:hello_world_gl --config=clang \
--sandbox_base=/dev/shm --features skia_enforce_iwyu
There are two ways to opt files in:
- Add enforce_iwyu = True to a generated_cc_atom rule
- Add enforce_iwyu_on_package() to a BUILD.bazel file
(which enforces IWYU for all rules in that file)
Note that Bazel does not propagate features to dependencies
or dependents, so trying to enable the feature on cc_library
or cc_executable targets will only impact any files listed in
srcs or hdrs, not deps. This may be counter-intuitive when
compared to things like defines.
IWYU supports a mapping file, which we supply to help properly
handle things system headers (//toolchain/IWYU_mapping.imp)
Suggested Review Order:
- toolchain/build_toolchain.bzl to see how we get the IWYU
binaries into the toolchain
- toolchain/BUILD.bazel and toolchain/IWYU_mapping.imp
to see how the mapping file is made available for
all compile steps
- toolchain/clang_toolchain_config.bzl, where we define the
skia_enforce_iwyu feature to turn on any verification at
all and skia_opt_file_into_iwyu to enable the check for
specific files using a define.
- toolchain/clang_trampoline.sh, which is the toolchain is
configured to call instead of clang directly (see line 83
of clang_toolchain_config.bzl). This bash script used to
just forward all arguments directly onto clang. Now it
inspects them and either calls clang directly (if
it does not find the define in the arguments or we are
linking [bazel sometimes links with clang instead of ld])
or calls clang and then include-what-you-use. In all cases,
the trampoline sends the arguments to clang and IWYU
unchanged).
- //tools/sk_app/... to see enforcement enabled (and fixed)
for select files, as an example of that method.
- //experimental/bazel_test/... to see enforcement enabled
for all rules in a BUILD.bazel file.
- all other files.
Change-Id: I60a2ea9d5dc9955b6a8f166bd449de9e2b81a233
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519776
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Change-Id: I677ad3073725219897bec9f82d88ad3ba3fedb53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521002
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This CL switches almost all instances of line tracking over to track
Positions instead. This does not yet add full range support - only the
start offsets will be correct currently. Followup CLs will extend the
ranges to fully cover their nodes.
Change-Id: Ie49aee02f35dcb30a3adb8a35f3e4914ba6939d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518137
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:12845
Change-Id: Ic036dea6b58682a6463f8c34d915730c4bfe677b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519617
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I1fa160941b18392616708f4e08a4ebbf7398480e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518521
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
PS1 regenerates BUILD.bazel files
I suggest reviewing the deltas between PS1 and the latest
PS to focus on the interesting bits.
The changes here allow for a Vulkan-only build of HelloWorld
based on sk_app. The toughest change was properly fetching
the VisualID after removing the gl calls that used to
fill that in.
There are a few changes that fix resolution of Dawn
header files, but those won't actually be built until
a follow-on CL.
Change-Id: I54fb58b5dd7ecd4313562aed401759b3eaed53c0
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516999
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This was motivated by SkScalerContextFlags putting `kNone` into the
global namespace. Instead of adding a suffix, change these internal
enums to be scoped and update the users.
Because SkScalerContextFlags is used like a bitfield,
`SK_MAKE_BITFIELD_OPS` is used to provide the appropriate operators. The
macro implementation is updated to handle scoped enums, remove the very
dangerous, unwanted, and unused templated operators, and add operator~
since that is needed by one existing user.
Also, for some reason this allows the compiler to find an unused field
which is removed.
Change-Id: Id31c80b381bffaf9b623f6a8ec7d86751d3d99f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
ag/16935648 added a method to detect the color depth of R/G/B channel
for input sources. This change does the following: (1) call this new method and default
SkAndroidCodec to 1010102 for 10-bit images; (2) add color-depth to
SkEncodedInfo.
Change-Id: I3ede4a7a6223da2d4c075403d6ee280db086e0be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512076
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
When deserializing an SkSL shader, it's possible to encounter code that
doesn't compile (particularly from the last year, when syntax tweaks
were being made). By default, we still treat this as an error and fail
to load the SKP. In the SKP debugger, though, we add a lenient mode that
permits these failures. If any of the children were SkShaders, we
instead return that. If all else fails, we just return nullptr, which
will cause the triggering draw to use a solid paint-color, but at least
allow the SKP to be loaded and viewed.
For color-filters and blenders, we allow malformed SkSL, but always
return nullptr.
The bug that prompted this change involved Android's overscroll stretch
shader, where this approach works particularly well (it turns the
stretch into a simple pass-through of the underlying content).
Change-Id: I756c694739d31b11efa1b82c126f34440a7de66a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515543
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We seem to save about 1K of code size each time an unordered_set/map is
replaced.
Change-Id: I7e04076d470e6c7ad4ae8301ded231ae69168bc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515361
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This will allow us to easily replace unordered_set/unordered_map in more
places.
Change-Id: Ic0b5245e8cdce2918d7b043bfc370eca95caf889
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515319
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This will allow these types to be used as the key in an SkTHashSet/Map
without providing a custom Traits class.
Change-Id: I41bfc1d43f3909d3653b4f12ac39e2a288235052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515356
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:12845
Change-Id: Ib0b87966b1559b368759ce69c48f0fd27597503a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514836
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Also adds in asView for texture-backed Image as well as stubs for
other Image types.
Bug: skia:12845
Change-Id: I58a90068d4d151ad35f411b08c8484c740253722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507336
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I9ee142f949e644dcd06f359bb6838b5b4f04ec21
Bug: skia:12990
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513736
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
In order to extract the PNG files produced by our CanvasKit gms,
we need our JS tests to POST them to a server which can write to
disk. The easiest way to do this is to use the test_on_env
rule defined in the Skia Infra repo for exactly this purpose.
This required https://skia-review.googlesource.com/c/buildbot/+/510717
to be able to configure the binary correctly and
https://skia-review.googlesource.com/c/buildbot/+/511862, for nicer
debugging so the skia-infra dep was updated via the following commands:
$ go get go.skia.org/infra@d8a552a29e
$ go mod download
$ make -C infra/bots train
$ make -C bazel gazelle_update_repo
This caused many automated changes to infra/bots/tasks.json
The flow is:
1. User types bazelisk test :hello_world_test_with_env
2. The test_on_env rule starts gold_test_env and waits
for the file defined in $ENV_READY_FILE to be created.
3. gold_test_env starts a web server on a random port. It
writes this port number to $ENV_DIR/port. Then, it
creates $ENV_READY_FILE to signal ready.
4. test_on_env sees the ready file and then starts the
karma_test rule. (Reminder: this is a bash script
which starts karma using the Bazel-bundled chromium).
5. The karma_test rule runs the karma.bazel.js file (which
has been injected with some JS code to fill in Bazel
paths and settings) using Bazel-bundled node. This reads
in the port file and sets up a Karma proxy to redirect
/gold_rpc/report to http://localhost:PORT/report
6. The JS tests run via Karma (and do assertions via Jasmine).
Some tests, the gms, make POST requests to the proxy.
7. gold_test_env gets these POST requests writes the images
to a special Bazel folder on disk as defined by
$TEST_UNDECLARED_OUTPUTS_DIR.
8. test_on_env identifies that the tests finish (because the
karma_test script returns 0). It sends SIGINT to gold_test_env.
9. gold_test_env stops the webserver. The special Bazel folder
will zip up anything inside it and make it available for
future rules (e.g. a rule that will upload to Gold via goldctl).
Suggested Review Order:
- bazel/karma_test.bzl to see the test_on_env rule bundled into
the karma_test macro. I chose to put it there because it might
be confusing to have to define both a karma_test and test_on_env
rule in the same package but not be able to call one because it
will fail to talk to the server.
- gold_test_env.go to see how the appropriate files are written
to signal the environment is ready and the handlers are set up.
- karma.bazel.js to see how we make our own proxy given the
port from the env binary. The fact that we could not create
our own proxy with the existing karma_test rule was why the
chain ending in https://skia-review.googlesource.com/c/skia/+/508797
had to be abandoned.
- tests/*.js to see how the environment is probed via /healthz
and then used to make POST requests with data.
- Everything else.
Change-Id: I32a90def41796ca94cf187d640cfff8e262f85f6
BUG: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510737
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Cq-Include-Trybots: luci.skia.skia.primary:Canary-G3
Change-Id: Iebd4aaec098b6bf2e863d0c93d7fd826d3ec0edc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512724
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
PS1 is the automatic regenerated changes.
PS2-3 adds an #ifdef guard to the addToKey method on shaders.
The SkShaderCodeDictionary class helps generate SkSL and is
only necessary when we are building with SkSL (gpu builds and
cpu builds with SkVM).
Suggested Review order:
- Use Gerrit to diff PS 1 and the last PS
- src/core/BUILD.bazel adds some sources to the "only
necessary if sksl is enabled" bucket
- All the .cpp and .h files to see the #ifdef is added
correctly.
Change-Id: I4d4ce61a4957ef1e0840204acff08ce7e616f9cb
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512157
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This is a reland of 0596094b81
Original change's description:
> Remove skstd::optional entirely.
>
> Change-Id: Id9862712ea3e769797abd654922879ce6bc4487c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504976
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: Ie5bae44de729aabe50c4e51ad3c7cc476fbc5dc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512358
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SkCanvas::fMCStack uses SkCanvas::fMCRecStorage for storage, and will
access it in the destructor. Reorder the fields so that fMCStack is destroyed
before fMCRecStorage.
Change-Id: Ie09b9b52820d2dec4b75552dc5c2349b845a01ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509536
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
These weren't used and added complexity to the dependency graph.
Change-Id: I7e97d73d520b7123e534485d7840538d6b468c48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512145
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
SkTArray.h uses std::max() which is part of <algorithm>.
Some libc++ changes have stopped exporting <algorithm> from certain headers, causing skia to break with ToT libc++.
2e2f3158c6
Change-Id: Iee4e00b3b3a6cbe2c1881453d05c0658e95a767b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512016
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Auto-Submit: Arthur Eubanks <aeubanks@google.com>
Reviewed-by: Erik Rose <erikrose@google.com>
Commit-Queue: Erik Rose <erikrose@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Switch to using the public API similar to SkTextBlob for
serialize/Deserialize. Add deserializeSlug to SkStrikeClient.
Bug: chromium:1278340
Change-Id: I91b93487859c662e3bfdfba49ba4758f13529cd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511601
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This CL using GPU draws every TextBlob by converting it to a
Slug, flattening the Slug, unflattening the Slug to a dstSlug,
and then uses the dstSlug to draw the TextBlob.
Since only DirectMask sub runs are working I have disabled some
code to all empty sub runs. This will be restored in the final
version.
This adds a compile-time flag to control this behavior:
SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_SERIALIZE
Bug: chromium:1278340
Change-Id: I7674593b0d6e1f871e1c526af76407a1977a8836
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510419
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I78fd07c10a8dd3ff76b6040109afdf4b47b69eb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510656
Reviewed-by: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
This reverts commit f436cf2343.
Reason for revert: May need to be behind flag or more
suppressions. Breaking linux-rel vulkan_swiftshader_blink_web_tests
css3/filters/effect-blur-hw.html .
Original change's description:
> Preserve base device origin on saveLayer and image filters
>
> SaveLayerOriginTest taken from https://skia-review.googlesource.com/c/skia/+/277977
>
> Bug: skia:12732
> Change-Id: I5ce75355bb16237043c229e1cbc7a106eb636d18
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508919
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12732
Change-Id: I74cc8dc279d22c4fbd313ae3caeb4d0748daf003
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510196
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Co-authored with Ben Wagner, bungeman@google.com.
Similar to how we allow configuration of variable font configurations,
provide additional SkFontArguments to select a base palette and a set
of potentially sparse color overrides.
This is required for implementing CSS font-palette.
Modify the more_samples-glyf_colr_1.ttf to have two additional palettes,
and two additional test glyphs, one that draws with COLRv0 logic, one
that draws with COLRv1 logic and has a foreground palette index dot
in the middle. See [1] & [2] for the additions to the test font.
Add a GM which tests this on the SkFontMgr_custom using makeClone() and
makeFromStreamArgs(). The test displays the two glyphs in default
palette on the left, then with palette overrides (as in the title of the
test) on the right. The first row uses a typeface created with
makeFromStreamArgs(), the second uses one created with makeClone().
[1] https://github.com/googlefonts/color-fonts/pull/91
[2] https://github.com/googlefonts/color-fonts/pull/92
Bug: skia:12730, chromium:1170794
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_NativeFonts,Test-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-NativeFonts
Change-Id: Ia1334f069240edc78fd4791969914e8a6f4fbaf9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479616
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: skia:12845
Change-Id: Ia03293c4efdad4c5381a713c9d7d4857b79530c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509398
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
I don't have serialization working yet, but I have enough of the
plumbing to sketch out an API. It seems simplistic, but notice it
requires access to the SkStrikeClient.
Change-Id: I29f046b62f20c635cee86f0666e8112ac3097f16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507837
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Destroying a mutex while it is held is never valid, and can be extremely
hard to debug.
Change-Id: I42ff79de7892006337f204621ff59bf84112dcd7
Bug: skia:12943
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507998
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
An important part of serialization for slugs is maintaining the
translation of typefaceIDs from the renderer side to the GPU side.
Expose the translation code so that the slugs can use it.
Change-Id: I78ded1967759619a95fb13a1577cee3569927471
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12643
Change-Id: Id5eecb3445082e747def8c87f99a16552857af3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506462
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a reland of 3225c8cc46
Original change's description:
> Add kR8_unorm_SkColorType
>
> Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I73fa17625d57e0e58da1b70e2e59ba200383cfe7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506460
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
PS 1 is re-generating existing BUILD.bazel files
PS 2 is generating BUILD.bazel files for tests/gms
PS 3+ makes modifications to build all of the gms and tests.
It is recommended to view this CL with just a diff between
PS 2 and the end, due to the large amount of generated changes
in PS 1 and 2.
We make a filegroup for the gms and tests because they need
to be compiled as one large blob in order for the registries
to work. Maybe in the future we will break these up, but at least
for WASM/JS, the overhead of starting a browser for each new
test would likely grind things to a halt, so we just group them
all together for now. It's also the most similar to what we
currently do.
In gm/BUILD.bazel and tests/BUILD.bazel, we add a cc_library
that encapsulates all of the deps of the tests, so we can
easily include that the build. These were discovered via
trial and error, not anything automatic or systematic.
The is_skia_dev_build config_setting is very similar to the
GN equivalent from which it was based.
The list of gms and tests to skip (e.g. which are incompatible
with WASM) was determined by building the wasm bundle:
modules/canvaskit$ make bazel_gms_release
tools/run-wasm-gm-tests$ make run_local_debug
# Don't forget to click the button on the screen after the
# browser loads
This way of invoking the tests will be replace soon with
`bazel test <something>`. As such, I didn't bother fully
documenting the current way.
Suggested review order:
- modules/canvaskit/BUILD.bazel taking note that we always
use profiling-funcs to make the stacktraces human readable.
- gm/BUILD.bazel and tests/BUILD.bazel to see the lists of
gms/tests. Notice the tests are roughly partitioned because
we don't support things like vulkan/PDF in the wasm build
and we will want a way to not build certain tests for
certain configurations
- tools/* noting some of the cc_libraries added to make
dependencies easier to add when needed.
- All other files.
Change-Id: I43059cd93c28af1c4c12b93d6ebd9c46a12d381f
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Create canonical flattening for SkDescriptor and unflattening
for SkAutoDescriptor.
Eventually Slug serialization and the remote glyphs cache will use
this method for SkDescriptor serialization.
Change-Id: Ia4b6be43058aeca19fbfdcf3c5cdd8d703935775
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505681
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
The goal was to enable -Wzero-as-null-pointer-constant. Unfortunately,
this was thwarted by VK_NULL_HANDLE which is defined as 0ULL in the
Vulkan headers. It might be possible to enable the warning for a subset
of Skia, but not for the parts which interface with Vulkan.
Change-Id: Id27f5f57d9b2676d18f319f443fdf8bb5d4fb89d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
When static is used, this triggers a warning which we currently have
disabled, -Wunused-template ("unused function template SkTAfter").
There doesn't seem to be any benefit to adding static here. See
https://stackoverflow.com/a/30863380/291737 for a brief explanation.
Unfortunately this doesn't quite allow us to enable the warning, as
we have some static member functions that also trigger the warning.
Change-Id: I7198bdc1bff2bdd5a090ee2b2d5520baa5e4b9e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
There is no need for these headers to be in include/private:
SkPaintParamsKey.h
SkShaderCodeDictionary.h
Added the new header:
src/core/SkBuiltInCodeSnippetID.h
Bug: skia:12701
Change-Id: I413e9a21bc26d5df48765d16dd7390e324006368
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505197
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The plumbing necessary to allow glyphs to have an associated drawable.
The TestSVGTypeface is updated to produce drawables for testing.
Bug: skia:12121
Change-Id: I475a1bfc27bf11e732e18bed3c1a9593e7c901cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413438
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Namely, SkShaderInfo. This doesn't do anything interesting yet. The ShaderCodeDictionary stores the snippets and then a PaintParamsKey can be traversed to collect the snippets in an SkShaderInfo. Gluing them together will be next-ish.
Bug: skia:12701
Change-Id: Icb4b41716592fc119778ae08f84565da9acaf202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503822
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
At some point we'll need to go through the dictionary for user provided SkSL
Bug: skia:12701
Change-Id: I484ae30626dad64f2bce1e0948071380d9f8282e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504596
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 0596094b81.
Reason for revert: Flutter somehow still references skstd::optional
flutter_engine in google3 still has old code:
http://screen/BHDrjqwzchdFVfQ
Original change's description:
> Remove skstd::optional entirely.
>
> Change-Id: Id9862712ea3e769797abd654922879ce6bc4487c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504976
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: Idea391399c2e11b83d5a130023adb340d40cadcb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505396
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Change-Id: Id9862712ea3e769797abd654922879ce6bc4487c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504976
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: Ifb387d315fdd083190128f448aadb3e54c4e3369
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505198
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Allow users to retrieve the stream from an SkTypeface, but only if that stream is inexpensive to create.
Bug: https://github.com/flutter/flutter/issues/97384
Change-Id: I9bab1a775273363500cf7482f1babeee75c5a3df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503349
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
This shook out a handful of formatting issues:
[SkVMVisualizer]
- We were passing plain text like "width:35%;" through printf.
- One particular opcode type was printing a string as a number.
[Skottie, SortToy]
- Used wrong integer type instead of %zu for size_t
This CL does not update print functions which take printf arguments via
variadic template, as __attribute__((format)) does not support this
style. These could be converted to va_list style, but that's not done in
this CL.
(For some reason, GCC requires the attribute to be set on a prototype
for freestanding functions, so a few of these now have a prototype
immediately followed by a declaration.)
Change-Id: I63a6c2486c785cc38563028fdf8df0662ec04935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504698
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This also moves the creation of the ResourceProvider from Context into
Recorder so that we can share the SingleOwner object.
Bug: skia:12754
Change-Id: I97f5c8bf86f86835582a78250acb929722f26688
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504478
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
PS 1 regenerates existing Bazel files
PS 2 adds generated Bazel files to skottie and its dependencies,
as well as incorporating it into CanvasKit.
This changes the version of Bazel we use to 5.0.0 (recently
released).We had been using a pre-release of 6.0 because we
wanted the new features in one of the 5.0 release candidates,
but not the regression that was there (and reverted before the
full 5.0 release). I'd like to stick to the latest stable Bazel
release where possible.
Suggested Review Order:
- //modules/skottie/BUILD.bazel (this was hand written
to encapsulate the skottie library). The files in the
deps are based on skottie.gni.
- //modules/skresources/BUILD.bazel and //modules/sksg/BUILD.bazel
which expose all sources
- //third_party/file_map_for_bazel.json which ignores the
ffmpeg libraries (we won't actually build the SkVideoDecoder
stuff because HAVE_VIDEO_DECODER is not set).
- //modules/canvaskit/BUILD.bazel which makes use of the skottie
library and includes the interface skottie.js file.
- .bazelversion which changes the Bazel version used (e.g. by
Bazelisk).
- All other changes should be auto-generated or related to
deleted files.
Change-Id: Ic26f9a9dea5310f2cbd9cda7d701847924a39a22
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503828
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
The float/double versions of skstd::to_string produce better output than
the standard version, so let's keep those.
Other versions of to_string don't do anything at all now that
SkSL::String no longer exists. (Previously they existed to convert the
return type from std::string to SkSL::String.) We can just use the
std::to_string functions directly.
Change-Id: Ief513e474bd47ed97f1c13f4f64fb161f1654065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503832
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We can use the native C++17 versions going forward, if we need them.
Change-Id: I53be7ed4ec72602b978c1dad252dff7be9e0f392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503823
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a reland of d921f21fbc
Original change's description:
> Add SkSurface resolve function.
>
> This will insert a resolve msaa call into the stream of commands for
> the SkSurface. This is mostly useful for cases when a client wraps the
> resolve texture but has Skia draw with MSAA, and the client wants to
> make sure Skia resolves to their wrapped texture.
>
> Bug: chromium:1292418
> Change-Id: I6eddae967136716b9215fcd96e7d77a2457efdf2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503340
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: chromium:1292418
Change-Id: I810b5618092c560f5bba900024b3b8c0c88baea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503717
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is a reland of 995d16fc91
Original change's description:
> For runtime shaders, deduce isOpaque automatically
>
> The forceOpaque parameter is now ignored. Instead, we do a conservative
> analysis of the shader's main function to determine if it always returns
> an opaque color. This is good enough to detect simple cases, including
> things like:
>
> return child.eval(p).rgb1
>
> Bug: skia:12643
> Bug: skia:12896
> Change-Id: I74b331aa12fadb1d0d1bb85f225dc7aa01ba2455
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503346
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12643
Bug: skia:12896
Change-Id: I4ae55cdd3f88c1b5a08bd59913df1c1cd48a4679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503824
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
A glyph cache entry is made up of metrics, an image, and a path. If an
entry does not exist then nothing is known of the glyph yet. If there is
an entry it must have at least the metrics. The image and the path may
logically be added lazily as needed. Prior to this change it was not
possible to send both the image and the path of a single glyph. The
added test fails when a given strike is used for both the image and the
path. With this change the test passes, as the image is sent and the
path is sent, and both are merged into the remote glyph. The assertions
around not creating the glyph more than once are replaced with
assertions that no part of the glyph is set more than once.
Change-Id: I2fd4047ee15e0d584b68e1180c6fe15224889310
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503347
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 995d16fc91.
Reason for revert: Breaks one SkSL test on ANGLE
Original change's description:
> For runtime shaders, deduce isOpaque automatically
>
> The forceOpaque parameter is now ignored. Instead, we do a conservative
> analysis of the shader's main function to determine if it always returns
> an opaque color. This is good enough to detect simple cases, including
> things like:
>
> return child.eval(p).rgb1
>
> Bug: skia:12643
> Bug: skia:12896
> Change-Id: I74b331aa12fadb1d0d1bb85f225dc7aa01ba2455
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503346
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12643
Bug: skia:12896
Change-Id: I7d86933f29ddb373222dff7f2a28a413fd777002
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503818
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
The forceOpaque parameter is now ignored. Instead, we do a conservative
analysis of the shader's main function to determine if it always returns
an opaque color. This is good enough to detect simple cases, including
things like:
return child.eval(p).rgb1
Bug: skia:12643
Bug: skia:12896
Change-Id: I74b331aa12fadb1d0d1bb85f225dc7aa01ba2455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503346
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The previous CLs have removed the last significant differences between
SkSL::String and std::string. This CL removes SkSL::String entirely and
replaces it with std::string throughout the code.
Apologies for the very long CL, but I have done my best to make it as
simple and reviewable as possible. The vast majority of changes are
simple replacement of `SkSL::String` with `std::string`. In the rare
spots where code is moved from one place to another, it is logically
unchanged.
Change-Id: I39563d2db45da229f17f4504dfd63e00bde7a96e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503339
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
std::string unfortunately does not have a `string + string_view`
plus operator. (https://stackoverflow.com/q/44636549/291737)
This brings SkSL::String one step closer to matching std::string's API.
Change-Id: I44fd4538a9433442d2f34e63ebd120f3377fbb70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503343
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
std::string is less permissive than SkSL::String about concatenation.
This change is a step towards eliminating SkSL::String.
(We couldn't continue using this technique for std::string, as it's
undefined behavior to add our own methods inside namespace std.)
Change-Id: I21e421182be23d3033f827758ea2b2c01fa99d26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503341
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit d921f21fbc.
Reason for revert: New test breaking GL android bots
Original change's description:
> Add SkSurface resolve function.
>
> This will insert a resolve msaa call into the stream of commands for
> the SkSurface. This is mostly useful for cases when a client wraps the
> resolve texture but has Skia draw with MSAA, and the client wants to
> make sure Skia resolves to their wrapped texture.
>
> Bug: chromium:1292418
> Change-Id: I6eddae967136716b9215fcd96e7d77a2457efdf2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503340
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: chromium:1292418
Change-Id: I86e5f82f0e2a0921906c0caba964929750500965
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503350
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This will insert a resolve msaa call into the stream of commands for
the SkSurface. This is mostly useful for cases when a client wraps the
resolve texture but has Skia draw with MSAA, and the client wants to
make sure Skia resolves to their wrapped texture.
Bug: chromium:1292418
Change-Id: I6eddae967136716b9215fcd96e7d77a2457efdf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I82be2c8a825a070024748f8a1c6449ce508efdc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503156
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Other than the `float`/`double` overloads, the only value-add of these
methods is to cast the result of `std::to_string` to `SkSL::String`.
When `SkSL::String` is removed, these no-op calls can be replaced with
direct calls to `std::to_string` instead. (The float overloads can
continue to live in `skstd` since their output isn't the same.)
Change-Id: I4df841403114b401ad58017f0264a246fef341af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502786
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I90140348eeb87c849a857a12008c201efc9e328d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482596
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This will make it easier to migrate from SkSL::String to std::string.
These methods can then continue to exist as free functions.
Change-Id: I9f6799788aaf42f4a95c6df03d01f9e123ae52c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502783
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
std::string::starts_with will be available in C++20. In the interim,
prefer using a free function in skstd. This puts us a small step closer
towards removing SkSL::String.
Change-Id: I8c6b33d94c51a643d8cb99ac4c4b1c0556cb9170
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502782
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
An API like this was never adopted in std::string. (The concept was
borrowed from absl::ConsumeSuffix.)
This is a step towards removing SkSL::String entirely, since we no
longer have a pressing need for it now that std::string_view and
std::string are compatible.
Change-Id: I661e5f374aaf317c3d4bdb5dcf4ac1081d178e80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502309
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We now use std::string_view throughout. SkStringView.h has been moved to
include/private/ and is only used for our C++20/23 compatibility methods
(starts_with/ends_with/contains).
Change-Id: I961842c6778256a03868e7602d48add34f420763
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502306
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit 17d0fc087c.
Reason for revert: flutter still uses the skstd class
Original change's description:
> Remove skstd::optional entirely.
>
> Skia now uses C++17's std::optional.
>
> Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a reland of 64c971350e
Original change's description:
> Use native std::string_view.
>
> We also used some string_view functionality from C++20/23. These have
> been replaced with free functions with the same name.
>
> Change-Id: I3bf40f99aeb500495f344fd8c6872619267d42be
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500897
> Reviewed-by: Herb Derby <herb@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I4ff237381c16179f716ecde1929154fdd4ad3442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501480
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Skia now uses C++17's std::optional.
Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
See toolchain/clang_toolchain_config.bzl for the c++17 switch.
Most of the other changes were automatically generated
(with the exception of //third_party).
Change-Id: I8c0f4b29b5967da3f48b17eb298a7e92156277ac
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502407
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This is a reland of 490bb34b29
Original change's description:
> Use native std::optional.
>
> Change-Id: I3bcf7a23eb27e98d24840b492930955125d35bd4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501476
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: If14d35ed78905800b43b656f65bb17fc940e7770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502298
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Introduce GrTextReferenceFrame and use it in TransformedMaskSubRun
and TransformedMaskSubRunSlug. This will allow these to SubRuns
to be combined in the future.
In addition, move fAlloc to first field in Slug to avoid use
after free problems.
Change-Id: Ib4f791389cf9b3c2a0f2e0fd802eccdea4841d1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502301
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I3bcf7a23eb27e98d24840b492930955125d35bd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501476
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit 2710bcfc68.
Reason for revert: This CL is preventing the roll into Android because it is causing CTS failures.
Original change's description:
> HEIF decode: add support for 10-bit color format
>
> Bug: b/201083499
> Test: TBD
> Change-Id: I76d3244782c139006dff68ea713eb24c10bb962d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501159
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>
Bug: b/201083499
Change-Id: I4ea9fb74a9792bcc1687024d852ffc3525093727
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501676
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Upcoming dehydration / rehydration changes require $intLiteral and
$floatLiteral to be present in the symbol table (as all other private
types are). It turns out that even with them marked private, having
them in the symbol table allows them to be incorrectly accessed without
error due to a code path that fails to check for private types.
This CL takes care of that and ultimately results in better output from
PrivateTypes.
Change-Id: Ic47b77a770834079f28c3195545a7cabca8e6cb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501196
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 64c971350e.
Reason for revert: breaks
Housekeeper-PerCommit-CreateDockerImage_Skia_Release
https://status.skia.org/logs/7PAT8xw23VsUyx4oJgZZ/1327ba91-d03a-4e98-b1dd-0dedb401333b
"<string_view> not found"
Original change's description:
> Use native std::string_view.
>
> We also used some string_view functionality from C++20/23. These have
> been replaced with free functions with the same name.
>
> Change-Id: I3bf40f99aeb500495f344fd8c6872619267d42be
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500897
> Reviewed-by: Herb Derby <herb@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I3712eddc8ad49ad38d31ca5bf008260e251bdbd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501396
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We also used some string_view functionality from C++20/23. These have
been replaced with free functions with the same name.
Change-Id: I3bf40f99aeb500495f344fd8c6872619267d42be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500897
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: b/201083499
Test: TBD
Change-Id: I76d3244782c139006dff68ea713eb24c10bb962d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501159
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This is mostly mechanical. The only interesting bit is that GrSLType was in include/private while SkSLType is in src/core so some #include patterns changed.
Bug: skia:12701
Change-Id: I80bd86ee93796b145f86ded9b4cbf52f24fa59e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497607
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 3530d4d3c3.
Reason for revert: Use after free: context deleted before ops
Original change's description:
> redo AtlasTextOp caching
>
> The fuzzer ash_unittests is passing GrRecordingContext from thread
> to thread. This means that 120 bytes for a AtlasTextOp bytes are
> leaking on the first thread because the ClearCache is never
> called on that thread.
>
> Move the cache to the GrRecordingContext. Use a thread local to
> store a pointer to the GrRecordingContext so that new and delete can
> find the cache.
>
> Add a field to AtlasTextOp to save the recording context so that it can
> populate the thread local just before delete is called.
>
> Bug: chromium:1265033
>
> Change-Id: I9802910428bf091c534c96d4ce729c3b3445c76b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497147
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Bug: chromium:1265033
Change-Id: Ia51ad196cf2966225b177f799d477e1f705187c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498616
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The fuzzer ash_unittests is passing GrRecordingContext from thread
to thread. This means that 120 bytes for a AtlasTextOp bytes are
leaking on the first thread because the ClearCache is never
called on that thread.
Move the cache to the GrRecordingContext. Use a thread local to
store a pointer to the GrRecordingContext so that new and delete can
find the cache.
Add a field to AtlasTextOp to save the recording context so that it can
populate the thread local just before delete is called.
Bug: chromium:1265033
Change-Id: I9802910428bf091c534c96d4ce729c3b3445c76b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497147
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
We had four separate expression-array cloning implementations spread
throughout the code. It's now unified as a clone() method directly on
ExpressionArray.
Change-Id: I5b38ceeca36bb2ba5d0f41b3298a8740308f7627
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497744
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We need this for Graphite enforcing single owner on the cache.
Bug: skia:12754
Change-Id: Ib26167bce5ee5db6ffe60d3c49091ac14e05f32a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496604
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I9d435a7a68ef870ef027ee3c6acb79792773868b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497609
Reviewed-by: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Unfortunately, this won't change any behavior until ExtractPaintData is switched over to using PaintParams::toKey
Bug: skia:12701
Change-Id: I2b00256d34de1b8b99a65e26c08f5f082090a341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497596
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 7e8fdf4706.
Reason for revert: breaking bots
Original change's description:
> [graphite] Add ImageShader and BlendShader SkPaintParamKey support
>
> Unfortunately, this won't change any behavior until ExtractPaintData is switched over to using PaintParams::toKey
>
> Bug: skia:12701
> Change-Id: I4f51dbb43983fe2f01947e26814f581a6d9033cd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496783
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12701
Change-Id: If180bd3753c95d920715f37347559cee4fa2da20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497455
Auto-Submit: Robert Phillips <robertphillips@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Unfortunately, this won't change any behavior until ExtractPaintData is switched over to using PaintParams::toKey
Bug: skia:12701
Change-Id: I4f51dbb43983fe2f01947e26814f581a6d9033cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496783
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The goals here are to:
reduce the use of magic numbers
make casts a bit safer
Bug: skia:12701
Change-Id: I6b1628fff4041bd0998060a757412b6a7260be1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496378
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
SkVx.h attempted to not use vector instructions if SKNX_NO_SIMD was set.
However, this was incomplete and could lead to a wasm build with
SKNX_NO_SIMD still trying to use some vector instructions which are
not present if __wasm_simd128__ is defined.
This change requires some additional "include what you use" includes
since some other files were depending on SkVx.h including the vector
instruction headers.
Bug: cl/421848579
Change-Id: I6a878d64b76677a925b94724926c62f3e42ddd4c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496313
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
The blend/compose shader's dump method will need to recursively call SkPaintParamsKey::DumpBlock
Bug: skia:12701
Change-Id: Iab7c26bf5410c2429e4932859b91d741caeed4b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496311
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
* Added namespace for local functions, etc.
* Change variables to use Skia nameing
* add this->
* enhanced SkGlyph with setImage()
* move MapOps to where it is used
* move SkFuzzDeserializeSkDescriptor to be globally visible
Change-Id: Id15acde9d3c6a1b116cff3262ab6f6c62d171b16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496237
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12701
Change-Id: Id6ce588c28413b32b864f22cec73a5e90a9ec376
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Angle/Vulkan added GL_ANGLE_rgbx_internal_format extension for RGBX
texture format. Add support for that format in Skia.
Bug: chromium:1261867, chromium:1269826, angle:6690
Change-Id: I74fc91699dc1eaf2b275b29fbcf3d4060e63c5a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485157
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
It's been a no-op for 6 years.
Change-Id: Id5e4b21ac806eb68879b217084006cb62cedfe7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494636
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
- We always download from https
- All external assets have a primary and a mirror URL.
- We prioritize the sources as follows:
bazel mirror, github/original source, our mirror
- There is a way (see build_toolchain) to test the sources
from the mirrors (done before CL submission).
This adds a utility to upload files to the mirror in a
consistent, scripted way. It includes a way to copy in
parts of our bazel files (e.g. debs_to_install from
toolchain/build_toolchain.bzl) to update many things
at once.
Our Bazel mirror (gs://skia-world-readable/bazel)
is a Content Addressable Storage system, where the
file name is based on the sha256sum of the contents
(the same hash that Bazel uses). All files in it should
be publicly accessible.
Change-Id: Ida8b8e07d27a0a557bc49467ebbc86c806cabbd3
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494478
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Since the SkShaders, etc will need access to SkPaintParamKeys and the SkShaderCodeDictionary they can't be buried in the skgpu namespace.
The currently planned signature for addToKey is:
void addToKey(SkShaderCodeDictionary*, SkBackend, SkPaintParamsKey*) const;
This CL doesn't modify the classes beyond what is needed to move them.
Bug: skia:12701
Change-Id: I18bbf6d6c3a768427112a3d19a9ccf2d46a23ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494237
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:11862
Change-Id: Ia21fad6acb82a03c1ba8663be548bf58f5067b85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493636
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
bazel run //example:hello_world --config=clang
causes a window to open and draws a circle and a square.
Text to follow in a future CL.
To make this work, I had to get rid of musl and use glibc.
All the shared libraries (.so files) that were pre-built
and available for download (e.g. from https://packages.debian.org/bullseye/amd64/libgl1/download)
were compiled against glibc. When I tried to run a
program statically linked with musl and dynamically linked
against things using glibc, I got a segmentation fault
on things like calloc().
Initial attempts to use glibc had failed because it was thought
that the libc.so.6 file could only be referred to by absolute
path (and thus Bazel would not be happy about it). As it turns out,
that was simply a misconfiguration of the builtin_sysroot
parameter to cc_common.create_cc_toolchain_config_info
(see //toolchain/clang_toolchain_config.bzl). By setting that
to `external/clang_linux_amd64` and not
`external/clang_linux_amd64/usr`, the libc binary which had
been extracted to `external/clang_linux_amd64/lib/x86_64-linux-gnu`
was perfectly reachable from
`external/clang_linux_amd64/usr/usr/lib/x86_64-linux-gnu/libc.so`
To bring in the shared libraries to link against (e.g. X11, GL)
I made build_toolchain.bzl easier to modify in that we simply need
to add a debian download url and sha256 hash to a list (rather than
having to plumb this through via arguments).
Recommended Review Order:
- example/BUILD.bazel (not sure if we always want to set bare
link arguments like that or if we want to use "features" to
pass those along to the toolchain).
- tools/sk_app/BUILD.bazel to see initial cc_library for
wrapping sk_app code.
- toolchain/build_toolchain.bzl to see removal of musl and
new list of debs.
- toolchain/clang_toolchain_config.bzl (where use of the
no-canonical-prefixes was key to compilation success).
Notice also that we statically linked libc++ (I did not
have any shared libraries for it locally, so I guessed
a typical developer might not either).
- Rest of toolchain/ for trivial renames.
- bazel/Makefile to see extra docs on those targets and
a new target that compiles all the exes so far for a
quick way to test the build.
- third_party/BUILD.bazel and src/gpu/BUILD.bazel which have
non-generated changes. (all other BUILD.bazel files do).
- go.mod, which needed to update the infra repo version in
order to pick up http://review.skia.org/491736).
Change-Id: I8687bd227353040eca2dffa9465798d8bd395027
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492117
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
- Use latest emscripten toolchain (3.1.0)
- Autogenerate the atoms and manually fix some of the file lists.
- Add a known_good_builds target to bazel/Makefile to help
check the things we expect to work with Bazel.
Change-Id: Ia5f51e7b9eb5c108386820ad59180c8f862f5a70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491438
Reviewed-by: Ben Wagner <bungeman@google.com>
The previous land contained a stray reference to the now-absent
SkSLSymbolAlias.h in sksl.gni.
This reverts commit f5853ff652.
Change-Id: I911d99de3dd98bc91a3bbfd9a52634dd51a660f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491816
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 84d6cf9b5b.
Reason for revert: Blocking Chrome roll
Original change's description:
> Removed SkSL SymbolTable aliases
>
> Now that we have first class Type aliases, we no longer need this
> obsolete SymbolTable mechanism.
>
> Change-Id: Ibfb21ed153d1cbca59679659254e4d58d18f5c7c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491441
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Ie4aadf49d83af2ad4a4e09061e92d27a4610d8fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491696
Auto-Submit: Robert Phillips <robertphillips@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bug: skia:12766
Change-Id: I9dfe07a71961ab952c1593b9cc68c61191fbc13c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489536
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Now that we have first class Type aliases, we no longer need this
obsolete SymbolTable mechanism.
Change-Id: Ibfb21ed153d1cbca59679659254e4d58d18f5c7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491441
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This will make it possible for drawVertices and drawCustomMesh to share
implementation in Ganesh.
Bug: skia:12720
Change-Id: I8b84119a29b47071ef389879bb5287873629ed3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487978
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
SkRuntimeEffect::MakeForXxxxx compiles its shaders before MakeTraced()
is invoked, with optimizations enabled. When MakeTraced() is called,
we recompile the shader with optimizations disabled; this allows us to
present the user with a shader that is as close to the original as
possible. (This obviously costs time, but debug trace generation isn't
focused on speed.)
Note that in some rare instances, disabling optimizations can cause
compilation to fail (e.g. optimization can simplify control flow and
eliminate "unreachable" paths). In those cases, we fall back to the
existing behavior of debugging an optimized shader.
Change-Id: Iba0f31bc42374c7048694fde5415b122177a9a68
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489716
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
These convert a color between the working color space and a known,
useful space (linear TF, sRGB gamut).
Bug: skia:10479
Change-Id: I3308e691beeaca5120ed0c2e30cf08661caa3684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481416
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We'll want to reuse this key class for Graphite resources as well. There
is nothing special about these keys that is Ganesh specific.
Bug: skia:12754
Change-Id: I39fe5a9968156985865bccbfc4978583120ac2e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487384
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
It is not needed there. Add it to files that do need it instead.
Change-Id: I2fa32d423972c4c91c4fbfe5508bd50323201714
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463556
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12720
Change-Id: Icece250cd2642e63f9e04f139dc951f34f82c2ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487383
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
At this point SkPromiseImageTexture is not much more than a wrapper
around a GrBackendTexture. The next steps would be to switch to just
directly using GrBackendTexture in the fulfill procs and deleting
SkPromiseImageTexture.
Bug: skia:12758
Change-Id: Ic0526b869a0730c25b41b46fd6523604dedaba40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487382
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is a reland of e1e1c03229
Original change's description:
> Start on custom mesh API
>
> Bug: skia:12720
> Change-Id: I8ed0555f1c5b8b0e97e73a657635dac2c0df0ccf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:12720
Change-Id: I5c54f37949d8bd45ea606264c439912b65158b79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487220
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12720
Change-Id: I8ed0555f1c5b8b0e97e73a657635dac2c0df0ccf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This also allows the KeyBuilder class to be used in Graphite. In Graphite
I plan to use it for other keys besides building up shaders/processors
so I dropped that from the name. There was nothing special abouts its
implementation that made it specific to Processors anyways.
Bug: skia:12754
Change-Id: I1b25730b061f9342b61e3b2e4ac43328b8074d59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: Ib1ea2936f7a9431bc62c04b1931cf6da2c213b36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483496
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This will allow us to use ShaderUtils in both Ganesh and Graphite.
Change-Id: I78e34c4eb969a0d827c459d7fb945d17fdc22efa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482696
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Move the compile-time flag SK_EXPERIMENTAL_ADD_ATLAS_PADDING,
to a runtime flag in GrContextOptions.
Bug: chromium:1275890
Change-Id: I7e051cd4834ac44958b1431976535519e8bdaa3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482416
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Chromium has been using the remote glyph cache for a few years now.
It's time to give it a proper home.
This is an intermediate CL. The old .h file includes the new .h file.
After I change the include paths in Chromium, I will delete the old
file.
Change-Id: Iaf00c46aa0698326c0bdec9a0eed218bcc3e334e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482700
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: Ifc671649da20706dbce9480dc60b4184a0bb8bf7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482636
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
This entire API existed, but was unused (no longer connected to
drawVertices or runtime effects).
In theory, we could further simplify some of the matrix providers, but
more importantly - I have serious doubts about the correctness of
localToDeviceHitsPixelsCenters for most of them.
Change-Id: If5af182015dd96e5ed3353a117223e8dbbe17097
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481683
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkBlendMode always applies when colors are present. Also clarify what
"src" and "dst" are to blend.
Bug: skia:12662
Change-Id: I0a8be2cec2dd6b55e3c7de3f1879cc46cacf0822
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481438
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Color filters and blenders are currently not supported for tracing,
because we don't have access to the pixel coordinate, and so there is
nothing to compare the debug-trace coordinate with.
Change-Id: I7fe7fb4955b002432046ceef61c6f0a4c721a581
Bug: skia:12708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481278
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Added comments to explain the semantics (both what's expected when you
set the uniform, and what you see in the shader). The old name was
confusing, because it sounded like you got an sRGB color in the shader.
This is terse, but I think it's the cleanest syntax - and for embedding
clients, they can use C++ (etc.) API to require that color uniforms are
assigned from color types.
Bug: skia:10479
Change-Id: If00ea754060494aaa83001a5b357687953de8a5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480577
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 873a39ebd1.
Reason for revert: rework #2 of trace design, DebugTrace is back
Original change's description:
> Remove newly-added SkSL::DebugTrace base class.
>
> Slight rework of the SkRuntimeEffect trace design means we won't expose
> any debug-trace class at the public level, so an interface base class
> doesn't add value after all.
>
> Change-Id: I82739e9c5ba5ce5c7a63793ec0c09a50ab19fbb3
> Bug: skia:12708
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480776
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12708
Change-Id: I02d51f83c7a3384b1eaa74ecf1a80b5f6e4fd774
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481196
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Slight rework of the SkRuntimeEffect trace design means we won't expose
any debug-trace class at the public level, so an interface base class
doesn't add value after all.
Change-Id: I82739e9c5ba5ce5c7a63793ec0c09a50ab19fbb3
Bug: skia:12708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480776
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
SkRuntimeEffect needs an API for generating debug traces. This means
that we will need references to debug traces inside a public header.
Rather than reference SkVMDebugInfo directly, we now have a simpler
base class for debug traces. This is better suited to landing in
include/.
I've also renamed SkVMDebugInfo to SkVMDebugTrace for consistency, since
it now contains all the trace data. (When it was first added, it only
had the slot info.)
Change-Id: Ibaa4dedf9a17b9462b4f233a28a7b875d0317892
Bug: skia:12708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480356
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This creates SkImageShader instances that do not perform color space
conversion, nor do they premultiply their pixels (if they started out
unpremultiplied). These are useful for runtime shaders that want
non-color inputs (like normal maps or lookup tables).
Includes GM that demonstrates lack of color conversion, and lack of
premultiplication in the context of a lighting shader.
Bug: skia:10479
Change-Id: Ic07aa8b8d3407ae5f81bc075648fdcba6d4cce29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477299
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Use that to preserve the alpha type of (unpremul) SkImages when
serializing. This ensures that the new GM works correctly in
serialize-8888, and is required for an upcoming "raw" image feature.
Change-Id: I747803c2928cbb5872d4c97a421701248d8f6a51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478957
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
As a follow-up to https://skia-review.googlesource.com/c/skia/+/476219,
this sketches out how we can maybe use cc_library for the things
in //modules to make sure something in //src doesn't depend on
anything in //modules, for example.
The following succeeds:
bazel build //modules/skparagraph:skparagraph --config=clang \
--shaper_backend=harfbuzz_shaper --with_icu
As does `make bazel_canvaskit_debug` in //modules/canvaskit
Suggested Review Order:
- third_party/BUILD.bazel for ICU and harfbuzz rules. Pay
special attention to the genrules used to call the python
script for turning the icu .dat file into .S or .cpp.
- bazelrc and bazel/ for new flags and defines that control
use of ICU and harfbuzz. Unlike GN, with the public_defines
that get added in automatically if icu or harfbuzz is
depended upon, we need to set the defines at the top level.
This necessity might go away if we change the atoms to
depend on //modules/skshaper, which could define that flag.
- Top level BUILD.bazel files in //modules/skparagraph,
//modules/skshaper, //modules/skunicode, //modules/canvaskit
- All other .bazel file changes are automatic.
Bug: skia:12541
Change-Id: I38a9e0a9261d7e142eeb271c2ddb23f362f91473
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478116
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
To make the atomic rules a bit easier to work with, in many
of the folders, this adds in cc_library rules to group
together the sources from that folder (and subfolders
where prudent). We only needs sources because those atoms
should have their headers as deps.
One issue that was pointed out is that there is currently
no way to restrict the inclusion of certain packages,
a la, `gn check`. For example, there is no mechanism from
stopping a dev from adding
#include "modules/canvaskit/WasmCommon.h"
to something in //src/core (except circular dependencies).
We can probably address that using Bazel's visibility
rules as needed:
https://docs.bazel.build/versions/main/visibility.htmlhttps://docs.bazel.build/versions/main/be/functions.html#package_group
It is recommended to look at this CL patchset by patchset.
PS1: Update gazelle command to generate rules in more folders.
PS2: A few changes to make generation work better.
PS3: The result of running make generate in //bazel
PS4: Adding the rules to build sksllex, the simplest binary I
could find in the Skia repo.
PS5: Adding the rules to build skdiff, a more complex binary.
I tried a few approaches, but ended up gravitating back
towards the layout where we have each folder/package
group up the sources. I imagine at some point, we'll have
skdiff depend on skia_core or something, which will
have things like //src/core, //src/codecs, //src/pathops
all bundled together.
PS7: Added in the groupings of sources, similar to what we had
earlier. I liked these for readability. These helped fix
up the //:skia_core build, and by extension, the CanvasKit
build.
Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Change-Id: I848eca3a9ddfabadf82c86e4b3396aaa0e55757c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478056
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This new image filter constructor enables SkRuntimeEffects to be
used as shaders within the ImageFilter DAG. The shader is created
lazily using the SkRuntimeShaderBuilder enabling the resulting
shader to consume the previous stage of the ImageFilter graph.
This relands commit ad9d774c1f after
fixing the threading issue found by the TSAN bot.
Change-Id: I06dc4cf6a304b14804c55531a5bc3f2afa34e219
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477156
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
I should have realized the fuzzer would find this assert when I added
it. Now the front-end rejects these layout qualifiers on both struct
fields and interface block fields. LayoutInInterfaceBlock.sksl is a
reformatted version of the fuzzer input. LayoutInStruct is hand-crafted
to trigger the same failure on a different code path. Both would
previously assert in the SPIRV generator. Now, neither one gets that
far.
Bug: oss-fuzz:41347
Change-Id: Iff69d8f5482da7b772e9331c4fd2d58e89813c46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476396
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit ad9d774c1f.
Reason for revert: Task Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-DDL3_TSAN has been failing since this CL landed.
Original change's description:
> Add public API support for SkImageFilters::RuntimeShader
>
> This new image filter constructor enables SkRuntimeEffects to be
> used as shaders within the ImageFilter DAG. The shader is created
> lazily using the SkRuntimeShaderBuilder enabling the resulting
> shader to consume the previous stage of the ImageFilter graph.
>
> Change-Id: I5d6917e34a8e5fdd053399f15a1e2cc7409e686f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470459
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
Change-Id: I0367a5c480df109c6116eb168792fe3c2fc58807
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475644
Auto-Submit: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
This adds a simple go program to test the installed go
toolchain, and a Make rule to codify the arguments to
our gazelle binary, built with extensions.
I could not figure out how to get the .json file to work
with the gazelle() Bazel rule, but this works ok for now.
Bug: skia:12541
Change-Id: I5067b15c7518951aeb69559d3871799d3b5745f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475716
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This uses the gazelle extension from
https://skia-review.googlesource.com/c/buildbot/+/473357
Review Tips:
- Ignore any changes to .h or .cpp files. Those have been
pulled out into their own CLs.
- Start with bazel/macros.bzl.
- Read the CL with the generation code, if you haven't already.
- Look at third_party/file_map_for_bazel.json.
- See experimental/bazel_test for an idea of how a cc_binary
would be made.
- Spot check one or two of the BUILD.bazel files.
This CL generates the "atomic" rules for src/, include/ and
modules/skshaper, as a starting point.
`bazel build --config clang //include/...` works
`bazel build --config clang //src/...` starts compiling,
(which verifies that the BUILD.bazel files are all valid),
but runs into errors because not all third_party deps have
been resolved, and there are some files missing from the
toolchain still (e.g. EGL headers).
Change-Id: Ib7e0fb0efdb9f08655f06cbc56e9bb4cf416294b
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474240
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This new image filter constructor enables SkRuntimeEffects to be
used as shaders within the ImageFilter DAG. The shader is created
lazily using the SkRuntimeShaderBuilder enabling the resulting
shader to consume the previous stage of the ImageFilter graph.
Change-Id: I5d6917e34a8e5fdd053399f15a1e2cc7409e686f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470459
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Follow the ordinary pattern on SkCanvas for handling GrSlugs. This
should allow more flexibility in the future.
Change-Id: Ic498b5d081a1c7e44c2864439423910c452408b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474899
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Introduce the GrSlug that encapsulates an SkTextBlob along with
the origin, and paint to create a GrSlug. You can draw the slug
using the canvas, and it will obey the canvas's clip and mapping.
See the full working prototype at:
https://skia-review.googlesource.com/c/skia/+/471157/17
Change-Id: I5731dce3dea316ad144baead154a68c8e4c5db9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474040
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:12662
Change-Id: Ic18220668a4f87e7340a53b3f191887a7a016a04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473141
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is a reland of 688cb15faa
Original change's description:
> Remove layer-coverage-tracking experiment
>
> This effectively reverts reviews.skia.org/122000
>
> Bug: skia:10987
> Change-Id: I989241110f17c0e3c2a896aea4bc2bc4cc8c910f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472801
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:10987
Change-Id: I16493df8bd7942261d14c01747d0fdc91bbe5467
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473143
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This effectively reverts reviews.skia.org/122000
Bug: skia:10987
Change-Id: I989241110f17c0e3c2a896aea4bc2bc4cc8c910f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472801
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is done for webview which needs to know whether it is drawing
directly into the main window surface or in a layer.
Change-Id: I0a3f6f81bcf65907f9d51651035bae912c3a34ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468616
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Because SkSL is much more permissive than GLSL about literal types, we
don't actually need to treat values any differently when the `u` suffix
is added. That is, `uint x = 4000000000;` already worked fine. When we
encounter the `u`, we just ignore it. This also means that a literal
like `-100u` would be accepted without complaint (although you'd get a
range error if you tried `uint x = -100u;`).
The value-add here is that it removes a speed bump when porting GLSL
code to SkSL. The Filament example shader used the `u` suffix anywhere
that bitwise ops were present; finding and removing all of them was a
chore.
Also of note: the `u` suffix was only added to GLSL in ES3, but we
"support" it everywhere. (We could go out of our way to detect it in
ES2 and flag an error, but that benefits no one.)
Change-Id: I4bf643612c8cf17710e9bad50a0c16f5936bbe88
Bug: skia:12634
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471756
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Many things are not enabled currently (e.g. Skottie, Paragraph),
but we can render many APIs using WebGL.
To turn on Paragraph, etc, we'll need to tackle fonts, which
is a separate effort.
This also changes where the build artifacts go. ./build/ is
easier to deal with than the old way of sticking them in
./npm_build/bin
Change-Id: Ia377360af580a887d03630670438fea2e3157e90
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470682
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This ports the third_party BUILD.gn files related to codecs
(with a best-effort on arm/SIMD stuff). This includes:
- libpng
- libjpeg-turbo
- libwebp
- wuffs (gif)
- libgifcodec
- dng_sdk and piex (raw codec)
This expands the string_flag_with_values macro to allow
multiple values to be set at once. This was added in Bazel 5.0.0,
however the latest pre-release version of that has a bug [1]
which slows down compilation dramatically. This was fixed at
ToT, but not released. As a result, I started using the Bazel
6 pre-release (via bazelisk).
The macro select_multi makes writing select() where multiple
elements could be on possible/easier.
One can try compiling certain codecs by running:
bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec
Suggested Review Order:
- bazel/macros.bzl
- bazel/common_config_settings/defs.bzl and its BUILD.bazel
to see how the codec options are defined.
- BUILD.bazel to see how the codec settings are used.
- src/codec/BUILD.bazel to see the inclusion of Skia files to
deal with specific codecs.
- third_party/BUILD.bazel (while referencing the corresponding
BUILD.gn files, such as third_party/libwebp/BUILD.gn)
- Everything else.
Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Replaced by Graphite.
Change-Id: Iac0ba212b078904a591677c9ce839a90562d0240
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470305
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: Ibeea56ebd5dce53af1252ca3ecf6cc6f010bd461
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469902
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12625
Change-Id: I8ad737855f25df83c85d619d69b006ccbd83658d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469897
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
These rules can be used to build our GMs on WASM+WebGL and
libskia.a with just the CPU backend (and most other features
turned off).
This can be done with the following commands:
- bazel build //modules/canvaskit:gm-bindings-wasm --gpu_backend=gl_backend --with_gl_standard=webgl_standard
- bazel build :skia-core --config clang
This pivots slightly from http://review.skia.org/463517
by using config_settings [1] instead of platforms for
the optional features that we control. This pivot was
suggested in [2]
We have BUILD.bazel files in many of the subdirectories
that specify filegroups for the appropriate files. In
an effort to make //BUILD.bazel more readable, it is
the responsibility of these subfolders to deal with
conditionally including certain .h or .cpp files.
This is done using select statements and config_settings
or platform constraints as necessary.
For example, src/gpu/BUILD.bazel will different private
filegroups for each of the supported gpu backends [3]
and a more-visible filegroup called "srcs" that has
the right selection of the private files to be used
for compilation.
An effort has been made to avoid using glob() in our
BUILD.bazel files. These file lists were made by using
`ls -1` and some regex to add in quotes. We might want
to make a helper script to assist with that, if necessary.
To specify which options we have, the settings in
//bazel/common_config_settings/BUILD.bazel have been
redesigned. They make use of a macro `string_flag_with_values`
that removes the boilerplate. Patchset 36 shows what the
file looks like w/o the macro.
The top level BUILD.bazel file will still need to use
some logic to handle defines, because local_defines is
a list of strings, not a list of labels [4].
Suggested Review Order:
- WORKSPACE.bazel to see the new dependencies on the
emsdk toolchain and bazel_skylib
- bazel/common_config_settings/* to see the few settings
defined (we have more to define, see BUILD.gn and
//gn/skia.gni for ideas)
- BUILD.bazel to see the "skia-core" cc_library rule.
See also "gms" and "tests"
- modules/canvaskit/BUILD.bazel to see the use of
the emscripten "wasm_cc_binary" rule, which depends
on the "skia-core", "gms", and "tests" rule. Note that
it only builds some of the gms as a proof of concept.
- The other BUILD.bazel files. Some of these are not
platform or feature dependent (e.g. pathops). Others
are (e.g. gpu).
- All other files.
[1] https://docs.bazel.build/versions/4.2.1/skylark/config.html#user-defined-build-settings
[2] https://github.com/emscripten-core/emsdk/pull/920
[3] In this CL, that's just the webgl one.
[4] https://docs.bazel.build/versions/main/be/c-cpp.html#cc_library.local_defines
Change-Id: Ieecf9c106d5e3a6ae97d13d66be06b4b3c207089
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458637
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
It was added for Chromium, and Chromium has switched to using
fTypeString instead.
Change-Id: I8cd8ae00b0c3abf3691ce14837afbe3be939538e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316209
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: I937e0594b8fa3a1cc5ac2e2b80d1f0f406772817
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468338
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
This is a reland of 74105c5d09
Original change's description:
> Remove GPU-related calls from SkSurface.h when !SK_SUPPORT_GPU
>
> Change-Id: Idca02c40bd8f540919702f09ba2a809acc377e67
> Bug: skia:12584
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464295
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12584
Change-Id: Id679bd61eddb341598e149a7a87e3ba9f0dc8943
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464976
Reviewed-by: Brian Osman <brianosman@google.com>
SkTHashTable::Slot required a default constructor on T, even though the
default constructed T was never used. Model SkTHashTable::Slot on
std::optional to not require the default constructor.
Change-Id: Ie8912f132ba0f375c80a73fe7ae9022762b4794a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467083
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Functions that declare variables totaling more than 100,000 slots will
now generate an error.
This is only a partial mitigation to the problem, as a sophisticated
attack could still chain/nest multiple functions together to consume
extremely large amounts of stack. However, this mitigation is still more
sophisticated than our peers; both WebGL and glslang are susceptible to
similar problems, and in the general case (ES3+ with full flow control)
it's intractable.
Change-Id: I153c75267c017a23f59fe9e59f6e391197ee6101
Bug: oss-fuzz:40304, oss-fuzz:40694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467759
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
It's a performance foot-gun today (disables raster pipeline), and will
hopefully be unnecessary in the future.
Change-Id: I241484286388e4bd2a429a6d22e3b96ecf975cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467456
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Add a getter to SkTypeface to provide information on whether it
needs access to the foreground color (in COLR fonts) so that the
strike cache can determine caching requirements.
Since remote SkTypefaces do not have access to table information,
implement this as a serializable flag, with font-blob backed
implementations being able to return this based on whether they
have a COLR table or not, starting with FreeType.
Preparation for supporting foreground color in FreeType COLR
rasterisation.
Bug: skia:12576
Change-Id: I7e71b0ec12e17f652ab7b43adffc43bc780ce2e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466936
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: I7b6d7412d431532ae553627d63a93b53cbd4f2b4
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466773
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Uint was inconsistent--we had UByte and UShort, so ints should be UInt.
Change-Id: I71fdc3db902cdf62ab1de705dca2b0d069e9effb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466499
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This is a more cautious attempt of https://skia-review.googlesource.com/c/skia/+/464876
GrAlignTo renamed to SkAlignTo and moved to SkTypes.h
(with the rest of our align helpers).
GR_MAKE_BITFIELD_OPS and GR_DECL_BITFIELD_OPS_FRIENDS
renamed to SK_* and moved to private/SkMacros.h
This avoids our public includes using a src header file
and messing with SkUtils.h, which apparently was used
by Android. That should be cleaned up in a separate effort.
Change-Id: I86d5e1fb6a7834034534266a6c340bc7757f9abb
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466176
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 65a726bb49.
Reason for revert: You cannot include a src file in an include file. This ends up using c++17 features in our includes. Breaks rolls.
Original change's description:
> Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
>
> These have been renamed SK_MAKE_BITFIELD_OPS and SkAlignTo
> because nothing seemed particularly GPU/Ganesh specific to them.
>
> I moved the latter to SkTypes.h because we have other align
> code there and former to src/SkUtils.h because I didn't know
> where else it should go.
>
> The primary motivation was removing the GrTypesPriv.h
> include from src/core/SkBlockAllocator.h. I had attempted
> some amount of #if SK_SUPPORT_GPU, but that's not as clean
> here because both our CPU and GPU backends use the
> SkBlockAllocator (as far as I could tell).
>
> This also moves sk_memset* from SkUtils.h to SkOpts.h, because
> SkOpts.h requires bringing in RasterPipeline, which seemed
> like overkill.
>
> Change-Id: I5163ef5064ad3840a15b7e873930d60e2620bf9d
> Bug: skia:12584
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464876
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12584
Change-Id: I1b772bbbc6f150d737bb53fa4e5f45d1581929fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/465376
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
These have been renamed SK_MAKE_BITFIELD_OPS and SkAlignTo
because nothing seemed particularly GPU/Ganesh specific to them.
I moved the latter to SkTypes.h because we have other align
code there and former to src/SkUtils.h because I didn't know
where else it should go.
The primary motivation was removing the GrTypesPriv.h
include from src/core/SkBlockAllocator.h. I had attempted
some amount of #if SK_SUPPORT_GPU, but that's not as clean
here because both our CPU and GPU backends use the
SkBlockAllocator (as far as I could tell).
This also moves sk_memset* from SkUtils.h to SkOpts.h, because
SkOpts.h requires bringing in RasterPipeline, which seemed
like overkill.
Change-Id: I5163ef5064ad3840a15b7e873930d60e2620bf9d
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464876
Reviewed-by: Brian Osman <brianosman@google.com>
On low memory machines a common cause of crashes is when a draw
operation requires a large layer (or many large layers) because an
implementation of SkSurface_Base::onCopyOnWrite does not actually have
the resources available to do the copy when required by a draw. Allow
this method to fail and percolate up the call chain so that the draw
simply does not happen instead of crashing.
It appears some users are creating their own subclasses of
SkSurface_Base for their tests. Add SK_SURFACE_COPY_ON_WRITE_CRASHES to
keep the old crashy behavior until they can be updated.
Bug: chromium:1116362
Revert: 5b19ebe0c5.
Revert-Change-Id: I2873589f996ded9c9fd6d27b19155ca18d5b5326
Revert-Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463956
Change-Id: Id06d1e6d3aacb409a3b00b9a862bd8ddd1aaa22f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464456
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
SkTypes.h makes sure SK_SUPPORT_GPU is defined.
I was tempted to move these files to include/gpu and
src/gpu, but that might be best handled in a follow-up
CL in case any clients depend on them.
Change-Id: Ia4d6717567fe6b1842bed2c7fc0439e85e1795b2
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464638
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Icf6f45069b078f7936cfa08224fd8796d8c283b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464122
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 2e228bb72c.
Reason for revert: breaks android roll
Original change's description:
> Avoid crash when surface CoW allocation fails
>
> On low memory machines a common cause of crashes is when a draw
> operation requires a large layer (or many large layers) because an
> implementation of SkSurface_Base::onCopyOnWrite does not actually have
> the resources available to do the copy when required by a draw. Allow
> this method to fail and percolate up the call chain so that the draw
> simply does not happen instead of crashing.
>
> Bug: chromium:1116362
> Change-Id: I2873589f996ded9c9fd6d27b19155ca18d5b5326
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463956
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: chromium:1116362
Change-Id: I5ab590b6fc14bcb6712c00dda75d1e7cdc931447
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464077
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
SkImage is supposed to be immutable, convert remaining methods to const.
Change-Id: Icf673204474f09992a57c10f29703ae7b33e3904
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464256
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
On low memory machines a common cause of crashes is when a draw
operation requires a large layer (or many large layers) because an
implementation of SkSurface_Base::onCopyOnWrite does not actually have
the resources available to do the copy when required by a draw. Allow
this method to fail and percolate up the call chain so that the draw
simply does not happen instead of crashing.
Bug: chromium:1116362
Change-Id: I2873589f996ded9c9fd6d27b19155ca18d5b5326
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463956
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>