This is a reland of commit e6f23f98de
Original change's description:
> Reland "Add anisotropic option to SkSamplingOptions."
>
> This is a reland of commit 9be2d572d4
>
> Original change's description:
> > Add anisotropic option to SkSamplingOptions.
> >
> > Implement on GPU.
> >
> > Bug: skia:13036
> > Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
>
> Bug: skia:13036
> Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:13036
Change-Id: Icb2513cea6c4ec4cec934f78c66071081c232960
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Ran the following commands:
find -name "BUILD.bazel" -exec sed -i -e '1iload("//bazel:macros.bzl", "cc_library", "exports_files_legacy")\nexports_files_legacy()' {} +
buildifier --lint=fix --mode=fix -r .
This had the effect of making sure we can export all of our
files in G3 (until we no longer have legacy targets) and
making all of our cc_libraries shim-able.
bazel/macros.bzl has the human-contributed changes, the rest
were mechanical.
Change-Id: I8e24e30e74b038cfd072cdbe4078bfd1d213dd46
Bug: skia:13211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535359
Reviewed-by: Ben Wagner <bungeman@google.com>
This node was only used to detect recursion while inlining. We no longer
need to do this, because we disallow recursion in all programs.
The removal of one IRNode per inlined function actually allows for
slightly more aggressive inlining, since we restrict inlining based on
IRNode consumption. This allows the "ExponentialGrowth" tests to inline
a bit more deeply than before.
Change-Id: I894dbb1ca3096bb785b67facb01cc9c630f694c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534780
Reviewed-by: Arman Uguray <armansito@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This is a reland of commit 9be2d572d4
Original change's description:
> Add anisotropic option to SkSamplingOptions.
>
> Implement on GPU.
>
> Bug: skia:13036
> Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13036
Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This class manages and suballocates buffers used to upload textures. It
maintains a reusable, suballocated buffer for small allocations, and
creates dedicated buffers for any allocation larger than its set
reusable buffer size.
Change-Id: If7877faed870afbc85635ae47553000fa3487aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534941
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Implement on GPU.
Bug: skia:13036
Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
The geometric method for concave shadows seems to be failing in certain
cases. See: https://github.com/flutter/flutter/issues/84262. I've never
been satisfied with this solution and I've been thinking of removing it. This flag allows for Flutter to disable it for the time being until I
can determine if anyone else is using it.
Change-Id: Ia0a3f57002d94928f2baa655c88dc4d10b9edef8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This should make it so the HW tessellation path renderers are never
used; it will always select the atlas or direct fixed-count renderers
instead. This CL will give us a good indication of what visual diffs
to expect, layout tests to rebase, and any performance regressions.
If those are acceptable, then we can proceed with the rest of the code
removal.
Bug: skia:13263
Change-Id: I273bb231461932047768c1c7233ae4291483bc95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533810
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This limits our error reporting to the first 16MB of SkSL code in a
program, and error marks are limited to a run of 255 characters or
less. In practice, these limits do not affect normal code in any way.
This gives us the same tight memory footprint we originally had when
positions were stored as `int32 fLine`.
Change-Id: Idef04344324870a7b92aca154feb5e1a0121d284
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533699
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
In a followup, this will make it easier to save memory.
Change-Id: I33e9838d1b3170362f4e7c58ba5f60a1928a4b55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533698
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Change-Id: I1bf6a41290eebd45e2065fcedf86ef2e20866f54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534197
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
When drawing the Slug, aboutToDraw was never called resulting
in strange drawing matrices and broken image filters. Call
aboutToDraw in Slug drawing needs to use the initial paint from
the convert call. Store this in the Slug instead of the paint
resulting from aboutToDraw. Plumb the initialPaint and the
paint from aboutToDraw to where they need to go.
Bug: chromium:1302290
Change-Id: Id921aa37bf8ff2ecd21cdcdaad0012a7b90f5322
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533759
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 8a54d86c78.
Reason for revert: Causing issues with Android CTS
Original change's description:
> Move SkCamera.h to client_utils/android
>
> Android still uses this
> https://developer.android.com/reference/android/graphics/Camera
> but no other client does.
>
> This adds a little adaption layer until Android is updated
> to use the View3D version.
>
> Move SkCamera.h to View3D.h. Change names to android::skia::CLASS
> instead of SkCLASS. (3DView is not a valid class name, so rename it to
> View3D.)
>
> Forward-declare SkMatrix. Do not override SkNoncopyable - just delete
> the copy constructor/operator=. Make fU and fV private in Patch3D.
>
> Make Sk3DView override View3D temporarily until Android can be switched
> over to the new class.
>
> (View3D from http://review.skia.org/291371)
>
> I made Patch3D and Camera3D be private classes as they are
> currently not used by Android and wanted to constrain the
> exposed API as much as possible.
>
> Change-Id: Ibde45478421feeb610e045205c3f20c0e5b1567e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532456
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Change-Id: If6e768524a0e13e14ef886a6f081a09ddc0dc2fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533396
Owners-Override: Kevin Lubick <kjlubick@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
We now have a new type of ProgramKind, private runtime shaders.
`sksl_rt_effect.sksl` is now only loaded for these kinds of program.
Rather than having a special-case check for sk_FragCoord in
SkRuntimeEffect, the symbol will no longer exist at all unless a private
options flag is set.
Change-Id: I9223baaf59d74c44d64f322cd57fc841625342b7
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532784
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Bug: skia:13169
Change-Id: Icf0b720d3e3a13d490aba8495cf9db83d1d62318
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532762
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:13170
Change-Id: I11ef0ea5ac3ae61b24a47805bb3290a37880cfee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532536
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Android still uses this
https://developer.android.com/reference/android/graphics/Camera
but no other client does.
This adds a little adaption layer until Android is updated
to use the View3D version.
Move SkCamera.h to View3D.h. Change names to android::skia::CLASS
instead of SkCLASS. (3DView is not a valid class name, so rename it to
View3D.)
Forward-declare SkMatrix. Do not override SkNoncopyable - just delete
the copy constructor/operator=. Make fU and fV private in Patch3D.
Make Sk3DView override View3D temporarily until Android can be switched
over to the new class.
(View3D from http://review.skia.org/291371)
I made Patch3D and Camera3D be private classes as they are
currently not used by Android and wanted to constrain the
exposed API as much as possible.
Change-Id: Ibde45478421feeb610e045205c3f20c0e5b1567e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532456
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Graphite code snippets can be moved into these files; they will be
compiled once at build time and dehydrated for later use. This allows us
to avoid synthesizing and compiling them in each shader where they are
referenced. (Unfortunately, the GPU driver will still need to compile
them each time.)
Change-Id: I5cdc5881d71d7b81a02c91a84d52804f2909b483
Bug: skia:13110
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532259
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:13173
Change-Id: Ifbcce77605dd781563568293fc501dfa31f143da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528706
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
It's time to better organize //third_party/BUILD.bazel
This CL starts by moving the "third party" stuff we closely own.
Change-Id: I3e0be0044b790794e94f34af6202860ce0a7b7aa
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531999
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:13171
Change-Id: I6dffb98ac2464f930995cf8ea57e422091d20fd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531743
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:13118
Change-Id: Ica760f58107de021b7823f69b94809dd2f313ac7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531739
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I28ef42ff417faf98eb1f124d4a1987b6cc4a609f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530456
Auto-Submit: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:13212
Change-Id: I8fc8bcd01181fcfb9955119984afa4bfbb1f73e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529756
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I3a9e9e90b0ac1b1099830eaca06506bcce794144
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530055
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Previously just the base level was uploaded and the level contents
were generated on the GPU.
showmiplevels_explicit now works on GPU.
Bug: skia:11983
Change-Id: I96ed8a7ad90a8252f55a736cb6146eec9b2a3ad1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521356
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
There seems to be a copy-paste issue with the documentation for the
return value of SkFont::countText. SkFont::countText returns the number
of glyphs, measureText returns the sum of the default advances.
Change-Id: Id3c9008c20e7b4b8ad4f1d834df19183a9b2bf1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530046
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
https://en.cppreference.com/w/cpp/container/span/subspan
The real std::span::subspan in C++20 allows the "count" argument to
default to `std::dynamic_extent` (a fancy way of spelling ~0U). I didn't
think it would be worth adding `skstd::dynamic_extent`, but I did have
a use for an unbounded subspan, so I added a single-argument version to
SkSpan.
Change-Id: I297cc452cf2db727a3f9869ff8f46f3527e19370
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529603
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: Ia799cdff5288efe5d5d53e8d8f77cf32f3343371
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529131
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12701
Change-Id: Ib02db7160599d3c15a01597c746ce5131f2998e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526298
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of commit ae5e846047
Original change's description:
> [graphite] Move Graphite into Skia base directories.
>
> Change-Id: Ie0fb74f3766a8b33387c145bd1151344c25808cb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528708
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia575fd49206ad0b665a6a9153317e738bb321446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529059
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ie0fb74f3766a8b33387c145bd1151344c25808cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528708
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
It was decided that being able to report positions from C++ code is not
worth the cost of having all of these captures everywhere.
Change-Id: I94981d9f780bd95df8b56198210c9cdd5f16239c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528366
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: I484067cb1f6025dc9e6770c51c99bfc2c5925652
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528365
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Blocks did not previously track their position, creating problems
reporting some errors (which will be improved in followup CLs). Fixing
block positions changed the reporting of do loop errors, requiring do
loop position tracking to be updated as part of this change.
Change-Id: I3bd048a62d912914edf679f42607de1b5eafc2b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528045
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
IWYU doesn't always understand that we want defines to come from
certain files, so we add a pragma to force it.
This also adds an extra entry to known_good_builds so I don't miss
this type of thing again when building locally.
Change-Id: I2321ea95edfc6a4506d51a011983965eb9bdf1c0
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528164
Reviewed-by: John Stiles <johnstiles@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
While I was fixing up Chrome's uses, I found some failures
there that I did not see in Skia, and tracked them down
to a few other places where we include SkColorSpace
and it is not strictly necessary
- SkCustomMesh.h
- GrColorInfo.h
- GrColorSpaceXform.h
- SkColorSpaceXformSteps.h
For these files (and their .cpp files), I added enforcement
of include-what-you-use, and then fixed the myriad of places
which were depending on these transitive includes.
One change to help Chrome is the manual overloads of
SkImage::MakeFromAdoptedTexture instead of using default
parameters. This makes it so callers of that function
do not need to include SkColorSpace if they were going
to pass nullptr for it anyway.
Bug: skia:13052
Change-Id: I16bf8ed5e258225d887f562f2c189623b1ca9c23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527056
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
The implementation is inconsistent across CPU and GPU.
CPU currently always implements kStrict even when kFast is passed.
For mipmapping this means computing a set of levels from the subset,
which is an expensive.
GPU limits the texture sampling coordinates to the subset in the
base level. However, higher level mipmap pixels that map back to
a footprint outside the subset are still sampled. So GPU pays a
higher shader complexity cost without really providing the benefit
of kStrict.
We are adding anisotropic filtering, which will not work well with
kStrict, and thus will also be disabled by kStrict.
Must land after https://chromium-review.googlesource.com/c/chromium/src/+/3571661
Bug: skia:10481
Bug: skia:13078
Bug: skia:13036
Canary-Chromium-CL: 3571661
Change-Id: I011b8698a3f9fafa9b819486873c8ff54df6299e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527284
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This addresses (hopefully) all of the remaining suboptimal positions in
SkSL error reporting.
Change-Id: I5bc977b03d51153b841a89fa687e54e3e9cb6ec3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527976
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>