Commit Graph

49431 Commits

Author SHA1 Message Date
Michael Ludwig
4e3cab7919 Reland "Simplify GrClip API"
This is a reland of 9716414e93

Original change's description:
> Simplify GrClip API
>
> Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
> Replaces these three functions with preApply() that conservatively
> determines the clip effect up to a single rrect intersection. The major
> motivation for this is the new GrClipStack implementation. preApply()
> and apply() will be able to reuse much more code compared to separating
> the preApply functionality across the older three functions that were
> removed. Additionally, preApply is able to convey more information for
> less work, since it can usually determine being skipped or unclipped while
> determining if the clip is a single rrect.
>
> As part of using this API, the attemptQuadOptimiziation and the equivalent
> rrect optimization are overhauled. Hopefully legibility is improved, and
> the rrect case is now applied outside of the android framework (but with
> tighter AA requirements).
>
> Bug: skia:10205
> Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Bug: skia:10205, 10456
Change-Id: I500eeda36ea50e95eb8cb658b36aa2373d5166c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298823
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-30 19:57:11 +00:00
Greg Daniel
ce9f016ed3 Remove unused GrFlushFlags.
This also adds back default flush() calls which simply do a flush
without any submit.

Change-Id: Ia8c92bbdecd515d871abfa6364592f502e98656b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298818
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-06-30 19:39:31 +00:00
Mike Klein
511cf4fca7 start on windows jit support
- Replacement for in-memory JIT mmap,mprotect,munmap.

  - dylib feature disabled (for now, but could be done
    with LoadLibrary/GetProcAddress)

  - Mostly share impl with __x86_64__, but with enter
    and exit updated for the MS ABI.

I "rediscovered" along the way that r12 has the same low three
bits as rsp, and that means the assembler needs to handle it
specially in at least one place it's not today.  No big deal;
we can easily avoid using r12.  GP registers are all statically
allocated.  Left a warning and a TODO.

Still need to investigate 17 GMs that are triggering asserts.

Change-Id: I0f543b0efab968e805e89dcf1f068eac1cafea38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298530
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-06-30 19:07:19 +00:00
Greg Daniel
746460e25a Fix d3d backend texture uploads when used formats need swizzling.
This does a few things. First when we are trying to upload a color via
our updateBackendTexture API we use GrClearImage to fill out a cpu buffer
with that data. But we need to know how to swizzle this cpu data so that
it falls into the correct channels when we copy it to the GPU texture.
This requires adding a couple more color types to handle some of the odd
4444 cases which are swizzled differently and what seems every backend.
We then can get the correct swizzle for the GrClearImage call.

This change also fixes the DXGI_FORMAT_B4G4R4A4_UNORM read and write swizzles.

In follow on change I will update other APIs which use GrClearImage to make
sure they are using the correct GrColorType to represent their internal
formats memory layout.

Change-Id: I92d1d7728dc6e317553e04c1ecfcd872f95a5f99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299865
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-30 18:56:57 +00:00
John Stiles
09dbeff19a Update SkModeColorFilter to support an input FP.
This change relies on the Xfermode updates in the prior CL
(http://review.skia.org/299703) to render properly, and requires
slightly different blending behavior in the compose FP which
necessitated a new ComposeBehavior enum.

Eventually we would like to settle on a universal ComposeBehavior which
works well for all call sites, but that will be its own fairly
disruptive change. This work will be tracked at skia:10457.

Change-Id: I3cc0ea5e016fbef82bc63d653d60d0505efaa66f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298821
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-30 18:50:02 +00:00
Robert Phillips
44333c58f6 Make asDirectContext return a GrDirectContext
Change-Id: I373658d68582adc9728f3a75d84178a365f5b798
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299877
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-06-30 18:48:17 +00:00
John Stiles
5c57e88d8f Redesign GrXfermodeFragmentProcessor to use one FP instead of two.
Previously, we had separate "ComposeOne" and "ComposeTwo" fragment
processors. These performed extremely similar roles, but varied in
the number of child FPs used, and treatment of the input color's alpha
channel.

This CL combines these two FPs into a single unified "Compose" fragment
processor. To avoid breaking many existing GMs, the semantics of the
prior FPs have been preserved as closely as possible. (Specifically, the
FP treads very carefully to ensure that the alpha channel handling
matches the old code, as dozens of GMs fail otherwise.)

Change-Id: I7ab453f3313e70ae25e5e70f86373a64ff02072f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299703
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-30 18:44:57 +00:00
Brian Salomon
3207fbeae2 Fix release build of viewer with Vulkan
Change-Id: I26c7b6030bb6be7e5005a05c593d1de40dda88db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299859
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-30 18:38:07 +00:00
Mike Klein
5e09432f4f careful constants map handling
Setting up the Windows JIT made me notice that we can
modify the constants SkTHashMap while using it, e.g.

   a->vfmaddps132(dst(x), reg(y), any(z))

if any() returns a Label* Operand pointing to a constant, and
reg() needs to load from a constant too, and the second to touch
the constants map causes a hash table resize, the other is left
with a Label* that's pointing into the old table.

The fix is to (mostly) never modify the constants table when
looking up constants, instead using the Op::splat to seed the
table.  A couple miscellaneous constants like 0xffff'ffff as
used by assert_true are not dangerous so I've left them alone.

This is the sort of bug ASAN would catch, except we turn off
the JIT when building for ASAN.  I think I can tighten that up
so that we still JIT under ASAN, but never use the JIT'd code.
That'd let us catch bugs like this in the JIT itself.

Change-Id: I91d8f6fda721a6e3c9e3629d694a73fd1b2bf8f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299879
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-30 18:15:07 +00:00
Jorge Betancourt
afaf5d56c5 performance increase by not drawing on do nothing frames
Change-Id: Ibcd4f0ed468563b22e29d23c7d72b474534d21f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299916
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-06-30 18:14:27 +00:00
Chris Dalton
2d7cf46c81 Use SkTPin instead of std::clamp
std::clamp is c++17 so using it causes some builds to fail.

Change-Id: I3e90ffc081e1f18ebab1c4f403826e94e58bf07d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-06-30 17:19:07 +00:00
Chris Dalton
1c62a7b034 Implement stroking with GPU tessellation
Bootstraps tessellated stroking using GrStrokeGeometry mostly as
written. Strokes get decomposed into tessellation patches that
represent either a "cubic" (single stroked bezier curve with butt
caps) or a "join". The patches get drawn directly to the canvas
without any intermediate stencil steps. For the first revision, only
opaque, constant-color strokes are supported.

Bug: skia:10419
Change-Id: I601289189b93ebdf2f1efecd08628a6e0d9acb01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299142
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-30 16:19:36 +00:00
Brian Osman
b6b95739a5 SkSL: Rename isConstant to isCompileTimeConstant
This better reflects what the return value means, and eliminates
confusion with the SkSL concept of "const" variables, which are
not known at compile time.

Change-Id: I14973ceb36ae4ab6bad8a13bb93e1788a1b18bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299863
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-30 16:14:36 +00:00
Brian Osman
711e73c099 SkSL: Variable references are never "isConstant"
isConstant really means "has a known value at compile time", but for
variables declared with "const", the two meanings had been conflated.
There were several ways for this to produce surprising error messages.
The included unit test crashed before removing the override, and now
passes.

Change-Id: I49b926e51c421db93240cbbf42231de0444358d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299860
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-30 15:59:26 +00:00
Weston Tracey
d681aa258a [infra] Add xcode-11.4.1 asset
Change-Id: I793975f11a5c1f71729d081c1ce59f8d2e2f58de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299857
Commit-Queue: Weston Tracey <westont@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Weston Tracey <westont@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-06-30 15:36:53 +00:00
Michael Ludwig
fc2fdf025e Support sample coords in .fp main()
This removes the code generation support for @coordTransform and sk_TransformedCoords2D
when processing .fp files. Instead, the main() function can optionally add a float2
parameter. This is marked as the SK_MAIN_COORDS builtin, just like the main function
for a runtime pipeline stage.

Bug: skia:10416
Change-Id: I0c192d890bb798a1167bc445003f6ddffe6118f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299687
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-30 15:18:03 +00:00
Robert Phillips
ad2484520d Make the GrDirectContext a thing and move it to include/private
This is somewhat of a departure from the original context refactoring
plan (i.e., keep GrLegacyDirectContext hidden and switch GrContext over
to be the GrDirectContext at some point). Having a GrDirectContext
earlier will allow us to change some important signatures earlier
(e.g., asDirectContext) and, hopefully, clarify some of the confusion
about the context class hierarchy.

Additionally, this will let us make onGpuSetup take a direct context -
clarifying its purpose vis a vis onDraw (which now takes a recording
context).

Change-Id: I8298a0649bc95843d20bee33ba7fe1d7e73bb839
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299768
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-30 14:57:24 +00:00
Ben Wagner
41abd4f5cc Remove SkWhitelistTypefaces.
This was originally added to reduce the size of the large skp set by
reducing the number of fonts fully serialized. At the time all fonts
were fully serialized into all skps. Oddly enough this was actually a
blacklist of fonts which should never be fully serialized. The list was
easy to get out of date (it needed to be regenerated whenever the
container the Chromium html to skp conversion ran in was updated) and
unclear how to use well (the user would need to replay the skps in said
container to get mostly correct playback).

Since that time, it is now possible for the user to specify how to
serialize typefaces. In addition, further flexibility is now provided
though serialization and deserialization procs provided to the recorder
so that the user can have even greater control over individual
recordings, so if this is needed again there are cleaner ways to write
it without globals. Also, Cluster Telemetry doesn't really capture skps
this way anymore so this code isn't really being used.

In the future should such a mechanism be required, it would probably be
best to first create a base image of fonts to use as system fonts and
then set up the container which captures the skps to use exactly those
system fonts. Then all system fonts can avoid serialization and the font
collection and setup (or possibly just base container) can be shared for
playback.

Change-Id: I27412a8fd35b89af293b4151ea8cecc2b1bc7226
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299838
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-30 14:54:53 +00:00
Michael Ludwig
8f3a83671a Write SkSL visitor pattern and consolidate sampling analysis
Besides moving the existing coord-overrides and sample matrix merging
logic on to a shared visitor pattern, this updates the sample coord
reference detection to actually look for references to that built-in.

Previously, we only had this behavior in the CPP code generator. The
.h generator just did a string search for sk_TransformedCoords2D, and
runtime effects just looked at the main signature. Now, the .h generator
is more robust, and runtime effects that declare the main coords parameter
but never use it will not be marked as using the sample coords directly.

Change-Id: I802d610dbda512cf3823c58f349307b3926aa58f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299458
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-30 14:04:23 +00:00
Robert Phillips
95c250c247 Downgrade GpuGMs to only receiving a GrRecordingContext
Most of this CL is just noise (i.e., all the header changes) due to the
signature change. The 'discard' GM has some substantive changes but
that's about it.

Change-Id: I72011a442c149b5db93cf8decade6779be4f63d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296704
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-30 13:02:33 +00:00
skia-autoroll
359d16da11 Roll Chromium from 2076810705d0 to 277fb4f3a407 (412 revisions)
2076810705..277fb4f3a4

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC ethannicholas@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: ethannicholas@google.com
Change-Id: I8f95b871447f845acc9f8b306df8303e4ebe3ec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299799
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-30 04:47:43 +00:00
skia-autoroll
a2bb8c0957 Roll ANGLE from 69c011ef35f1 to 06462adde69b (13 revisions)
69c011ef35..06462adde6

2020-06-30 syoussefi@chromium.org Add a test for copying from one mip to another
2020-06-30 timvp@google.com Vulkan: Store transformed SPIR-V in ProgramExecutableVk
2020-06-29 jonahr@google.com Fix disable_native_parallel_compile workaround condition.
2020-06-29 nguyenmh@google.com Refactor frame_capture_utils.h to frame_capture_test_utils.h
2020-06-29 m.maiya@samsung.com Vulkan: Set new layout based on VkImageUsageFlags
2020-06-29 courtneygo@google.com Vulkan: Implement invalidate for color buffers
2020-06-29 syoussefi@chromium.org Vulkan: Remove superseded updates when flushing to image
2020-06-29 ianelliott@google.com Vulkan: Skip *functional.attribute_location.bind* tests
2020-06-29 syoussefi@chromium.org Vulkan: Remove suppression of fixed dEQP tests
2020-06-29 etienneb@chromium.org Fix delegate Worker Thread Pool creation
2020-06-29 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from eb0a25a189b7 to b3240d0c355a (2 revisions)
2020-06-29 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from fbb9dc2cf1af to 27e915ed4f20 (2 revisions)
2020-06-29 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from efaae24d0006 to 91c50e3fc993 (2 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC ethannicholas@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1091259,chromium:1094869
Tbr: ethannicholas@google.com
Test: Test: CQ
Change-Id: I4f989c4c029c6e962c345a619d12904a79b2e3be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299801
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-30 04:39:23 +00:00
skia-autoroll
eb1a9106b4 Roll dawn from ff90599cdf60 to b231c7fb717d (5 revisions)
https://dawn.googlesource.com/dawn.git/+log/ff90599cdf60..b231c7fb717d

2020-06-29 cwallez@chromium.org Null: Make Increment/DecrementMemoryUsage use uint64_t.
2020-06-29 yunchao.he@intel.com Fix a bug in PassResourceUsageTracker.cpp
2020-06-29 tommek@google.com Caching empty bind group layouts
2020-06-29 bryan.bernhart@intel.com D3D12: Remove ComPtr from d3d12::Buffer::GetD3D12Resource
2020-06-29 jiawei.shao@intel.com Enable two cases in TextureZeroInitTests with swiftshader

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC cwallez@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: cwallez@google.com
Change-Id: I584bf523a7bee7da0309e6040feec65a57c2cb5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299800
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-30 04:31:53 +00:00
Brian Osman
10b7541a1e Add proj() intrinsic (XY / Z), fix bug with perspective matrix sampling
Previously, we'd declare a new temporary variable using the matrix
expression. For GrSkSLFP in particular, that would happen *before*
any other code had been emitted, so if the expression referred to
local variables, it would produce SkSL that used a not-yet-defined
variable, and not compile.

Change-Id: I1cdd8920b0c659b905809c126d10c01b996e6a55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299778
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-29 23:41:02 +00:00
Heather Miller
3a54b68cb4 release notes for 85 to web page
Bug: skia:
Change-Id: I5bf7b18605a6f487e558688ec90c81f27ad3ed8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299702
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2020-06-29 21:44:05 +00:00
Heather Miller
22c6aa126d Update Skia milestone to 86
Change-Id: Id81c58007f74816a8c2ac0831d61c041c5a7468c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298916
Reviewed-by: Heather Miller <hcm@google.com>
2020-06-29 21:18:16 +00:00
Ben Wagner
8c3daeb5d2 Allow fontmgr factory to depend on fontmgrs.
In 75626e4b1a "Regularize selection of fontmgr." a clever change was
made which allowed the skia_fontmgr_factory to be specified as a source
file to allow the user to specify which factory to use. Unfortunately
this implies that the Skia target which uses this source does not know
which other targets (like fontmgr targets) to depend on. A factory
target must generally depend on the target which provides the widget the
factory makes.

This change puts all the current factories into targets of their own so
that they can depend on whatever they need. The skia_fontmgr_factory is
now the name of a target which is the sole public member of the
:fontmgr_factory target. Users can now specify a particular fontmgr
target to build into Skia as the default instead of simply specifying a
source file.

The fontmgr_fontconfig target now also properly publicly depends on the
fontconfig target since it has a public header which includes
fontconfig.h.

Bug: b/160133836
Change-Id: I212d842b8e07c4e99ab53e32310642d18eeb7cb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299677
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-29 21:03:04 +00:00
Brian Osman
49b30f451e SkSL ByteCode: Remove specialized instructions for N up to 4
Nearly all instructions have one form, with a count byte after the
instruction. Simplifes the SkVM conversion logic, reduces code size.

Change-Id: I5ff7bb2991a09198c5c8f5bcaf2c1017c06be5d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299682
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-29 20:45:34 +00:00
Michael Ludwig
e7e25ac904 Remove workarounds to support legacy coord transforms
Bug: skia:10416
Change-Id: I2f1b87521174d18afc59f12832441010cb94ea3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299294
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-29 20:23:54 +00:00
John Stiles
9f2a333c01 Update SkColorFilterShader to use an inputFP instead of RunInSeries.
Change-Id: I22a6b110c414fe3d8942b2c890c1339de45c39e6
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298984
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-29 20:09:25 +00:00
Robert Phillips
c7ed7e6fde Revert "Add storage on the surface for its last render task"
This reverts commit ca5b36c474.

Reason for revert: This may be blocking the Chrome roll

Original change's description:
> Add storage on the surface for its last render task
> 
> Let's land this and see if it gets us back to baseline on the
> lastRenderTask regression from the bug. If it doesn't, we'll revert it
> since the extra complexity won't have been worth it.
> 
> Bug: skia:10372
> Change-Id: I9d5ae93435b833d575afdc7f219dc8e7c453c92b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297836
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

TBR=robertphillips@google.com,adlai@google.com

Change-Id: Id418d042d1123d946cd99b7b1ba438211cb628ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299763
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-29 20:05:06 +00:00
Jorge Betancourt
ea25120849 Clean up skottielib: modify access to package classes and delete unneeded code
Change-Id: I86bff8efde4bdcd269c0c9940643926f9362dff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299596
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-06-29 20:04:24 +00:00
Brian Salomon
0c24320f91 Reland "Don't flatten images in SkImageShader"
This is a reland of 318afe66e6

Original change's description:
> Don't flatten images in SkImageShader
> 
> Bug: skia:9570
> 
> Change-Id: Idd4485b5c5814501fe98fbf2115d89a80a41f5c7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299139
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

Bug: skia:9570
Change-Id: I4761e354dd4ec4f4a60097e06c3b9b9b73e538f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299681
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-06-29 19:02:54 +00:00
Florin Malita
aaf945c2fc Add a full build option for SkottieKit
Change-Id: Iff6863bfb243a28b83455b72936f4b168572f7a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299679
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-06-29 18:48:14 +00:00
John Stiles
4320664ebe Update SkGaussianColorFilter to support an input FP.
Change-Id: Idf0c2fa4a0affb8c661d5610167bd8990781920b
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298982
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-06-29 18:42:54 +00:00
Robert Phillips
a1121331a4 Be more consistent about calling release procs in SkImage factories (take 2)
I will follow this up with a Chrome-side CL to fix the call sites of the following factories:
   MakeFromCompressedTexture
   MakeFromTexture
   MakeFromYUVATexturesCopyWithExternalBackend
   MakeFromYUVTexturesCopyWithExternalBackend
   MakeFromNV12TexturesCopyWithExternalBackend

Here is the Chrome-side CL: https://chromium-review.googlesource.com/c/chromium/src/+/2264598/ (Skia's SkImage::Make* factories now guarantee cleanup)

Here is the Chrome-side CL that adds the guard flag:
https://chromium-review.googlesource.com/c/chromium/src/+/2273067/ (Add flag in order to roll a Skia CL into Chrome)

TBR=bsalomon@google.com
Bug: 1097484
Change-Id: Ic2fcdc116f0f866b33d752b6d5abc784c7f65be6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299663
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-29 18:40:04 +00:00
John Stiles
ad43fd834f Update SkSRGBGammaColorFilter to accept an input fragment processor.
Change-Id: Ib9a61ffba5495c67652662a0d15fafc8f1f6ff1f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299577
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-06-29 18:09:14 +00:00
John Stiles
3e62762229 Clean up GrColorSpaceXformEffect to allow a null child FP.
Previously, GrColorSpaceXformEffect had separate Make methods; one took
a child FP, the other did not, and they had slightly different color-
transform inputs (the destination alpha type was assumed to be premul
when a child FP was provided). A null FP was considered invalid.

This has been updated to work more like other FPs. An childFP must
always be supplied, and nullptr is interpreted as "use the sk_InColor".
The destination alpha type is now always supplied. Existing call sites
were fixed up as needed.

Previously, the child-FP path would actually render the product of the
child FP and the sk_InColor. This extra multiplication step no longer
occurs; the sk_InColor is simply ignored when a child FP is used. In
practice, this did not affect any existing GM tests.

Change-Id: Id53449234948255cbdaab9b88b1c94201eeb0a0d
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299576
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-06-29 18:06:04 +00:00
Michael Ludwig
fbe28593e5 Remove GrFragmentProcessor::addCoordTransform()
At this point, every created instance of GrCoordTransform is an identity
so can be removed. Adding it manually using addCoordTransforms() is no
different than relying on the (current) implicitly returned coord
transform if the FP calls setUsesSampleCoordsDirectly().

Removing the addCoordTransform() lets us enforce that this remains the
case and this CL also deletes all of those members that were previously
used to provide access to the sample coordinates.

As part of this, GrFragmentProcessor.h and many other files no longer
need to include GrCoordTransform.h. This exposed a surprising popularity on
SkMatrixPriv.h so I updated those files to include that header directly.

Technically, a .fp file can still have an @coordTransform section and
the sksl generator will try and call addCoordTransform, which will then
fail to build. A follow up CL removes that support in .fp generation.

Bug: skia:10416
Change-Id: I5e4d2bb49ee6d7e56ac75ca00be5631106fec20b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299291
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-29 16:58:54 +00:00
Adlai Holler
f19bbb52b2 Finish the DDL sk_sp migration
This will not be landed until chrome CL 2269958 lands.

Bug: skia:10425
Change-Id: I2a5081201ca3faed5232e8540086bd4c6f865767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299292
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-29 16:49:54 +00:00
Derek Sollenberger
0851459813 Revert "Don't flatten images in SkImageShader"
This reverts commit 318afe66e6.

Reason for revert: breaking Android roller due to failed CTS tests when drawing content from different colorspaces

Original change's description:
> Don't flatten images in SkImageShader
> 
> Bug: skia:9570
> 
> Change-Id: Idd4485b5c5814501fe98fbf2115d89a80a41f5c7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299139
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

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

Bug: skia:9570
Change-Id: I25af1062fb75a8353dd7b7dbb174eb06fa5b24fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299676
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-29 16:34:03 +00:00
Adlai Holler
ca5b36c474 Add storage on the surface for its last render task
Let's land this and see if it gets us back to baseline on the
lastRenderTask regression from the bug. If it doesn't, we'll revert it
since the extra complexity won't have been worth it.

Bug: skia:10372
Change-Id: I9d5ae93435b833d575afdc7f219dc8e7c453c92b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-06-29 16:10:46 +00:00
Robert Phillips
bedaef32cd Use recording context more widely in SkGpuDevice
The GpuDevice only guarantees a recording context so start removing the assumption that we have a GrContext.

Change-Id: I9fd3dba64799a3b0b5857aa1946c497f1984df23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299557
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-29 15:50:55 +00:00
Stephen White
33603fd541 Fix DDLOperatorEqTest on Dawn backend.
If the backend doesn't support mipmaps, skip the test cases which
only differ by the mips flag.

Bug: skia:10361
Change-Id: I05e3bc59c2d9d1af6b5cb3659a7a346f2cdc8b82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299558
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-29 15:33:25 +00:00
Jorge Betancourt
1449d835af Move InputStream handling of SkottieLib to SkottieView
An effort to hide nuts and bolts from developers who wish to use
SkottieLib in their own application.

Change-Id: I2020e73279a53de8852d5b04d90d0e28bdbb5c6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298978
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-06-29 14:08:35 +00:00
Florin Malita
65513a9834 Tweak scripts to fix CK builds with python 3
- print -> print()
- xrange() gone in 3, but range() works similarly - if somewhat
  less efficient in 2
- read() returns strings in python 2 vs. bytes in 3

Change-Id: Ia720551832ef75edbf9235b80a06e2ffa3ddf4b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299444
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-06-29 12:59:05 +00:00
Robert Phillips
24e2f6e25e Add program pre-compilation to Vulkan backend
This CL fills out the GrVkGpu::compile method and updates GrVkCaps::makeDesc to both reconstruct the GrVkRenderPass AttachmentsDescriptor and AttachmentFlags from the GrProgramDesc.

In the 'compile' case, the renderPass info is used to get a renderpass and then a pipeline state.

In the 'makeDesc' case, the renderPass info is used to create the ProgramDesc.

Bug: skia:9455
Change-Id: I3810651232c95c3d837d96655853ea54056c70cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288462
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-29 12:57:35 +00:00
skia-autoroll
f63713518c Roll SwiftShader from eb0a25a189b7 to b3240d0c355a (2 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/eb0a25a189b7..b3240d0c355a

2020-06-28 capn@google.com Optimize clearing of depth and stencil images
2020-06-26 thakis@chromium.org mac: Add ARM64 support to swiftshader.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC ethannicholas@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: ethannicholas@google.com
Change-Id: I64cb424f915537ea5da12444f85c0df629f74f82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299509
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-29 05:47:05 +00:00
skia-autoroll
a1429c4efe Roll Chromium from 86c1522319ef to 2076810705d0 (570 revisions)
86c1522319..2076810705

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC ethannicholas@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: ethannicholas@google.com
Change-Id: I173df2818a86454f204aeb8680d4d6aa75746255
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299507
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-29 05:07:35 +00:00
skia-autoroll
63b499b9a9 Roll ANGLE from c81da1c809fe to 69c011ef35f1 (12 revisions)
c81da1c809..69c011ef35

2020-06-26 syoussefi@chromium.org Assert no undefined behavior with left shift in angle::Bit
2020-06-26 m.maiya@samsung.com Vulkan: External image layout needs to be ReadWrite
2020-06-26 ianelliott@google.com Vulkan: Fix fbo_invalidate tests for pre-rotation
2020-06-26 nguyenmh@google.com Reformat Framebuffer::readPixels
2020-06-26 ianelliott@google.com Vulkan: Fix copySubImageImplWithDraw() for pre-rotation
2020-06-26 ShabbyX@gmail.com Vulkan: Fix mipmap generation and level redefinition
2020-06-26 syoussefi@chromium.org Vulkan: Remove emulated clears before mipmap generation
2020-06-26 cwallez@chromium.org Skip MultithreadingTest.MultiCreateContext on Ozone
2020-06-26 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 23498d296498 to 2e189d3854db (1 revision)
2020-06-26 cwallez@chromium.org Suppress dEQP GLES3 attribute aliasing on Vulkan
2020-06-26 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 7a1af5878594 to efaae24d0006 (2 revisions)
2020-06-26 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Tools from 0f4d5f74f199 to ff825d988fe8 (1 revision)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC ethannicholas@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1094599,chromium:1094644
Tbr: ethannicholas@google.com
Test: Test: angle_deqp_gles2_tests --gtest_filter=dEQP.GLES2/functional_texture_specification_basic_copy*teximage2d_*Test: Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_\*Test: Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_texture_specification_basic_copy*teximage2d_*
Change-Id: I2ecd737320938a496cce0a5acdc139c070002243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299510
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-29 05:05:45 +00:00