Commit Graph

2232 Commits

Author SHA1 Message Date
Jim Van Verth
fd89e0bdd0 Add GrD3DRenderTarget and GrD3DTextureRenderTarget.
Bug: skia:9935
Change-Id: I91b6218946ba04e893adaec3c0077653a62efe2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279136
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-26 20:15:30 +00:00
Jim Van Verth
6ec5688413 Rename GrD3DTextureInfo to GrD3DTextureResourceInfo.
Also renames GrD3DSurfaceResource to GrD3DTextureResource. This makes
things consistent with our naming convention in Vulkan, and with the
terminology used in Direct3D.

Bug: skia:9935
Change-Id: I6e6d2066ac70eb8a0d63c1b5731f31851a3017d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279338
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-26 16:26:44 +00:00
Chris Dalton
17dc41870a Rename CPU tessellation to "triangulation"
Ambiguity has come up re: what "tessellation" means in Ganesh. I
believe that, in the context of a graphics library, "tessellation"
should refer to the hardware pipeline feature of submitting patches
and tessellating them on the GPU. This CL therefore renames classes
that triangulate things on the CPU to call it "triangulation".

Change-Id: Ic8515ea6a33000f1b638a852d5122bc9bd6b38f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279236
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-26 16:21:39 +00:00
Chris Dalton
a6adc5c8d4 ccpr: Polyfill buffer mapping when not supported
Change-Id: I62880a83d9b59d42c6491125e2a62338d2ce757f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279200
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-25 19:20:07 +00:00
Chris Dalton
2b5989005c Bootstrap a very simple viewer implementation in CanvasKit
Adds a "viewer" option to the build system that brings in tooling code
and sample code. Adds a very simple "MakeSlide" binding that knows
how to create the WavyPathText sample slide. Adds viewer.html with
code to animate viewer slides.

This can hopefully be the starting point for future work on bringing
viewer to CanvasKit.

Change-Id: Ia26e08726384b40b3f544fe8254f430dc9db08db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278892
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-25 17:31:56 +00:00
Jim Van Verth
8b932b157b Fill in the D3DTexture class.
Bug: skia:9935
Change-Id: Idd37e677462fec7ed0beca0fe578fb1a2f497eb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278784
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-03-24 20:12:13 +00:00
Michael Ludwig
4519134e07 Implement GrTAllocator in terms of GrBlockAllocator
Previously, the GrAllocator header defined three types: GrAllocator,
GrTAllocator, and GrSTAllocator. GrAllocator was generic, and would
manage the blocks of memory (fixed size to hold N * sizeof(item)). It
stored an SkTArray of pointers to each block. GrTAllocator wrapped
the GrAllocator to add template support for a specific T. GrSTAllocator
extended GrTAllocator to include a template arg for inline storage.

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

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


Change-Id: I28b0bc277c323fd7035d4a8442ae67f058b2b64c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272058
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-03-24 18:00:33 +00:00
Robert Phillips
9b00f1ff54 Make skia_use_xps option work on Windows
Some may not want to always compile XPS on Windows

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

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

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

Bug: chromium:1039816
Change-Id: I97e47d3c70949020c3e0a69b8c9fc743748f3a7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277426
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-03-24 15:52:55 +00:00
Greg Daniel
e52c9784f0 Add GrD3DCommandList class.
This doesn't do much except creates the new class.

Change-Id: I157abaddd173bf1b6ab5eba2539e90c4d530a273
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278469
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-23 18:58:27 +00:00
Jim Van Verth
05d091935a Flesh out backend textures and rendertargets to support Direct3D.
Add GrD3DTextureInfo and GrD3DBackendSurfaceInfo, and uses those
to initialize GrBackendTexture and GrBackendRendertarget.

Bug: skia:9935
Change-Id: I4571c1b3aa8115250ff748deb8cf4a95f80f1237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278036
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-03-20 17:12:46 +00:00
Brian Salomon
f4ba4ec796 Revert "Revert "Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots""""
Updated to use sentinel GL context even when GL backend is not built.

This reverts commit 1171d314ef.

Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-20 17:11:58 +00:00
Chinmay Garde
f832c0ae49 Allows Skia users to disable use of API_AVAILABLE in the Metal backend.
On certain older versions of the Clang toolchain, the use of the API_AVAILABLE
macro on symbols in C++ translation units causes the visibility of those
symbols to me treated as default instead of the hidden. This causes internal
symbols to be exposed from release dylibs.

This mechanism allows users of the toolchains that have not been updated to the
latest versions to disable the use of the macro in release configurations.

Change-Id: I656361770c2011cff4c1b252761b5d0f3d89edc5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277775
Auto-Submit: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-19 21:10:55 +00:00
Brian Salomon
1171d314ef Revert "Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"""
This reverts commit fb27c9a25f.

Revert "Remove MoltenVK support"

Reason: TSAN Vulkan bots hanging.

This reverts commit 6cafe73da9.

Change-Id: I8ec9db35c112f3c8da8636dab2065e6f18de7d0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277936
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-19 13:10:59 +00:00
Brian Salomon
6cafe73da9 Remove MoltenVK support
We haven't tested this in a while. Use the Metal backend instead.

Change-Id: Ic06bf4faff99950bd24e41bdea03962db99cfeee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277612
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-03-19 12:23:23 +00:00
Mike Reed
430c5a1081 hide bitmap virtuals
SK_SUPPORT_LEGACY_ONDRAWBITMAP_VIRTUALS flag to stage this

Change-Id: I32c1bc954446b44cbe656f07cf6f2ad70668b723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-18 20:01:28 +00:00
Brian Salomon
fb27c9a25f Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots""
This reverts commit 00ba5ef4a6.

Bug: skia:10051

Change-Id: I13fd5494b7e7e64159e6330f168ab8c16a2db149
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277609
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-18 18:12:11 +00:00
Brian Osman
0b1e5fc8f2 Remove GrGLSLUtil
This had a not-very-useful matrix utility in it. We've had setSkMatrix
for a while, and the one other user always wanted a 4x4, which can be
done with SkM44 just as easily.

Change-Id: I3f00a0a1ccaf58bc9c775da4eef819af5a5fa7e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277605
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-18 16:42:28 +00:00
Brian Salomon
00ba5ef4a6 Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"
This reverts commit f6784a8c84.

Reason for revert: breakage of builds

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

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

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

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

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

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

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

* Removed minimum cache size from setCacheSizeLimit.

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

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

Bug: skia:9703
Change-Id: Ib8fcebd9e0e35bea5ef23e6fd5962654a28d587b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277214
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-16 19:59:26 +00:00
Chris Dalton
eb694b767c Rename GrMesh to GrSimpleMesh
Change-Id: Ib164ff3ec41cb798385f2feea8ad09c037dbc30d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276837
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-16 16:18:30 +00:00
Derek Sollenberger
320c32bfa3 Remove mips workarounds for Android.
see
https://android-review.googlesource.com/c/platform/external/skia/+/1252938
for additional context.

Change-Id: I345b5020f81b2193ff92e2704d2050fb5c19a766
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276917
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
2020-03-13 18:46:26 +00:00
Mike Reed
019385eb1d remove LerpRed shader
Seems very one-off (esp. given SkSL). No one seems to use it.

Change-Id: Iaded54c5b4183fa4aa9c318b5dbe1d410cca539a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276617
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-12 18:37:17 +00:00
Jim Van Verth
5082df1cf5 Remove need for gpu when unrefing managed resources.
Metal and D3D don't require the GrGpu to delete resources, and for
Vulkan, we'll store the GrVkGpu in each individual resource. This will
allow us to use sk_sp<SomeManagedResource> in the future.

Bug: skia:9935
Change-Id: Id51022b935ad360367976a6bdf60cdda9e3f7dee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276456
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-11 21:02:07 +00:00
Mike Klein
3a74f83e80 remove -D_GLIBCXX_DEBUG
This was a convenience for Cary to not have to use extra_cflags,
and iterferes with using prebuilt C++ code by breaking the ABI.

Change-Id: I9e14ec04106a0abf9b55e5803242c2eb226d6e3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276445
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-11 18:12:48 +00:00
Mike Reed
fdf94044ff Remove exotic legacy bitmap drawing entry points: Nine, Lattice
follow-ups:
- remove associated virtuals in canvas

Change-Id: I3efa7a88ed0905ebf080712993e7f43148df36dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276282
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-11 13:11:47 +00:00
Jim Van Verth
3e192165cb Hoist GrVkResource up so it can be used for D3D and Metal.
Bug: skia:9935
Change-Id: Ie13b9077c5db805020973e5cbab1aa8468c88742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276214
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-03-10 22:37:10 +00:00
Leon Scroggins III
a77f30c7db Reland "Split building encoding from decoding"
This reverts commit 9d4b788807.
Copyright issue has been fixed in
https://skia-review.googlesource.com/c/skia/+/275998.

Original description:
Bug: skia:9756

In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.

Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.

Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.

Change IsPng signature to match other SkCodecs.

TBR=djsollen@google.com

Change-Id: Ic847bae0154e0a2922100b3f2ee14a077ee5635a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276007
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-03-09 20:21:19 +00:00
Julia Lavrova
e65c5fc14c Enable skia_use_icu for iOS
Bug: skia:9977
Change-Id: I0bf7fe972efe48c5c2b0fd8eabab1d6ff249faee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275959
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-03-09 16:23:29 +00:00
Greg Daniel
02c45909ff Add empty GrD3DResourceProvider class.
Bug: skia:9935
Change-Id: I28f799cb53eb12fc1bd63f4fbcf1e1a09d7ccf3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274937
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-03-09 15:43:48 +00:00
Martin Vejdarski
c56950442d fall back to vswhere.exe to find msvc
Change-Id: I5cba7406522479c05dc5148357eed31d105a31fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275876
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-08 23:57:16 +00:00
Brian Osman
2e19af063b Revert "Move interpreter disassemble to out-of-line member of ByteCode"
This reverts commit 1b0124fec6.

Reason for revert: Check generated files bot is unhappy.

Original change's description:
> Move interpreter disassemble to out-of-line member of ByteCode
> 
> Now it returns a string (rather than just calling printf).
> 
> Adds GUI view of particle effect byte code (for fun), and fixes the
> unit tests that called ByteCodeFunction::disassemble, which wasn't
> doing anything.
> 
> Change-Id: Ide3fd933cf14832feae7ff9e0fdc1ae8f24a28d4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273878
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com

Change-Id: I478a93769a3e1a72a339853d6d41865dba8bbe66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275800
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-07 17:44:05 +00:00
Brian Osman
1b0124fec6 Move interpreter disassemble to out-of-line member of ByteCode
Now it returns a string (rather than just calling printf).

Adds GUI view of particle effect byte code (for fun), and fixes the
unit tests that called ByteCodeFunction::disassemble, which wasn't
doing anything.

Change-Id: Ide3fd933cf14832feae7ff9e0fdc1ae8f24a28d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273878
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-06 22:16:11 +00:00
Mike Klein
9d4b788807 Revert "Split building encoding from decoding"
This reverts commit 94aaf7cdf5.

Reason for revert: you know what I already typed the reason stop making rules that people have to follow, robots.

Original change's description:
> Split building encoding from decoding
> 
> Bug: skia:9756
> 
> In CanvasKit, a large part of the binary is for encoding. Clients
> would be happier with a smaller binary and no webp/jpeg encoding. Make
> this an option by splitting up the GN arguments.
> 
> Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
> existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
> PNG.
> 
> Update CanvasKit compile script to disable webp and jpeg encoding.
> Update debugger compile script to disable all encoding.
> 
> Change IsPng signature to match other SkCodecs.
> 
> Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Nathaniel Nifong <nifong@google.com>

TBR=djsollen@google.com,scroggo@google.com,kjlubick@google.com,nifong@google.com

Change-Id: I4fc2ea916743fda7e7d0d668b59e52052e880104
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275710
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-06 21:39:21 +00:00
Martin Vejdarski
6e58290ba6 set lib_switch to empty for the msvc toolchain
Change-Id: I0d94bf055413ab7911136256f2ce2cda3581f45a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275656
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-06 19:32:50 +00:00
Jim Van Verth
5b632d8b60 Add GrD3DResource.
Beginning steps for adding textures and buffers.

Bug: skia:9935
Change-Id: Ib7a361a88c99ede4f89a456794b955e3c2750afa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275457
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-03-06 19:01:08 +00:00
Leon Scroggins III
94aaf7cdf5 Split building encoding from decoding
Bug: skia:9756

In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.

Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.

Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.

Change IsPng signature to match other SkCodecs.

Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-03-06 18:50:40 +00:00
Martin Vejdarski
beaaf4700f fix print functions for python3 gn scripts
Change-Id: I478b10c23aae0c363b0d7342f25663ca8fc0d0fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274637
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-06 17:42:39 +00:00
Mike Klein
491df6ba72 remove SkTLS
- used for debug lock tracking in SkFont*
  - used for debug logging in SkPathOps
  - genuine use in GLTestContext_cmd_buf?
    switched that to thread_local
  - keep empty SkTLS_{pthread,win}.cpp until
    references to them can be cleaned up

Bug: skia:10006
Change-Id: I195a94c95d3f1a1918ee8c9bc4a15fa5b4344fbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-06 14:41:01 +00:00
Greg Daniel
456f9b5fe9 Reland "Move GrGpuResource GrSurface and GrTexture into src."
This reverts commit f6ed96d1c2.

Reason for revert: google3 change landed

Original change's description:
> Revert "Move GrGpuResource GrSurface and GrTexture into src."
> 
> This reverts commit e5a06ce678.
> 
> Reason for revert: Need to make change in google3 first
> 
> Original change's description:
> > Move GrGpuResource GrSurface and GrTexture into src.
> > 
> > Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> > before this can land.
> > 
> > Bug: skia:7966
> > Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7966
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I746ce739cb084cefc46f9dab24ef773e7c3cc621
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275436
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-05 19:16:21 +00:00
Greg Daniel
f6ed96d1c2 Revert "Move GrGpuResource GrSurface and GrTexture into src."
This reverts commit e5a06ce678.

Reason for revert: Need to make change in google3 first

Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
> 
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
> 
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-05 01:46:51 +00:00
Greg Daniel
e5a06ce678 Move GrGpuResource GrSurface and GrTexture into src.
Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
before this can land.

Bug: skia:7966
Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-04 23:01:31 +00:00
Mike Reed
a2cf8ae420 switch to virtual with no bones
Bug: skia:9984
Change-Id: I89d8f5f227690c71be875b5a7718aba0ad058650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274504
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-03-03 13:35:00 +00:00
Brian Salomon
71fe945da3 Prevent unbounded listener growth on SkPixelRefs.
Use SkIDChangeListener and update GrBitmapTextureMaker to add listener
to key to deregister if texture is purged before genID changes.

Add a common listener list implementation and replace existing lists.

Change-Id: Ib0c78241eaf59b59b892d8b004b2bb095140bc6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274549
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-03-02 22:32:09 +00:00
Brian Salomon
99a813ca29 Avoid unbounded listener growth on SkImage_Lazy when textures are purged
Generalizes the system used on SkPathRef where a GrTexture's key
destructor signals that a listener on the image can be removed via
the unique key custom data.

Removes texturesAreCacheable() from SkImageGenerator. This was used to
prevent unbounded growth in a narrow situation related to
GrBackendTextureImageGenerator.


Change-Id: I3c605da099acfac94751e793331e356a0979d359
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274038
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-02 18:38:09 +00:00
Greg Daniel
c52968170d Fix CompatibleCoverageAsAlpha flag when reducing src-over to src.
Change-Id: I087ff64e0f23aee15ac2bf7b9d3c450e28400cef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274036
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-28 18:45:15 +00:00
Robert Phillips
55f681faf3 Splitup GrSimpleMeshDrawOpHelper.h
Change-Id: Ie3d05053633176ba27e55cc2de61eeba1e9f45d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273981
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-28 15:04:02 +00:00
Jim Van Verth
62a644bf5a Add GrD3DUtil.
Trying to stage the texture format CLs in a little at a time.

Bug: skia:9935
Change-Id: I0fc6fe09fdb55d6c24b53af7edbcc8e8fc857ed7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273803
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-02-27 21:26:16 +00:00
Greg Daniel
31a7b072dd Add stubbed out GrD3DOpsRenderPass class.
Change-Id: Ie50b15323df0a71c8d4276e3bc603061e469824d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273465
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-02-26 21:04:16 +00:00
Brian Salomon
6422722cba Reland "Remove GrDeviceSpaceTextureDecalFragmentProcessor."
This is a reland of af5f9f008d

This was reverted due to Metal GMs failing. That is a bug in Metal where
pipeline creation fails with "internal error". Reporting to Apple, filing
Skia bug, and moving on.

Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
>
> It was used to sample clip masks using device coords.
>
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
>
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
>
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
>
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ia4530e6799019cd92863fe983a2d3c71df6f0620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273511
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-26 18:57:36 +00:00
Robert Phillips
251ee1da5b Remove SkDDLTmpRedirect.h
With the Chrome-side CL:

https://chromium-review.googlesource.com/c/chromium/src/+/2067805 (Switch SkDDLTmpRedirect.h reference to SkDeferredDisplayList.h)

having landed, Skia no longer needs this temporary header.

TBR=bsalomon@google.com
Change-Id: I01da4ece2be239407e223105781d4d0d75deabdb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273018
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-24 18:26:35 +00:00
Dominic Mazzoni
2a016bad67 Allow passing multiple node IDs per PDF structure node.
At the time Chromium is painting, we're passing node IDs
along with painting commands to enable tagging. However,
this assumes that all nodes will end up in the structure
tree, which we might not want.

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

As an example, suppose the doc looks like this:

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

The pruned tree passed to Skia would look like this:

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

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

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

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

Bug: chromium:607777
Change-Id: I0ecb62651e60b84cc5b9d053d7f7d3b9efda1470
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272462
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
2020-02-24 18:21:16 +00:00
Jim Van Verth
03b8ab225f Reland "Create D3D device and queue"
This is a reland of 29dc430f43

Original change's description:
> Create D3D device and queue
> 
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:9935
Change-Id: I1c8797e09cdeb3694ea7f47b2236ab7d91d9519f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-02-24 17:41:55 +00:00
Leandro Lovisolo
16656fc96c Revert "Create D3D device and queue"
This reverts commit 29dc430f43.

Reason for revert: This is breaking the Google3 autoroller due to header file d3d12.h not being available on google3.

Original change's description:
> Create D3D device and queue
> 
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I3857444cae52cc2338258c46b974ae5496bbaedc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272726
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
2020-02-21 22:49:12 +00:00
Robert Phillips
4d5594dff1 Move SkDeferredDisplayList.h into include\core (take 2)
Clients will need official access to this class for the compilation iterator.

This CL also hides some of the cruft we don't want exposed.

Bug: skia:9455
Change-Id: I696c058f1c409fb459229552fbbdd935ec112358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-21 21:26:02 +00:00
Jim Van Verth
29dc430f43 Create D3D device and queue
Bug: skia:9935
Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-21 19:49:52 +00:00
Robert Phillips
305033b6e8 Revert "Move SkDeferredDisplayList.h into include\core"
This reverts commit ad3b2c9886.

Reason for revert: clang

Original change's description:
> Move SkDeferredDisplayList.h into include\core
> 
> Clients will need official access to this class for the compilation iterator.
> 
> This CL also hides some of the cruft we don't want exposed.
> 
> Bug: skia:9455
> Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ica80434e7423fb202355eb77a614ece1c4d54726
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272641
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-21 18:38:31 +00:00
Robert Phillips
ad3b2c9886 Move SkDeferredDisplayList.h into include\core
Clients will need official access to this class for the compilation iterator.

This CL also hides some of the cruft we don't want exposed.

Bug: skia:9455
Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-21 18:23:11 +00:00
Brian Salomon
df283d01ca Revert "Remove GrDeviceSpaceTextureDecalFragmentProcessor."
This reverts commit af5f9f008d.

Reason for revert: bad GM results on Metal

Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
> 
> It was used to sample clip masks using device coords.
> 
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
> 
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
> 
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
> 
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ie02951dcc037d282dc3829cad216a0a0c9474038
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272518
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-20 22:38:48 +00:00
Brian Salomon
af5f9f008d Remove GrDeviceSpaceTextureDecalFragmentProcessor.
It was used to sample clip masks using device coords.

Replace with a more generic GrDeviceSpaceEffect that simply calls a
child FP with sk_FragCoord.

Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
at all if they are all applied in the FS (explicit coords). Moreover,
the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
var for local coords even when all FPs use explicit coords and wouldn't
use a local coords var.

Make CPP SkSL code gen for clone copy the explicit coord status of
children.

Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-02-20 22:09:58 +00:00
Robert Phillips
ca85b9b8e3 Add temporary header to shift clients over to include/core/SkDeferredDisplayList.h
The plan is:
Add SkDDLTmpRedirect.h
update clients to point to SkDDLTmpRedirect.h
Move SkDeferredDisplayList.h to include/core (and update SkDDLTmpRedirect.h)
update clients to point to SkDeferredDisplayList.h in its new location
remove SkDDLTmpRedirect.h

This staging is required to land:

https://skia-review.googlesource.com/c/skia/+/272343 (Move SkDeferredDisplayList.h into include\core)

Change-Id: I3302cdb8607b259d084bb9dd00600652c7f9a93a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-20 20:12:38 +00:00
Mike Reed
9d4e31d6cd rm Sk3D.h -- long live SkMat4
Change-Id: Ib83ee6567b1a32f34364b7ac66a659eaeced3249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272037
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-20 13:15:33 +00:00
Brian Osman
c0243914b2 Reland "Add SkSLCompiler::toHLSL, using SPIRV-Cross"
This reverts commit e3f57a4e62.

Change-Id: I03293dbee19ef5c9802fc35de8438a87f627cf96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272056
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-19 21:46:14 +00:00
Dominic Mazzoni
7dfb46e7f3 Re-land: Support adding attributes to PDF document structure nodes.
Originally landed: https://skia-review.googlesource.com/c/skia/+/268878
Reverted: https://skia-review.googlesource.com/c/skia/+/271858

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

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

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

Bug: chromium:1039816
Change-Id: I15f8b6c41d4fdaa4b6e21775ab6d26ec57eb0f5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271916
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-19 20:50:14 +00:00
Jim Van Verth
d2d4c5e8c5 Add GrD3DGpu and GrD3DCaps.
With this, can specify d3d config for dm and it will create a GrContext
with GrD3DGpu (stubbed in).

Bug: skia:9935
Change-Id: I0b8635bc541c61833b08b60a9f6e1341d1373090
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271743
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-02-19 20:44:14 +00:00
Brian Osman
e3f57a4e62 Revert "Add SkSLCompiler::toHLSL, using SPIRV-Cross"
This reverts commit cf7c7e38e8.

Reason for revert: Breaking our Flutter build.

Original change's description:
> Add SkSLCompiler::toHLSL, using SPIRV-Cross
> 
> Change-Id: Ia7a11a726cac006f6acc36efe8fc2ff27f30af72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270837
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=jvanverth@google.com,bsalomon@google.com,brianosman@google.com,ethannicholas@google.com

Change-Id: I2a1353864e2225578271573a8f7157d95fb0c969
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271744
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-19 19:53:30 +00:00
Brian Osman
cf7c7e38e8 Add SkSLCompiler::toHLSL, using SPIRV-Cross
Change-Id: Ia7a11a726cac006f6acc36efe8fc2ff27f30af72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270837
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-19 19:15:21 +00:00
Mike Klein
28abea51fa dip our toes into c++11 style [[attributes]]
AFAIK, we can replace a lot of preprocessor tests now that we have
[[attributes]] and compilers are supposed to ignore unknown attributes.
Let's see if it works. If this sticks I'll get the rest in a big CL.

-Wattributes and MSVC warning C5030 are kind of annoying as errors,
so turn them off.  This does not bode well for rolling into clients.

Change-Id: I88b150bab746c5510ff94f604096bf0ee0c9f96a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271886
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-02-19 17:51:40 +00:00
Brian Osman
d3b3bf3567 Reland "Move runtime shader/colorfilter into SkRuntimeEffect.cpp"
This reverts commit 7281a86237.

Change-Id: I1759358ede39e2466362cc4d3f0b9530eff08c9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271656
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-02-19 15:29:09 +00:00
Mike Reed
86b4388fdc Revert "Support adding attributes to PDF document structure nodes."
This reverts commit 80474156d1.

Reason for revert: breaking chrome roll

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

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

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

Change-Id: Iedd397303e870144e8d282db0cb81c535a783e8b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1039816
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271858
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-19 14:23:31 +00:00
Mike Klein
cfdfb229fc remove -Wno-bad-function-cast
Doesn't seem to trigger.

Change-Id: I481b90a4e7fa0a4badc9acff9df1ec232a62417d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271680
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-02-18 23:59:15 +00:00
Mike Klein
a9609ea8c5 turn on -Wreturn-std-move-in-c++11
This CL has a complicated back story, but it's concrete change is
simple, just turning the warning on and converting a bunch of

    return foo;

to

    return std::move(foo);

These changes are exclusively in places where RVO and NRVO do not apply,
so it should not conflict with warnings like -Wpessimizing-move.

Since C++11, when you return a named local and its type doesn't match
the declared return type exactly, there's an implicit std::move()
wrapped around the value (what I'm making explicit here) so the move
constructor gets an opportunity to take precedence over the copy
constructor.  You can read about this implicit move here under the
section "automatic move from local variables and parameters":
https://en.cppreference.com/w/cpp/language/return#Notes.

This situation comes up for us with smart pointers: a function declares
its return type as std::unique_ptr<Base> or sk_sp<Base>, and we return a
std::unique_ptr<Impl> or sk_sp<Impl>.  Those types don't match exactly,
so RVO and NRVO don't come into play.  They've always been going through
move constructors, and that's not changed here, just made explicit.

There was apparently once a bug in the C++11 standard and compilers
implementing that which made these copy instead of move, and then this
sort of code would do a little unnecessary ref/unref dance for sk_sp,
and would entirely fail to compile for uncopyable std::unique_ptr.
These explicit moves ostensibly will make our code more compatible with
those older compilers.

That compatibility alone is, I think, a terrible reason to land this CL.
Like, actively bad.  But... to balance that out, I think the explicit
std::move()s here actually help remind us that RVO/NRVO are not in play,
and remind us we're going to call the move constructor.  So that C++11
standard bug becomes kind of useful for us, in that Clang added this
warning to catch it, and its fix improves readability.

So really read this all as, "warn about implicit std::move() on return".
In the end I think it's just about readability.  I don't really hold any
hope out that we'll become compatible with those older compilers.

Bug: skia:9909
Change-Id: Id596e9261188b6f10e759906af6c95fe303f6ffe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-02-18 23:55:35 +00:00
Jim Van Verth
b01e12b716 Start adding D3D backend
Bug: skia:
Change-Id: Id24ed653adb80fe9b2ad597a34e459eb91ca53ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-18 20:14:15 +00:00
Brian Osman
7281a86237 Revert "Move runtime shader/colorfilter into SkRuntimeEffect.cpp"
This reverts commit 8980acd623.

Reason for revert: Win-Shared

Original change's description:
> Move runtime shader/colorfilter into SkRuntimeEffect.cpp
> 
> Better organization that lets us share a bunch of code between these
> (very similar) objects.
> 
> Change-Id: Ie559d6e144d8588b98a95d4170e2e6c19d9623bd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270736
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: Ic13d85b7c4f2d593a6c15dde067f118ea5753eb6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-18 19:31:14 +00:00
Brian Osman
8980acd623 Move runtime shader/colorfilter into SkRuntimeEffect.cpp
Better organization that lets us share a bunch of code between these
(very similar) objects.

Change-Id: Ie559d6e144d8588b98a95d4170e2e6c19d9623bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-18 19:15:05 +00:00
Dominic Mazzoni
80474156d1 Support adding attributes to PDF document structure nodes.
This is an important part of writing a tagged PDF. Many of the nodes
in the document structure tree need additional attributes, just like
in HTML.

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

Bug: chromium:1039816

Change-Id: I64a6b36b0b4ec42fd27ae4ad702afce95c95af5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268878
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-02-18 18:14:36 +00:00
Leon Scroggins III
a09d2328e8 Enable Windows host build for Skia
The issue with compiler warnings was fixed in
https://skia-review.googlesource.com/c/skia/+/270096.

Bug: b/149286037
Test: lunch sdk && m libskia

Uploaded previously as ag/10306975, but that will get overwritten by our
automatic merger. Update the source so the change will stick.

Change-Id: I5dced8a51cec6a16aa9f93f36b90d3194d00ced4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271059
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Jerome Gaillard <jgaillard@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-02-18 15:15:15 +00:00
Mike Reed
4d1700125c move SkDeque.h into private
Perhaps just make this SkTStack...

Change-Id: Iefdbb1e33acec96aec5f885e3e16ac2d97fd5f73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271320
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-18 02:05:08 +00:00
Herb Derby
81e84a6e7f Make SkStrikeCache::Node be SkStrike.
SkStrike becomes SkScalerCache. It will eventually externalize
the memory accounting to SkStrikeCache::Node because the amount of
memory used by the scaler cache, and the overall strike cache memory
usage must be kept in sync.

Change-Id: Ia889f057d8138ec7f22f996e7ebb9d2441dea4ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271018
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-02-15 16:37:58 +00:00
Herb Derby
251eff6f1f Multithread SkStrike test
Change-Id: Id034c7fb35e1c0d6ae70a19d612b955d25c570af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269900
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-02-12 21:36:57 +00:00
Mike Klein
508fd32091 make SkBBH a public interface
I don't necessarily like this long term, but in the short term Flutter
would like to record pictures using their own type separate from
SkRTree.  This makes SkBBoxHierarchy public, and converts it to use
other public types (SkTDArray -> vector).

Change-Id: I29c5ef9da7d641d8f4ba18522b168ddf7cefe84f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270387
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-12 16:31:05 +00:00
Chris Dalton
4e9985327b Add a simple atlas to the GPU tessellation path renderer
If a path is small and simple enough, we now try to atlas it. There
is only one atlas and it caps at 2048x2048. Once it runs out of room,
everything just draws direct. The atlas is rendered using the existing
GrTessellatePathOp. It provides alpha8 coverage even for msaa render
targets.

Change-Id: I715da9ce7347b6f1ef8e28b3e13ab47f6eade1c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268724
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-10 19:38:54 +00:00
Chris Dalton
a550cf2e40 Extract a GrDynamicAtlas base class from GrCCAtlas
Change-Id: I85fd3a3ccc34b5616a75e2c7ddcc33af18809144
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268723
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-07 21:05:04 +00:00
Mike Klein
81d35a72ae rm SkPreConfig.h and SkPostConfig.h
We treat them as part of SkTypes.h, so let's just merge them in?

Change-Id: Icd6db3913a679ceb9de09027d17eb9361754b016
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268769
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-06 19:16:43 +00:00
Tyler Denniston
45f94f8344 Reland: Initial checkin of GM verifier framework
The goal of the verifier framework is to enable opt-in checks of the
images produced by individual GMs. The basis of verification will be
comparing the rendered output of a GM against a source-of-truth image,
such as one generated by the CPU backend.

In the short term this can enable coarse-grained sanity checks for a
subset of GMs to catch e.g. egregious rendering bugs. In the longer term
this can provide an SkQP-style suite of tests that can be run across
many/all GMs to provide a vote of confidence in the rendering
correctness of new devices.

Bug: skia:9855
Change-Id: I50f15ecd029b28b69c0f68dc4126df3a4dd61d75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-02-06 15:01:31 +00:00
Tyler Denniston
14d64afaa8 Revert "Initial checkin of GM verifier framework"
This reverts commit 7e36f0015e.

Reason for revert: breaking google3 roll

Original change's description:
> Initial checkin of GM verifier framework
> 
> The goal of the verifier framework is to enable opt-in checks of the
> images produced by individual GMs. The basis of verification will be
> comparing the rendered output of a GM against a source-of-truth image,
> such as one generated by the CPU backend.
> 
> In the short term this can enable coarse-grained sanity checks for a
> subset of GMs to catch e.g. egregious rendering bugs. In the longer term
> this can provide an SkQP-style suite of tests that can be run across
> many/all GMs to provide a vote of confidence in the rendering
> correctness of new devices.
> 
> Bug: skia:9855
> Change-Id: Id7310de8005ffa7e8eb2fd0e4008f5f8db1419ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267761
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
> Auto-Submit: Tyler Denniston <tdenniston@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

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

Change-Id: Ie3beff447fea406b5ad3c3ca5a98fa2bd73d20fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9855
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268682
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-02-04 20:54:39 +00:00
Tyler Denniston
7e36f0015e Initial checkin of GM verifier framework
The goal of the verifier framework is to enable opt-in checks of the
images produced by individual GMs. The basis of verification will be
comparing the rendered output of a GM against a source-of-truth image,
such as one generated by the CPU backend.

In the short term this can enable coarse-grained sanity checks for a
subset of GMs to catch e.g. egregious rendering bugs. In the longer term
this can provide an SkQP-style suite of tests that can be run across
many/all GMs to provide a vote of confidence in the rendering
correctness of new devices.

Bug: skia:9855
Change-Id: Id7310de8005ffa7e8eb2fd0e4008f5f8db1419ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267761
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-02-04 20:11:24 +00:00
Robert Phillips
d095b9f5d7 Fix SW decompression of BC1 and add a GM to check it (take 2).
Bug: skia:9680
Change-Id: I59a4c18f7ba7d04162715cfcbeefd70f84609edb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268439
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-04 13:41:10 +00:00
Robert Phillips
ab5da1f6b6 Revert "Fix SW decompression of BC1 and add a GM to check it."
This reverts commit 4238751bc3.

Reason for revert: This appears to be turning the PreAbandonGpuContext bot red

Original change's description:
> Fix SW decompression of BC1 and add a GM to check it.
> 
> Bug: skia:9680
> Change-Id: I8a8f9ee1aad783fc247c5516ac1effd0dab25936
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268158
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: I4304f13453579eb3ee6d3c0febe8c94ebfe915b2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9680
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268438
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-03 21:03:41 +00:00
Robert Phillips
4238751bc3 Fix SW decompression of BC1 and add a GM to check it.
Bug: skia:9680
Change-Id: I8a8f9ee1aad783fc247c5516ac1effd0dab25936
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268158
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-02-03 20:42:31 +00:00
Robert Phillips
d4f68317fe Add SW decode of ETC1 and a GM
The GM exercises the compressed image formats using externally created resources

Note: the original image for the new flower resources can be found on Wikimedia Commons and has a "CC0 1.0 Universal Public Domain Dedication" license.

Bug: skia:9680
Change-Id: I6c5f9a12fcbbecdc3ba548dbb078bc21522073fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267836
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-03 13:56:15 +00:00
Brian Salomon
f033404de8 Improvements to texture_domain GMs
Rename to texel_subset.

Test different x/y wrap modes.

Use a real image that is non-square.

Add dividers to group MakeTexelSubset() with Make() reference draw.

Use a smaller image, fewer matrices, and only one subset rect to
make room for the additional mode combinations.

Change-Id: I3fab54cb7f160b92c7e5192e64a8a09f5c837492
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-01 22:27:31 +00:00
Mike Klein
c0c0522e80 let's try to fix nullptr + k
Apply -fsanitize-recover=pointer-overflow to third_party code only.

I'm trying to keep Skia behaving the same, avoiding illegal nullptr+k:
    - Add null check in SkJSON fast string path.
    - Add null check (first alloc) and some comments to SkArenaAlloc.
    - March an int index instead dst pointer in SkBase64.

Bug: skia:9731
Change-Id: I646635558ea63ded846b746f2a1f0b4f1e1eacff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268109
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-01-31 19:24:21 +00:00
Chris Dalton
4328e928ef Add a stencil/tessellation hybrid mode for path rendering
This is a hybrid approach where we stencil only the curves using GPU
tessellation shaders, and then tessellate the path's inner polygon on
CPU and draw it directly to the final render target, stencilled
against the curves. Tessellating just the inner polygon is more than
fast enough to do in real time, and still allows us fill in the
majority of pixels in a single render pass. It gives us most the
benefit of CPU tessellation, but at a fraction of the cost.
Furthermore, the tessellated inner polygon can potentially be cached
and reused independent of the view matrix.

Change-Id: Id45adc643b51ab80a0c655dd2045a5314bdc7507
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266456
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-01-30 01:44:15 +00:00
Mike Klein
9404603ccb remove more vtune references
Obsolete since I added the dylib SkVM JIT mode.

Change-Id: I124f83cd365fd542ca92fab7f187b003ad2e1c90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267279
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-01-29 04:19:03 +00:00
Mike Klein
d352529216 incorporate r,g,b,a into shaderHash
Today's shader hash changes if the unordered set of {r,g,b,a} values we
produce changes, but is not sensitive to simple order changes like
sampling RGBA vs BGRA.

Folding in a hash of each value's ID in order will fix this.

This has been difficult to track down (thread-local caches),
so I've added a GM that reliably reproduces the bug.

Live demo: https://fiddle.skia.org/c/30f2e5b731c2e53a6f092424c585ca41

Bug: skia:9819
Change-Id: Iceb09d89eb036735028ae97dc79c576787199ac5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267119
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-01-28 20:58:37 +00:00
Robert Phillips
99dead9830 Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types (take 2)
This is intended to make using compressed textures easier since developers can just provided compressed data and it will be uploaded to the GPU in some way, shape or form.


TBR=reed@google.com
Change-Id: I8c672ccc7db5cd098f629c3469ae7cbdc7436392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266939
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-28 14:03:14 +00:00
Robert Phillips
3da9e94289 Revert "Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types"
This reverts commit 3234ce1347.

Reason for revert: missing etc1.h

Original change's description:
> Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types
> 
> This is intended to make using compressed textures easier since developers can just provided compressed data and it will be uploaded to the GPU in some way, shape or form.
> 
> Change-Id: Ieed008f083d6e3594eaa9a02bc5348e00ee60d2a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265601
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reed@google.com

Change-Id: Ia497e6767c43ab6f8bfeb28e70244107a1442cf2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266937
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-27 21:05:46 +00:00
Robert Phillips
3234ce1347 Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types
This is intended to make using compressed textures easier since developers can just provided compressed data and it will be uploaded to the GPU in some way, shape or form.

Change-Id: Ieed008f083d6e3594eaa9a02bc5348e00ee60d2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265601
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-27 20:15:36 +00:00
Ethan Nicholas
b962eff76c Revert "Revert "Complete rewrite of the SkSL interpreter""
This reverts commit 99c54f0290.

Change-Id: I010ac4fdb6c5b6bfbdf63f4dcac5dbf962b0ad9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266205
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-01-24 14:42:37 +00:00
Chris Dalton
d081dce968 Move GrTessellator::VertexAllocator to GrEagerVertexAllocator
Moves the interface up to Ganesh level and starts using it from other
locations.

Change-Id: I939d2b357d3ae8551976d0d71b877b72da403712
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266063
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-23 20:14:07 +00:00
Hal Canary
60ff65114c Fix build when (is_ios && !skia_enable_skottie)
Bug: skia:9726
Change-Id: I2ad05e28f8699fc7c5159145cc59065fc8bd5b93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265520
Reviewed-by: Hal Canary <halcanary@skia.org>
Commit-Queue: Hal Canary <halcanary@skia.org>
Auto-Submit: Hal Canary <halcanary@google.com>
2020-01-23 16:11:36 +00:00
Herb Derby
73c75877bd Reland "Specialize SkRectanzier to SkRectanizerSkyline"
This is a reland of 77e1f84a84

Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
> 
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
> 
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

Change-Id: I09729ba2b0e4b8b1a229fef4b95e65195b33fdc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266180
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-01-23 15:28:26 +00:00
Mike Reed
05b729709c remove obsolete flag SK_SUPPORT_LEGACY_CANVAS_MATRIX_VIRTUALS
Change-Id: I7f8dabe249a29ffa59e3e6224292895831be13d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266196
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-23 15:12:46 +00:00
Michael Ludwig
87211cd0ba Add GM for crbug:10141204
Bug: skia:9779, chromium:10141204
Change-Id: If075e04373a141343ce368c1b28a494047a396f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265876
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-01-23 15:06:16 +00:00
Mike Reed
e4ddb8a7cd Revert "Specialize SkRectanzier to SkRectanizerSkyline"
This reverts commit 77e1f84a84.

Reason for revert: breaking google3 roll?

Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
> 
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
> 
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I2573534f3ea95c98d089f9c19b027564e77015db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266116
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-23 10:13:46 +00:00
Herb Derby
77e1f84a84 Specialize SkRectanzier to SkRectanizerSkyline
It looks like the pow2 rectanizer has never been used. Remove
the unneeded abstraction for rectanizer everywhere.

Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-01-23 02:28:32 +00:00
Michael Ludwig
08f1a25aad Add GM reproducing perspective failures
Modeled on https://codepen.io/adamdupuis/pen/qLYzqB, this GM creates a
cube of rectangles with the camera at the center. It animates the FOV
since the original chrome issue was most visible when resizing the page
(which then updated the fov of the perspective css transform).

This draws correctly with the raster backend. There are two issues it
causes with Ganesh:

1. The input coordinates of some of the cube faces have 0 or negative ws.
  - When negative, the current bounds code does not perform clipping and
    just uses the mirrored point, which leads to misleading bounds.
  - When 0, the current bounds code produces infinities, and then GrOpsTask
    discards the op with non-finite bounds.
2. The anti-aliasing code also ignores w <= 0, and so all of its screen
   space math is incorrect.

This causes a mix of completely discarded draws and distorted draws on the
GPU backend.

Bug: skia:9779, chromium:224618
Change-Id: Ib00b909f51cbf7aaba5b89ed830ddc720ad3c73d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265763
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-22 22:03:59 +00:00
Ben Wagner
470e0ac14a Revert "Revert "Revert "Complete rewrite of the SkSL interpreter"""
This reverts commit 7deb1c26ba.

Revert "maybe fixed?"

This reverts commit 7ad3f229c7.

Revert "removed extraneous change"

This reverts commit 682f299aa8.

Revert "test change"

This reverts commit 5f40986cef.

Revert "derp"

This reverts commit 4f830b8df3.

Revert "let's see what happens"

This reverts commit d5290563f0.

Change-Id: Ib3c13c2a6ade9fc42382509d036e212c7fe50cc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265979
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2020-01-22 21:59:48 +00:00
Ethan Nicholas
7deb1c26ba Revert "Revert "Complete rewrite of the SkSL interpreter""
This reverts commit 99c54f0290.
2020-01-22 16:44:31 -05:00
Michael Ludwig
b6c27f1284 Add GrQuad::bounds() benchmark
Change-Id: I3748fcae9b608b7a29d6354fb26c37193870e377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265761
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-22 18:23:55 +00:00
Chris Dalton
f9aea7f7e5 Add a tessellation mode that triangulates the inner polygon separately
Wedges fanning out from the center work fine for relatively simple
paths, but for paths made up of thousands of verbs, a fan is an
inefficient triangulation to give the rasterizer. This CL adds a
tessellation mode that draws the inner polygon and standalone cubics
separately, and triangulates the inner polygon by recursive
subdivision.

This reduces the stencil time from 7.4ms -> 3.0ms on desk_ynevsvg.skp.

Change-Id: Ie56e760d98e6c69e9a97752fe851726f36a7f574
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265522
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-22 17:01:06 +00:00
Brian Osman
6f5e94089e Clamp GrSkSLFP output to valid premul
Added this as an option to GrSaturateProcessor (also renamed it to
be more generic and end with FragmentProcessor).

Added a tweak to the unit test to check the new behavior.
(Raster was already doing the clamp).

Change-Id: Ic49fa5cd72b6c63430fb773baf8121546bf2b80d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265580
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-01-22 16:10:04 +00:00
Ethan Nicholas
99c54f0290 Revert "Complete rewrite of the SkSL interpreter"
This reverts commit 2cde3a1320.

Reason for revert: breaking the Chrome roll

Original change's description:
> Complete rewrite of the SkSL interpreter
> 
> Change-Id: Idf4037b04c22f8ace5c1ef16c7a28d8c3df92e91
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250817
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com

Change-Id: If0fbc78118173e0cacbe1e01cabe3331e35aa49e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265516
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-01-21 16:07:08 +00:00
Ethan Nicholas
2cde3a1320 Complete rewrite of the SkSL interpreter
Change-Id: Idf4037b04c22f8ace5c1ef16c7a28d8c3df92e91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250817
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-21 14:49:59 +00:00
Chris Dalton
40a1cee16f Rewrite tessellation wedge generation to be done in a single pass
Change-Id: I66a9e1dff1b3d877012b38804cfb9d13f2b65f2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264579
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-16 18:45:35 +00:00
Robert Phillips
ac9080283e Update compressed texturing GM
This CL has some extra headroom for upcoming kBC1_RGBA8_UNORM support.

Bug: skia:9680
Change-Id: I866c7fe12657a41575c57dcd001a6a09477fc44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264096
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-01-14 23:23:48 +00:00
Eric Boren
edae1b3e04 [infra] Change CMake build to use a temporary directory
This prevents Docker from creating a root-owned out directory
which persists on bots and causes failures for other tasks.

Bug: skia:9749
Change-Id: I79382d3d7a4b6d8ac61a429750ff99bde20d306d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264018
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2020-01-14 11:41:55 +00:00
Mike Reed
9403c3897f Revert "Reland "Revert "allow clients to opt into new didTranslate/didScale"""
This reverts commit f66bba6018.

Reason for revert: sheriff thinks it may be the bot, so landing

Original change's description:
> Reland "Revert "allow clients to opt into new didTranslate/didScale""
> 
> This reverts commit d7ce7ac8d1.
> 
> Reason for revert: breaks Test-Debian10-GCC-GCE-CPU-AVX2-x86-Debug-All-Docker
> 
> Original change's description:
> > Revert "Revert "allow clients to opt into new didTranslate/didScale""
> > 
> > This reverts commit 4a46758db8.
> > 
> > Add guard to Flutter
> > 
> > Change-Id: Ief0e5cb36af13c8f00a36a617d0384622012d644
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263937
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=reed@google.com
> 
> Change-Id: I3291c4dfe18d6e751e61f55ed9b22a01f0c8ad72
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263860
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3111a034291c2320e5ff33f8c2072354f836440f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263939
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-13 14:41:12 +00:00
Mike Reed
f66bba6018 Reland "Revert "allow clients to opt into new didTranslate/didScale""
This reverts commit d7ce7ac8d1.

Reason for revert: breaks Test-Debian10-GCC-GCE-CPU-AVX2-x86-Debug-All-Docker

Original change's description:
> Revert "Revert "allow clients to opt into new didTranslate/didScale""
> 
> This reverts commit 4a46758db8.
> 
> Add guard to Flutter
> 
> Change-Id: Ief0e5cb36af13c8f00a36a617d0384622012d644
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263937
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3291c4dfe18d6e751e61f55ed9b22a01f0c8ad72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263860
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-12 20:06:08 +00:00
Mike Reed
d7ce7ac8d1 Revert "Revert "allow clients to opt into new didTranslate/didScale""
This reverts commit 4a46758db8.

Add guard to Flutter

Change-Id: Ief0e5cb36af13c8f00a36a617d0384622012d644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263937
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-12 19:53:18 +00:00
Mike Reed
69ace2a0ad sample3d
Change-Id: Idae6792f0ed1150c1cd167690403c7b97795e5ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263817
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-11 21:23:27 +00:00
Mike Reed
a3a704afa3 Override didTranslate, and add virtual for didScale
This completes pushing through the new virtual didConcat44() to our
subclasses, and introduces didScale() for future optimizations. We
don't call didScale yet, until external subclasses are also updated.

This was derived from https://skia-review.googlesource.com/c/skia/+/263349

bug: skia: 9768
Change-Id: Ia26b48e76e323037082e8f2ee83673c26b99ebed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263702
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-11 02:11:26 +00:00
Mike Reed
a092028439 Revert "new virtuals for canvas ctm"
This reverts commit 2076b04d15.

Reason for revert: speculative: breaking google3 flutter scuba?

Original change's description:
> new virtuals for canvas ctm
> 
> 1. Feature: Clients need to override didConcat44() (new data)
> 2. Perf: Clients need to override didTranslate (and now didScale) so our
>          default impls can be empty.
> 
> Need SK_SUPPORT_LEGACY_CANVAS_MATRIX_VIRTUALS flag to stage this in
> clients (anyone who subclasses SkCanvas)
> 
> Before (with flag)
>     120.87  	canvas_matrix_4x4	8888
>     108.10 ?	canvas_matrix_3x3	8888
>     108.13 ?	canvas_matrix_2x3	8888
>     141.54  	canvas_matrix_scale	8888
>     128.04  	canvas_matrix_trans	8888
> 
> After (without the flag)
>     ...
>      90.79  	canvas_matrix_scale	8888
>      94.51  	canvas_matrix_trans	8888
> 
> bug: skia:9768
> 
> Change-Id: I6f500138dd6b2b24754dc065c650d0bd3c341540
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263349
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: I9c2e39ea0aa2b19d40eb6454c233258ab7f35829
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263564
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 14:26:41 +00:00
Mike Reed
2076b04d15 new virtuals for canvas ctm
1. Feature: Clients need to override didConcat44() (new data)
2. Perf: Clients need to override didTranslate (and now didScale) so our
         default impls can be empty.

Need SK_SUPPORT_LEGACY_CANVAS_MATRIX_VIRTUALS flag to stage this in
clients (anyone who subclasses SkCanvas)

Before (with flag)
    120.87  	canvas_matrix_4x4	8888
    108.10 ?	canvas_matrix_3x3	8888
    108.13 ?	canvas_matrix_2x3	8888
    141.54  	canvas_matrix_scale	8888
    128.04  	canvas_matrix_trans	8888

After (without the flag)
    ...
     90.79  	canvas_matrix_scale	8888
     94.51  	canvas_matrix_trans	8888

bug: skia:9768

Change-Id: I6f500138dd6b2b24754dc065c650d0bd3c341540
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263349
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-01-10 13:30:11 +00:00
Mike Reed
6f48542252 remove cruft bools from canvas
Change-Id: Ic035e2ba24a9c1f8b5b9af56471c130c9efc158c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263562
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-09 22:24:54 +00:00
Robert Phillips
d5caeb8d66 Improve handling of anisotropic scaling for stroked rects
This doesn't resolve all the problems here but does substantially improve the situation. In particular, if the device-space stroke is greater than 1 in one axis and less than 1 in the other, the smaller side will still appear darker than expected.

Bug: 935303
Change-Id: I3ff9bc73cad5ad5b8e13ef5aa7b46bbf4835753b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263024
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-09 14:41:44 +00:00
Mike Klein
7cfcc1e86a add Brian's fiddle as gm/bicubic
Change-Id: I748ab57274c360261e957d43a08366e62350110b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263056
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-08 16:40:53 +00:00
Mike Reed
403c807971 Revert "Revert "Extend SkCanvas matrix stack to be 4x4, but with (basically) the same public API.""
The reason for the assert was breaking an assert, that if the CTM was scale/translate, that after
a preTranslate, it should still be that.

This is true... unless the new translate values are non-finite. In that case, we might turn a zero
into a NaN, (0 * non_finite --> nan), so we either have to require finite args (which we don't
at the moment) or we can't make this assert. This re-land removes that assert.

This reverts commit 268ed57d71.

Change-Id: I3c48a0aa17649351a246c1fbab5449f2d59aaf84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263023
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-08 16:13:51 +00:00
Brian Osman
268ed57d71 Revert "Extend SkCanvas matrix stack to be 4x4, but with (basically) the same public API."
This reverts commit 98bfcc7ff3.

Reason for revert: Flutter hitting assert:
../../third_party/skia/src/core/SkCanvas.cpp:1432: fatal error: "assert(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate())"

Original change's description:
> Extend SkCanvas matrix stack to be 4x4, but with (basically) the same public API.
> 
> Devices receive the 4x4, but by default they simply downsample it to SkMatrix.
> 
> New SkM44 matrix for the impl. It differs from SkMatrix44 in a few ways
> - no tracking of "type"
> - faster for concat, as it does not use doubles for intermediates
> - much simpler API
> 
> There are some low-bit differences in some gms, so adding a flag for clients to
> stage this change. (due to faster but lower-precision in SkM44::concat)
> 
> Performance: running canvas_matrix bench
> 
> 3x3 version:
> 
>     167.93  	canvas_matrix_3x3	8888
>     209.97  	canvas_matrix_2x3	8888
>     174.87  	canvas_matrix_scale	8888
>     135.30  	canvas_matrix_trans	8888
> 
> 4x4 version:
> 
>     116.59  	canvas_matrix_3x3	8888
>     105.40  	canvas_matrix_2x3	8888
>     159.83 ?	canvas_matrix_scale	8888
>     113.47  	canvas_matrix_trans	8888
> 
> Why faster?
> - not tracking matrix_type helps a lot it seems
> - faster full concat (no doubles)
> 
> Before adding the specialized preConcats...
> 
>     318.11 ?	canvas_matrix_3x3	8888
>     339.38  	canvas_matrix_2x3	8888
>     383.28  	canvas_matrix_scale	8888
>     251.67  	canvas_matrix_trans	8888
> 
> Change-Id: I68eac942919fa5418081e789f31710a1e2a752da
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262056
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@google.com,bsalomon@google.com,herb@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,michaelludwig@google.com

Change-Id: I28c3d69c19ba44ab65ca7c059221b64c7dffef22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263021
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-01-08 14:28:11 +00:00
Chris Dalton
b832ce61ee Add a path renderer that uses GPU tessellation
Implements a simple first pass for a path renderer that uses the
classic Red Book "stencil then cover" method, and linearizes curves
with GPU tessellation shaders.

The new path renderer is disabled by default, and can only be enabled
in the viewer UI or by passing the "--pr gtess" flag.

Change-Id: Ic9354952e93c8b108577961760b4f0daa82d35aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261715
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-07 20:00:22 +00:00
Brian Salomon
b8f098d372 Reland "Rename GrSimpleTextureEffect->GrTextureEffect"
This reverts commit d7436a37ff.

Restores old file order in gpu.gni until Mac/Metal issue can be
debugged.

Change-Id: I6e2ee3bdc3b39270aeaaf28b9613e4ac49d38e1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-07 18:44:42 +00:00
Mike Reed
98bfcc7ff3 Extend SkCanvas matrix stack to be 4x4, but with (basically) the same public API.
Devices receive the 4x4, but by default they simply downsample it to SkMatrix.

New SkM44 matrix for the impl. It differs from SkMatrix44 in a few ways
- no tracking of "type"
- faster for concat, as it does not use doubles for intermediates
- much simpler API

There are some low-bit differences in some gms, so adding a flag for clients to
stage this change. (due to faster but lower-precision in SkM44::concat)

Performance: running canvas_matrix bench

3x3 version:

    167.93  	canvas_matrix_3x3	8888
    209.97  	canvas_matrix_2x3	8888
    174.87  	canvas_matrix_scale	8888
    135.30  	canvas_matrix_trans	8888

4x4 version:

    116.59  	canvas_matrix_3x3	8888
    105.40  	canvas_matrix_2x3	8888
    159.83 ?	canvas_matrix_scale	8888
    113.47  	canvas_matrix_trans	8888

Why faster?
- not tracking matrix_type helps a lot it seems
- faster full concat (no doubles)

Before adding the specialized preConcats...

    318.11 ?	canvas_matrix_3x3	8888
    339.38  	canvas_matrix_2x3	8888
    383.28  	canvas_matrix_scale	8888
    251.67  	canvas_matrix_trans	8888

Change-Id: I68eac942919fa5418081e789f31710a1e2a752da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262056
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-07 18:23:04 +00:00
Mike Klein
8e71744169 add SkVM_fwd.h
Tweaking SkVM.h requires ~550 build steps because SkShaderBase.h
includes it.  By switching that to forward declarations of the types
using SkVM_fwd.h, it's down to ~15.  Big deal for laptop productivity.

Change-Id: Ide5cc776b8a0c6fa6473cf5f43acabdf566e8808
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262860
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-01-07 17:06:51 +00:00
Brian Salomon
d7436a37ff Revert "Rename GrSimpleTextureEffect->GrTextureEffect"
This reverts commit 90673ec665.

Reason for revert: Causes metal bot failures

Original change's description:
> Rename GrSimpleTextureEffect->GrTextureEffect
>
> It will become less simple.
>
> Change-Id: I409d0faba386597ae05738273d5ff773501eb358
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Id25c9cde3c2048149409745f163e42c588de70c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262514
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-07 15:07:09 +00:00
Mike Klein
91e0d75269 rm gm/skvm.cpp
It's not that useful now that we're drawing real stuff,
and kind of annoying to keep updating its Fade shader.

Change-Id: Ie8252b9a189bd38b150647e4a93b66b765c7ef97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262536
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-01-07 13:34:49 +00:00
Brian Salomon
90673ec665 Rename GrSimpleTextureEffect->GrTextureEffect
It will become less simple.

Change-Id: I409d0faba386597ae05738273d5ff773501eb358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-06 21:49:44 +00:00
Brian Osman
ee426f223f Move SkRuntimeEffect.h to include/effects
Change-Id: I0b11d4210c6e663cfb4854fc33e1396fd79fe9a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-01-02 17:37:46 +00:00
Brian Salomon
94724c6594 Fix GrColorMatrixFragmentProcessor handling of premul transparent black.
Use the original alpha in the unpremul color.

Bug: chromium:1024935
Change-Id: I6a721431781f0ef42a3f162d39f8bbac924a2c30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261680
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-02 14:55:06 +00:00
Ben Wagner
b6f98ea2c6 Enable ASAN on Windows
Docs-Preview: https://skia.org/?cl=261336
Change-Id: Ied00d717a37d92179c01158b2fbdfa47a52270c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261336
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-12-30 17:06:26 +00:00
Chris Dalton
5a2f962313 Add back door support for GLSL tessellation shaders
Implements tessellation support at the Ganesh level, and adds back
door methods for supplying raw GLSL strings directly to the OpenGL
driver. Adds a new gm to verify tessellation is works in GL.

Change-Id: Idfc285b955cbe5e8e6bf0475be8b518b0cc6ed2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261196
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-12-27 22:34:10 +00:00
Mike Reed
c15afe488b move SkClipStack::asPath into PDFUtils
bug: skia:9734
Change-Id: I115c990c1532ab6852fe23956591878a04b3edc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261282
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-12-20 19:27:26 +00:00
Brian Salomon
3a09a3770b Ungenerate GrSimpleTextureEffect
There is no change to the code (yet).

Change-Id: I1997d7ac070691a3384441028503f6dc8565bbf8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261182
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-12-20 14:18:56 +00:00
Brian Osman
088913a63b Start adding unit tests of SkRuntimeEffect
- Change SkRuntimeEffect::Make so *it* can fail, and returns
  [Effect, ErrorText].
- Initial tests just test for expected failure conditions.
  Next steps are to add tests for effects that should work,
  and to validate results on CPU and GPU.

Change-Id: Ibac8c3046104577434034263e9e4a4b177e89129
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261095
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-20 14:15:06 +00:00
Robert Phillips
3e5e2f2c95 Add test for the GrContext::createCompressedBackendTexture API
Bug: skia:9680
Change-Id: Ib51613e6bacb36ff59b2e1e3c3cf13221d0382fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261083
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-12-19 16:48:09 +00:00
Mike Klein
cdb0e8f001 demote -fsanitize=pointer-overflow to warning
Clang 10 added a new check we and libjpeg-turbo fail.
We need to investigate these failures, but I don't
want that to stop us rolling clang_win.

Bug: skia:9731
Change-Id: Ifdbb16ea0e2bacd30547d4a82a839563a9496d9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260948
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-12-18 20:59:42 +00:00
Florin Malita
f11fd1f6e7 Python3 tweaks
Change-Id: Ie951106bbd7a91dd76b30a56ede9313c88e657ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260499
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-12-17 17:12:03 +00:00
Greg Daniel
46e366ae21 Remove GrTextureContext.
This change mostly just removes GrTextureContext and switches users to
directly creating GrSurfaceContexts. Outside of updating types, the factory
functions for creating Gr*Contexts have not been updated in this but will
be done in a followup.

Change-Id: I55257568d4c096c5fb48c5e38bfa2c01b824e7b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260289
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-12-16 20:45:10 +00:00
Shachar Langbeheim
07c4e1da31 remove use_PIC.
The Emscripten bug that required this change was fixed.

see:
https://skia-review.googlesource.com/c/skia/+/243317
https://github.com/emscripten-core/emscripten/issues/9317

Change-Id: Id3f6395a795bf61ce3f48d73a8749899ad55ef8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259516
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-12-16 16:56:10 +00:00
Greg Daniel
99448bf7ca Delete unused GrDebugMarkerOp.
Change-Id: Id3222effc21aea673b4d5d82a98e3e60f34512b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260278
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-12-16 16:43:34 +00:00
Brian Osman
7b1678a527 Major refactor of runtime effects
Adds SkRuntimeEffect, a ref-counted object to hold SkSL,
a Compiler, and compiled Program, along with uniform info.

Removes the old SkSLFP factory and factory cache types.
Caching is done by simply holding on to the effect (or
the shader/color filter factories, which own an effect).

The effect class is simply ref'd by the factories, the
shader and color filter types, and the FP.

NOTE: Changes to public headers only affect private functions.

Change-Id: I0c1401505cb234e83943ad4ef2db6680f4c69fb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259336
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-16 15:59:04 +00:00
Brian Salomon
a6069a154d Support clipRegion on GPU backend
Bug: skia:9580
Change-Id: I663549dafc4239248e265bee8d6927bf5b259303
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259804
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-13 17:34:33 +00:00
Mike Klein
f46d5ca492 use std::make_unique
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-12-12 22:32:45 +00:00
Nathaniel Nifong
20b177a9bf Parse android layer annotations in debugger, play back layers
Bug: skia:9626
Change-Id: I3ae8fa83520690f9af534e9ab0b70834d7890fb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256100
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-12-12 16:32:44 +00:00
Mike Klein
67e55a2380 lift Wno-class-memaccess
Bug: skia:9674
Change-Id: I0ed1c171b0182d168798444657c200bfeec77514
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258269
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-12-09 16:12:23 +00:00
Herb Derby
a90476496b WS: reorder GrTextBlob struct and move all methods to .cpp
Move all the GrTextBlob methods to GrTextBlob.cpp. Under the old API
methods were called once per a glyphs so the methods were colocated
with the painter code. The APIs have changed to bulk, so the colocation
is no longer needed. In addition, the SubRun struct is going to move
from the GrTextBlob to the .cpp, so all these methods need to be together
soon.

Change-Id: I41124be0d5bcca29780be1a7f5c105268dadbe87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258566
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-12-06 17:46:05 +00:00
Mike Klein
039368775c flip on a bunch of GCC warnings
I've landed fixes for most of these,
leaving -Wclass-memaccess as a TODO.

Bug: skia:9674
Change-Id: Ifb951bc66e022b48ff4b66e4555d3fe3c7ef5aaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257501
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-12-04 21:40:21 +00:00
Brian Salomon
8a99a41116 Fix for 420/422 chroma subsampling of odd dimension images when
converting from YUV to RGB on GPU.

Change-Id: I872e1e85f3efccce7bf93d2f3d5f2a841b8a5b0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257680
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-12-04 16:32:40 +00:00
Mike Reed
270f7e22c5 Reland "remove legacy SkPath enum guards"
This reverts commit fdf7e08210.

Reason for revert: briano fixed flutter call-site

Original change's description:
> Revert "remove legacy SkPath enum guards"
> 
> This reverts commit 7fdceb9216.
> 
> Reason for revert: need more fixes in flutter (getFillType)
> 
> Original change's description:
> > remove legacy SkPath enum guards
> > 
> > Change-Id: I5874ac89b6dec5c050bc02df9df6849d2131df76
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257690
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=reed@google.com
> 
> Change-Id: I7b65e51b53dc15739ddeb76d9b5fd18d956f4cfd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257879
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ff366d1e98cd9d581e0bf1041d1c859a88ffef6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257887
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-04 16:01:10 +00:00
Mike Reed
fdf7e08210 Revert "remove legacy SkPath enum guards"
This reverts commit 7fdceb9216.

Reason for revert: need more fixes in flutter (getFillType)

Original change's description:
> remove legacy SkPath enum guards
> 
> Change-Id: I5874ac89b6dec5c050bc02df9df6849d2131df76
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257690
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I7b65e51b53dc15739ddeb76d9b5fd18d956f4cfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257879
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-04 15:10:47 +00:00
Mike Reed
7fdceb9216 remove legacy SkPath enum guards
Change-Id: I5874ac89b6dec5c050bc02df9df6849d2131df76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257690
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-03 21:47:40 +00:00
John Rosasco
75d625f6eb Add deps file for manifest. Use libwebp always.
Change-Id: I90fb96e43f68bdae88439d03e2e873fcb2effe2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256850
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-27 14:45:13 +00:00
Mike Reed
7d34dc7747 Revert "Revert "switch to new filltype for SkPath""
This reverts commit 3e7af41224.

Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-26 17:43:14 +00:00
Mike Reed
3e7af41224 Revert "switch to new filltype for SkPath"
This reverts commit 3a50981a83.

Reason for revert: chrome win build found compile-problem in xpsdevice

Original change's description:
> switch to new filltype for SkPath
> 
> Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Iacb3566da61c2512b9bd6b7e42b592febc85e031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256530
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-26 03:34:30 +00:00
Mike Reed
3a50981a83 switch to new filltype for SkPath
Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-25 22:31:46 +00:00
Mike Reed
30bc527fd6 Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f3743.

Reason for revert: legacy convexity code removed -- google3 should be ok

Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-22 19:09:54 +00:00
Mike Reed
7cda6f3743 Reland "Revert "Use flat version of path-direction enum""
This reverts commit 1792b19485.

Reason for revert: need to update legacy_convexity, still used by google3

Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
> 
> This reverts commit 0dacc6b7d3.
> 
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 11:03:34 +00:00
Mike Reed
1792b19485 Revert "Revert "Use flat version of path-direction enum""
This reverts commit 0dacc6b7d3.

Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 00:51:22 +00:00
Hal Canary
389c8e9d2d [minor] mark scripts as executable
if a filename ends with `.py` and  the file begins with '#!.*python.*',
make it executable.

Change-Id: I41de516ff37343d3b0979bde9fd61813aec7365c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254439
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-11-21 17:06:27 +00:00
Hal Canary
2dad99092c Replace third_party/gif: Preflight changes
Something is breaking client code in unexpected ways.  Let's try this
piecemeal.

  - skia_libgifcodec_path gn var. Default is
    third_party/externals/libgifcodec.  Anfroid framework uses
    third_party/libgifcodec.

  - skia_use_libgifcodec gn var; defaults to !skia_use_wuffs.  Allow
    disabling both codecs.

  - GN template("optional"): add public_include_dirs, similar to
    public_defines.

  - SK_USE_LIBGIFCODEC, ifdef for skia_use_libgifcodec.

  - SkCodec.cpp: use SK_USE_LIBGIFCODEC

Original CL:  https://review.skia.org/254582

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP
Bug: skia:9654
Change-Id: I70561f5f945656065e4b318d5fff505961fb0b6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255578
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-21 15:19:41 +00:00
Hal Canary
f7cb902904 Revert "Replace third_party/gif with new DEPS entry."
This reverts commit 6d29bfbfcd.

Reason for revert: try to fix g3 roll.

Original change's description:
> Replace third_party/gif with new DEPS entry.
>
>   - skia_libgifcodec_path gn var. Default is
>     third_party/externals/libgifcodec.  Anfroid framework uses
>     third_party/libgifcodec.
>
>   - skia_use_libgifcodec gn var; defaults to !skia_use_wuffs.  Allow
>     disabling both codecs.
>
>   - BUILD.gn `gif` optional source_set: use new skia_libgifcodec_path
>     code, not third_party/gif code.
>
>   - GN template("optional"): add public_include_dirs, similar to
>     public_defines.
>
>   - SK_USE_LIBGIFCODEC, ifdef for skia_use_libgifcodec.
>
>   - SkCodec.cpp: use third_party version of SkGifCodec.h.
>
>   - src/codec/SkGifCodec.*, third_party/gif/*: remove files.
>
> Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP
> Bug: skia:9654
> Change-Id: Ie22d2bb7e52322fd3eedb97015f3aec2ce5e3402
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254582
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=djsollen@google.com,halcanary@google.com,rmistry@google.com,scroggo@google.com

Change-Id: I427e1a073c0574e1502b6196873ac3001a22250b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9654
Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255534
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-11-20 20:54:44 +00:00
Hal Canary
82c13311fa BUILD: libgifcodec: fix flutter build
Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android
Change-Id: If6790e7084f2cc8a9acf759184a52d1fdcb9b793
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255531
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-20 20:48:59 +00:00
Hal Canary
6d29bfbfcd Replace third_party/gif with new DEPS entry.
- skia_libgifcodec_path gn var. Default is
    third_party/externals/libgifcodec.  Anfroid framework uses
    third_party/libgifcodec.

  - skia_use_libgifcodec gn var; defaults to !skia_use_wuffs.  Allow
    disabling both codecs.

  - BUILD.gn `gif` optional source_set: use new skia_libgifcodec_path
    code, not third_party/gif code.

  - GN template("optional"): add public_include_dirs, similar to
    public_defines.

  - SK_USE_LIBGIFCODEC, ifdef for skia_use_libgifcodec.

  - SkCodec.cpp: use third_party version of SkGifCodec.h.

  - src/codec/SkGifCodec.*, third_party/gif/*: remove files.

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP
Bug: skia:9654
Change-Id: Ie22d2bb7e52322fd3eedb97015f3aec2ce5e3402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254582
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-20 19:07:00 +00:00
Greg Daniel
9841a61e90 Update GrVkImageView to handle failure of VkImageView creation.
Also deleted GrVkBufferView which isn't used anywhere.

Bug: skia:9603
Change-Id: Ia5a2cefe06a1e27a7d126990ea20a9d663d89c0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255308
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-11-20 19:06:59 +00:00
Ben Wagner
51aabc94be Add Debian10 GCC Docker Build
Bug: skia:9632
Change-Id: I779fa02cd7227b4d68cc8b0d1c1781473ad0741d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254499
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-11-19 18:50:29 +00:00
Hal Canary
22814dbf6b GN tools: copy_git_directory.py better error message.
No-Try: true
Change-Id: Ifd92c47ae1beaaa53430e6fa8e658a795a398b55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255299
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-19 17:04:18 +00:00
Mike Klein
e0ce128c1d add VTune integration to SkVM
There's no prebuilt libjitprofiling.so in the VTune SDK,
so I couldn't make this entirely automagic.  To enable set

    skia_vtune_path = "/opt/intel/vtune_amplifier"

or obviously to wherever your VTune is installed.  Looking at
the source for jitprofiling.c, which is in the SDK, it might
be possible to replicate and make this more automatic, but I
think it's easy enough to just set a GN path variable.

For an assembly-level profile, leave this VTune option disabled:

    [ ] Remove raw collector data after resolving the result

Change-Id: I1426ab1b838e00745e22ca4a97b9d0cd4c4e3280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255124
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-19 16:42:21 +00:00
Hal Canary
11c45d64dc GN tool: copy_git_directory.py script
Motivation: to be used by android roller (android_skia_checkout.go)
to keep third_party/libgif updated to where DEPS points
third_party/external/libgif at.

No-Try: true
Bug: skia:9654
Change-Id: I18273dfc7da215b6081ffd454edfa1651791b6df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254896
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-11-18 21:05:10 +00:00
Robert Phillips
c919f97768 Reformat gn files
Change-Id: I60ccd1ef19d6a6dc033e20e7ac55c3182d76ea0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255082
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-11-18 16:39:28 +00:00
John Rosasco
24cbdab97e SKQP Build for Fuchsia SDK
Change-Id: I2619784eca0f7a4dd66f2db0104cb746d9266b4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244369
Commit-Queue: John Rosasco <rosasco@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-18 12:34:28 +00:00
Mike Reed
2319b803c2 remove unused (by clients) SkMultiPictureDraw
More cleaning to do if we like this idea...

Change-Id: I608143db085911565dd5f5426f7ee6436ec58cdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254680
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-15 18:18:36 +00:00
Robert Phillips
e837e61b5a Respect the max indexBuffer limits in the bulk texture draw API (take 2)
This is required before we can lower the max AA quad count (again).

Bug: b/143572065 skia:9601
Change-Id: Ibd029a59f6589e1ae6c66d072e5039f0e9de06dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254581
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-15 16:57:33 +00:00
Robert Phillips
438d986b47 Respect max index buffer sizes in GrFillRectOp::MakeSet
This is required before we can lower the max AA quad count (again).

Bug: b/143572065 skia:9601
Change-Id: Iea5884ffff9bd62f62527fcb597dac97d33ecd76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254438
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-14 18:26:18 +00:00
flar
a8e985e87a Only define SK_GL for Flutter on non-Fuchsia platforms.
Change-Id: I71dd3324a6d3b051b164bc066c03cb2971106757
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254498
Auto-Submit: Jim Graham <jimgraham@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-14 14:51:28 +00:00
Robert Phillips
ae01f62009 Revert "Respect the max indexBuffer limits in the bulk texture draw API"
This reverts commit dd947ceb55.

Reason for revert: CL isn't getting any respect from Android

Original change's description:
> Respect the max indexBuffer limits in the bulk texture draw API
> 
> This is required before we can lower the max AA quad count (again).
> 
> Bug: b/143572065 skia:9601
> Change-Id: Id34123476ad49a57dc9ce7fe13f941c06f721b74
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252603
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ibe396fe5a0351190c214ed54611ce72b7928cadd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/143572065 skia:9601
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254437
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-13 15:56:43 +00:00
Robert Phillips
dd947ceb55 Respect the max indexBuffer limits in the bulk texture draw API
This is required before we can lower the max AA quad count (again).

Bug: b/143572065 skia:9601
Change-Id: Id34123476ad49a57dc9ce7fe13f941c06f721b74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252603
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-13 15:32:02 +00:00
John Rosasco
a9b348f66c Reland fully delineate GL usage w/ skia_use_gl.
Change-Id: I90f40467be145537cc08461fd3805606432f0cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254240
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Rosasco <rosasco@google.com>
Auto-Submit: John Rosasco <rosasco@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-12 21:43:44 +00:00
Jim Van Verth
9187e49ed1 Detect whether trying to blit a Metal swapchain texture, and fail if so.
Metal swapchain textures (equivalent to GL's FBO 0) can't be used with
MTLBlitCommandEncoder. For copySurface we need to detect this and fail.
Future changes will handle GrSurfaceProxy.

Change-Id: I9235d91cf31e96260c8d1da5938f5441d2e49d27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252045
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-11-12 14:56:28 +00:00
Brian Salomon
c75bc031ef Clamp RGB outputs of GrYUVtoRGBEffect.
The matrices we're using can produce very slightly out of range color
channels. This gives surprising results when in shader blending is used
for color burn and color dodge. After this change we clamp the RGB
values to 0..1 before applying premul.

Adds a GM modeled on a blink layout test that shows the problem using
SkImageMakeFromYUVAPixmaps.


Bug: skia:9619


Change-Id: I446d39763a7f5a2f7c5f61d94d163927d851baa3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253879
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-11 20:04:15 +00:00
Brian Salomon
8283fa4066 C++17
With this change C++17 language features can be used in code that does
not need to be be included in client code (not in public headers or
the files they transitively include).

We haven't investigated the c++17ness of the standard libraries in use
by clients so proceed with caution on library features.

One thing discovered along the way: throw() in C++17 is now equivalent
to noexcept(true). Moreover, the noexcept-ness of a function is part of
its type in C++17. This means that if a header declares a function with
throw() and it is included in a cpp compiled with C++17 file it will have
a different type than if it is compiled in a file compiled with C++14 (or
earlier) and you can get linker errors. Here is a change we had to make
as a result of this:

https://skia.googlesource.com/skia.git/+/4d0fe38f29388ef0aa6893d1d4fc237e758dd11f%5E%21/#F0

Change-Id: I996f2237fdd6b49e2e4cc8d3ff6db9dd536eafd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235022
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-11 14:49:55 +00:00
John Rosasco
1edd468de3 Staging for Chromium to accept Skia-GL changes to come.
Change-Id: I406cc4f284ce2cf83f70d88ebd9bac9c10c148a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253737
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-11-11 14:17:15 +00:00
Mike Reed
052a05ac3a add flatten test to SkFont
Change-Id: I7e96e826fad9aa204c963ae671cce668a676378f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253684
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-08 18:49:15 +00:00
Robert Phillips
0efc01d540 Revert "Fully delineate GL usage w/ skia_use_gl"
This reverts commit 078cf3e3b2.

Reason for revert: Appears to be blocking the Chrome roll due to Fuchsia build failures

Original change's description:
> Fully delineate GL usage w/ skia_use_gl
> 
> Change-Id: I17424d2235c7a54c4cda036f01a0b99dadc4b632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252085
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=mtklein@google.com,bsalomon@google.com,halcanary@google.com,rosasco@google.com

Change-Id: I17ba79bfe6e7f81c126eddbd50ca5384cfa4179c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253098
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-06 17:19:48 +00:00
John Rosasco
078cf3e3b2 Fully delineate GL usage w/ skia_use_gl
Change-Id: I17424d2235c7a54c4cda036f01a0b99dadc4b632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252085
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-11-06 15:15:03 +00:00
Mike Reed
971e9eb05d split out serial functions for SkFont into separate impl
... in prep for future CL that makes serialiation more complicated
https://skia-review.googlesource.com/c/skia/+/252927

Change-Id: Ica3cb803c6cd47295b4f12574c9965e47dc57ac3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252659
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-05 22:35:24 +00:00
Mike Klein
23e856f369 add GM for exercising interesting paths in SkVMBlitter
It's not drawing anything earthshattering, but it does act as an easy
way to exercise some interesting code paths in SkVMBlitter, here first
program caching based on shader program and not shader identity.

With today's shader caching patches, this makes 2 calls to
skvm::Builder::done(), JITing the program, while if you patched this in
at head you'd see 3.  I'd like it to get down to 1 by converting paint
colors to color shaders.

Change-Id: I042f4d44a792b46e5543794c853e4ef0d95b11ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252029
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-01 15:39:34 +00:00
Hal Canary
7823aeb8d6 refactor/layering: SkMalloc.cpp
Change-Id: Ie27c9f0ba2b9f160010d33548dc8359851610d79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251819
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-10-31 15:49:03 +00:00
Michael Ludwig
1beb8ae9a2 Reland "Add variety of bulk API benchmarks"
This reverts commit 659b21d480.

Reason for revert: Fixed skipping nonrendering benchmark

Original change's description:
> Revert "Add variety of bulk API benchmarks"
>
> This reverts commit e63595dd85.
>
> Reason for revert: Breaking the Perf tests:
>
> ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
> Command exited with code 139
> #######################################
> symbolized stacktrace follows
> #######################################
> build/nanobench BulkRectBench<1000, (RectangleLayout)1, (ImageMode)2, (DrawMode)2>::onPerCanvasPreDraw(SkCanvas*) at skia/bench/BulkRectBench.cpp:218
> build/nanobench main at skia/bench/nanobench.cpp:1277
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f1213dad2e1]
> build/nanobench _start at ??:?
>
>
>
>
>
> Original change's description:
> > Add variety of bulk API benchmarks
> >
> > Covers drawing 1000 anti-aliased rectangles, either sharing 1 image, using
> > a unique image, or as a solid color. Tests using the bulk APIs and regular
> > one-at-a-time drawing.
> >
> > Change-Id: Icdf5a1f6df229aed785212d0941b89c11aa785c0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251003
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,egdaniel@chromium.org,michaelludwig@google.com
>
> Change-Id: I3b26d5a04c472993585242a108c2764ea2b96940
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251213
> Reviewed-by: Joe Gregorio <jcgregorio@google.com>
> Commit-Queue: Joe Gregorio <jcgregorio@google.com>

Change-Id: I83538faa29ada5ab1b02ff07ae9fe90734ed198e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251238
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-10-28 18:48:32 +00:00
Joe Gregorio
659b21d480 Revert "Add variety of bulk API benchmarks"
This reverts commit e63595dd85.

Reason for revert: Breaking the Perf tests:

ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Command exited with code 139
#######################################
symbolized stacktrace follows
#######################################
build/nanobench BulkRectBench<1000, (RectangleLayout)1, (ImageMode)2, (DrawMode)2>::onPerCanvasPreDraw(SkCanvas*) at skia/bench/BulkRectBench.cpp:218
build/nanobench main at skia/bench/nanobench.cpp:1277
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f1213dad2e1]
build/nanobench _start at ??:?
  




Original change's description:
> Add variety of bulk API benchmarks
> 
> Covers drawing 1000 anti-aliased rectangles, either sharing 1 image, using
> a unique image, or as a solid color. Tests using the bulk APIs and regular
> one-at-a-time drawing.
> 
> Change-Id: Icdf5a1f6df229aed785212d0941b89c11aa785c0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251003
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,egdaniel@chromium.org,michaelludwig@google.com

Change-Id: I3b26d5a04c472993585242a108c2764ea2b96940
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251213
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2019-10-28 16:29:35 +00:00
Michael Ludwig
e63595dd85 Add variety of bulk API benchmarks
Covers drawing 1000 anti-aliased rectangles, either sharing 1 image, using
a unique image, or as a solid color. Tests using the bulk APIs and regular
one-at-a-time drawing.

Change-Id: Icdf5a1f6df229aed785212d0941b89c11aa785c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251003
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-10-28 16:20:04 +00:00
Mike Klein
c466945ddd tweak ar/libtool setup
This is what I was getting at on the comments in PS 5.

Change-Id: I5435860ebea9ed01217d7acb378e1fadce19b107
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250776
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-10-25 18:21:22 +00:00
Jim Van Verth
5a8f3e4aac Reland "Enable Programs (formerly GLPrograms) test for other APIs"
This is a reland of 598741667a

Original change's description:
> Enable Programs (formerly GLPrograms) test for other APIs
> 
> Bug: skia:9365
> Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Eric Boren <borenet@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Bug: skia:9365
Change-Id: I94db6cb2b1465edbb2e6d32708b835a76e12cbc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250016
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-10-24 19:53:25 +00:00
Herb Derby
740f85949d Redo removing annoying link messages
From mac's man libtool
   Libtool with -static is intended to replace ar(5) and ranlib

Libtool allows RSP files, and has -no_warning_for_no_symbols

Change-Id: I1d61095db02ae83fdf491c26eae7d9d4cefc2d17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250337
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-10-24 18:04:54 +00:00
Hal Canary
e107faa062 SkRemoteGlyphCache Add tracing to diff canvas
Use `extra_cflags=["-DSK_CAPTURE_DRAW_TEXT_BLOB"]` to enable.

Change-Id: I1d6db478ee91696cdce090647b889c17a83a2718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250259
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-10-24 17:09:31 +00:00
Florin Malita
36031207dc GPU support for SkColorFilters::HSLAMatrix
Change-Id: I5b762811b44861fcedd2fa5c0e48a82718458605
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232398
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-10-23 16:10:27 +00:00
Michael Ludwig
6387dc19f6 Revert "Enable Programs (formerly GLPrograms) test for other APIs"
This reverts commit 598741667a.

Reason for revert: segfaults on Pixel bots

Original change's description:
> Enable Programs (formerly GLPrograms) test for other APIs
> 
> Bug: skia:9365
> Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Eric Boren <borenet@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

TBR=borenet@google.com,jvanverth@google.com,robertphillips@google.com

Change-Id: I286c637490bb8a21c0020a8935ce4c850b98f6b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9365
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249978
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-10-22 15:39:49 +00:00
Jim Van Verth
598741667a Enable Programs (formerly GLPrograms) test for other APIs
Bug: skia:9365
Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-10-22 14:36:09 +00:00
Greg Daniel
a83de58450 Add GrSurfaceProxyView and add support for it on GrRenderTargetContext.
Bug: skia:9556
Change-Id: I681c364cef6867feb0ae06a53cd7d264d7163e35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249879
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-10-22 13:58:17 +00:00
Herb Derby
c65eb34d2f Update for XCode 11 include system
With XCode 11 there is no more /usr/include directory. This
does not affect the XCode compilers, but does make goma compiler
break. This finds the system includes the same way that the iOS
builds currently do.

The gn_to_bp.py tool runs gn with target_os == mac, but host_os != mac.
In that case, the xcrun tool can not run, so make xcode_sysroot = "". This will
allow the xcode compilers to work when using the android.bp to build things.

TESTED:
builds on mac with and without goma

Change-Id: I9de6797c32760c59e62fe5ac505a3404e5eaf8e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249537
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-10-18 21:38:47 +00:00
Ben Wagner
e8960ecfbf Add SkColorData.h to gn.
Allows IDEs to find it, brings us a bit closer to getting gn check to
work.

Change-Id: I1e0c8d01f272c41c97dbbf40402b64f44a6c3c48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249421
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-10-18 14:54:41 +00:00
Nathaniel Nifong
60c37e7ba1 Enable SKSL in skia_nanobench, enforce resources being present.
Don't include SKSL interpreter bench when interpreter is disabled.

Bug: b/141263986 b/141871494
Change-Id: Ie9a5f3f28b28af077f7279da0d20bfafb41bd6cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247054
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Pirama Arumuga Nainar <pirama@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2019-10-16 16:34:36 +00:00
Stephen White
20c626aa23 Update Dawn backend to ToT. This is about 3 months of changes.
Remove optional param to SetIndexBuffer().
Update SetVertexBuffers -> SetVertexBuffer.
PipelineStageDescriptor -> ProgrammableStageDescriptor.
Update past generator changes, ring buffer changes, etc.
Add ErrorScopeTracker.cpp/.h to the build.
Add Vulkan MemoryResourceAllocator files.
Fix vertexShader ShaderStageDescriptor.
Fix spirv-cross include path.
TextureUsageBit -> TextureUsage, etc.
DawnErrorCallback fixes.
Removal of texture.CreateDefaultView.
Fix GL supported_extesions mumbo jumbo.
Update past ChromeOS change.
Add PassResourceUsageTracker.cpp/.h to build.
Add GLFormat.cpp/.h to build.
Add Extensions and Toggles to the build.
Add EncodingContext, AttachmentState to build.
Add RenderEncoderBase to Dawn build.
gn format dawn BUILD.gn, spirv-cross BUILD.gn.

Change-Id: I26538d63c93668647048814aad6ad456ae323679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248261
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-15 22:26:38 +00:00
Herbert Derby
0be4c2cb86 Introduce SkGlyphDrawableBuffer
Used for efficient glyph id to glyph lookup.

This is part of a larger change:
https://skia-review.googlesource.com/c/skia/+/238196

Change-Id: Ifce43879685bf0d760a7e12dceb32f7a650be687
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247340
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-10-11 15:40:24 +00:00
Robert Phillips
865d8d682c Centralize error checking w/in the GrProgramInfo class
Although not necessary I would like to centralize/encapsulate the error checking so there is just one place to go to update/extend this code. It does have the nice property that, since we validate in the ctor and this object is immutable, we only have to do it once (and can delete some code spread throughout the code base).

Bug: skia:9455
Change-Id: Iaa26c7a896a9bd053358a6f8424d7f5944b0117e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247339
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-10-09 19:09:01 +00:00
Robert Phillips
901aff018b Add GrProgramInfo to centralize management of program information
This is the first step in moving the marshaling of program information earlier in renderTask processing (i.e., to onPrePrepare).

Change-Id: I91e3baed9a128e845bd32f9dbbacd9b21d852a3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244118
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-10-08 20:35:51 +00:00
Michael Ludwig
05a777d442 Define coord space tagged geometry for image filters v2.
This is an alternative approach to https://skia-review.googlesource.com/c/skia/+/234896

It inverts the templates and coordinate spaces, so that each coordinate space is
defined by a struct that accepts the SkIRect/etc. type as an argument. For parameter
space and device space, the only exposed functionality is holding on to the coordinates
and moving into and out of the layer space (using the Mapping type, which now encapsulates
the definition of parameter, layer, and device space for a given CTM).

The LayerSpace struct has specialized definitions for each of the 6 key geometric types,
exposes accessors/mutators and operations like join/intersect that work on appropriate
layer-space geometry.

FilterResult and Context have been updated to use these new types, although they no
longer take a Usage enum. If this strategy works, FilterResult will be updated to have
more utilities to operate and read from its image in layer-space so there won't be a need
to have the image space (and the usage enum to differentiate between different image
spaces).

To further reinforce the differences between getInputBounds() and getOutputBounds() (which
previously used Usage to do this), they now accept/return values in device and parameter
space. This is no different than what SkCanvas would have done before calling the old
functions, but now that work is owned by SkImageFilter (seems like a good thing), and
achieves the same reinforcement.

Change-Id: I8bebb9fadf6c8f2bd51fa863b2d6f2e4a33dd08b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244515
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-10-04 16:40:00 +00:00
Brian Salomon
9241a6d394 Reland "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This is a reland of 6fc04f88a8

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
> 
> This is a reland of ce240cc6fd
> 
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> > 
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> > 
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> > 
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> > 
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> > 
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> > 
> > Bug: chromium:973403
> > Bug: skia:8962
> > 
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 19:14:22 +00:00
Brian Osman
c95c4a69e1 Remove old SkSL JIT and cleanup include files a bit
- The raster pipeline JIT was an experiment that never really panned
  out (except for also introducing the interpreter, which survives).
  The removal should be pretty thorough, including undoing some changes
  to SkRasterPipeline itself. For reference, I basically undid most of
  https://skia-review.googlesource.com/c/skia/+/112204/

- With runtime shaders, always convert to Program using kPipelineStage
  This makes the first-pass compile consistent with runtime color filter,
  and with GrSkSLFP.

- Remove sksl_mixer.inc, which hasn't been used in a while.

- In sksl_pipeline.inc, all of the math symbols are already declared
  in sksl_gpu.inc, which forms the base symbol table when this include
  is parsed.

  sk_x and sk_y appear to never be used? Those builtin IDs are the IDs
  of the x and y params to main, but that logic still works without
  these declarations.

  sk_OutColor only makes sense in FP files (it's still declared in
  sksl_fp.inc).

Change-Id: Ie8dd68d2c4687745d46f96804a76695bce8c1ba2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246017
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-10-03 18:00:40 +00:00
Ravi Mistry
cb55010652 Revert "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This reverts commit 6fc04f88a8.

Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-10-03 09:19:24 +00:00
Brian Salomon
6fc04f88a8 Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This is a reland of ce240cc6fd

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 01:41:35 +00:00
Brian Salomon
9c219785a8 Revert "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This reverts commit ce240cc6fd.

Reason for revert: crashing in chrome unit test, abandoned context related?

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic14cf07a7629b167c9f34a651aa87a0326e74207
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 22:51:15 +00:00
Brian Salomon
ce240cc6fd SkSurface asynchronous read APIs allow client to extend pixel lifetime
Previously the pixel data passed to the client was only valid during
the client's callback. This meant if the client wanted to defer
processing of the data a copy was necessary.

Now we pass an object to the callback and the pixel lifetime is tied
to the lifetime of that object.

The object may be holding a GPU transfer buffer mapped. We don't assume
that the object will be released on the direct GrContext thread. So
when the object is destroyed it posts a message to a new type,
GrClientMappedBufferManager, hanging off the direct context. The direct
context will periodically check for messages and unmap and then unref
buffers so that they can be reused. Currently this is done in
GrContext::performDeferredCleanup() and GrDrawingManager::flush().

The old API is kept around for backwards compatibility but it is
reimplemented as a bridge on top of the new mechanism.

Also a utility function to SkImageInfo is added to directly make a new
info with a specified dimensions rather than passing the width and
height separately to makeWH().

Bug: chromium:973403
Bug: skia:8962

Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 19:20:08 +00:00
Pirama Arumuga Nainar
5be3c13263 [Android] Use wildcard for data associated with skia_nanobench
'resources/**/*' includes the entire resources directory, while
'resources/*' does not include the recursive contents.

Bug: skia: none
Change-Id: Iae5a41af0d62f3eb00098f83721f7f01f0b0ab5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245317
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2019-10-01 19:07:12 +00:00
Brian Salomon
4bc0c1fc4b Rename GrColorSpaceInfo -> GrColorInfo
Add version SkImageInfo::Make() that takes SkISize instead of separate
width and height.

Change-Id: I42aa79d23b19e22f5405631728c245b04bce0559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245172
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-30 21:53:24 +00:00
Brian Salomon
f2ebdd91bf Rename GrPixelInfo to GrImageInfo.
Give it its own header file.

Make it store SkISize rather than separate int w/h.

Change-Id: I732f2774c561decac743a950959a70cbc162b67b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-30 17:10:18 +00:00
Ben Wagner
076c50cc00 Use CIPD package for iOS provisioning profile.
Docs-Preview: https://skia.org/?cl=244996
Bug: skia:8271
Change-Id: I94e15138918e224221baa7a8a2829e05e938fa8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244996
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-09-30 15:47:19 +00:00
Herb Derby
cbd235c746 Introduce SkIota a wrapper that adds an index
SkIota adds an index to some collection you already use:

std::vector<int> v;
for (auto t : SkMakeIota(v)) {
   size_t i; int v;
   std::tie(i, v) = t;
   ...
}

Change-Id: I18390fc084eb8509cfaeb50d9720541759a2986d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225546
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-27 15:17:06 +00:00
Herb Derby
53eb1ec5d5 Restrict SkStrikeInterface to GPU and rename to SkStrikeForGPU
SkStrikeInterface has become more and more focused on support of the GPU
stack. Finishing this focus clears up some of the confusing parts of the
Bitmap code.

Remove use of SkStrikeInterface from the BitmapCode.

Change-Id: I18a50d3ec17d81fcbe55030a3a3ec7eeeba23497
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244297
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-26 16:06:48 +00:00
Nathaniel Nifong
7ee3f93196 Add a test that draws subpictures within an MSKP and make it pass.
It would have been passing, note that he changes to SkRecorder are needed only to obtain the
SkRecord used in asseting the correct commands were recorded.

Bug: skia: 9462
Change-Id: Ic43ab400b5954cc4f6eb465168179c0204a66040
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243818
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2019-09-25 20:12:35 +00:00
Herb Derby
2b92142b0e Add project declaration for CMake
Change-Id: I8a544fa91d2fba957dceb9e6b2a60ea824780e48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244096
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-25 17:08:26 +00:00
Shachar Langbeheim
497365778e Compile CanvasKit without -fPIC, for latest emscripten compatibility.
Due to an issue in emscripten's latest-upstream compiler (link below),
Skia's libraries can't be built using -fPIC. This change allows users
to opt-out of using -fPIC during compilation, and sets compile.sh to
opt-out accordingly.
https://github.com/emscripten-core/emscripten/issues/8995
https://github.com/emscripten-core/emscripten/issues/9317

Change-Id: I25b6e185b58ab1ba8263f2e2f450591f6025f62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243317
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-09-24 20:19:02 +00:00
Chris Dalton
c096654fa7 ccpr: Don't assign inverse fill types to fan tessellations
Bug: skia:9453
Change-Id: Iabbd1089975efff4e89687e990128c075bf0ab9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243432
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-09-24 02:44:17 +00:00
Brian Osman
2e29ab5b03 added support for user-defined functions to GrSKSLFP
Bug: skia:
Change-Id: I1483cdf7229b7234be41d21407e2b4abf99fff76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239925
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-20 17:13:57 +00:00
Jim Van Verth
b2f55532bb Set up prototype interface for MakeFromCAMetalLayer
Change-Id: I87b0fc76ef48c1a21498e576853a6c3b4a6a98f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242563
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-19 17:37:00 +00:00
Brian Salomon
f19f9caab2 Handle F16Norm clamping in SkPaint->GrPaint conversion.
Previously this clamping was inserted by the program builder.

Adds GrSaturateProcessor to handle saturating in the fragment shader.

Clamp the GrPaint color rather than using a fp when possible.

Has to be plumbed through GrTextureOp because that skips SkPaint
conversion.

Removes a usage of GrPixelConfig.

Bug: skia:6718
Change-Id: Ifa6544496d34677f17e797433e6ef3a97be5c2b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242558
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-18 20:53:01 +00:00
Herb Derby
c44ee1a263 Reland "SkZip - synchronized indexing of several pointers"
This is a reland of f3c4a829c6

Original change's description:
> SkZip - synchronized indexing of several pointers
>
> This is the mechanism for syncing a bunch of things with
> contiguous memory like vector<>, array<> and SkSpan<>.
>
> In a following CL, a convenience function SkMakeZip will
> easily convert most containers into a zip.
>
> Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I7d1a91a9c35dde721147bb3c1f23c9b3a8d59d04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-09-18 19:16:32 +00:00
Herb Derby
a9d44b61f2 Revert "SkZip - synchronized indexing of several pointers"
This reverts commit f3c4a829c6.

Reason for revert: std::get<T> is a c++14 std library call

Original change's description:
> SkZip - synchronized indexing of several pointers
> 
> This is the mechanism for syncing a bunch of things with
> contiguous memory like vector<>, array<> and SkSpan<>.
> 
> In a following CL, a convenience function SkMakeZip will
> easily convert most containers into a zip.
> 
> Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,herb@google.com

Change-Id: Idc52b0552cd01b163357a45d43d9531e62694dda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242356
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-09-18 04:29:19 +00:00
Herb Derby
f3c4a829c6 SkZip - synchronized indexing of several pointers
This is the mechanism for syncing a bunch of things with
contiguous memory like vector<>, array<> and SkSpan<>.

In a following CL, a convenience function SkMakeZip will
easily convert most containers into a zip.

Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-17 23:01:50 +00:00
Hal Canary
3388c1a15e gn: split out iOS templates to gn/ios.gni
motivation:  BUILD.gn os too big, also can be reused in modules.

Also: add a BUILD.gn for minimal_ios_mtl_skia_app that uses the
template.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-arm64-Release-iOS,Test-iOS-Clang-iPhone7-GPU-PowerVRGT7600-arm64-Debug-All-Metal,Test-iOS-Clang-iPhone6-GPU-PowerVRGX6450-arm64-Release-All

Change-Id: I70ebb9668cce51ea9fa671a3d8c93041fbedcbfa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241761
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-09-16 18:49:24 +00:00
Robert Phillips
de4456f6f2 Add bench for SkDDLRecorder detach
On Windows I'm getting:

curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
  33/38  MB	1495	2.62us	2.65us	2.66us	2.72us	1%	.o.o.oO.OO	gl	DDLRecorder

Change-Id: I529e6ac612c455915c166472124b08647eb7bffd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241039
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-12 17:09:08 +00:00
Stephen White
7fba36b88a Dawn: implement staging buffer manager.
Use managed staging buffers for texture uploads, uniforms and buffers.

Change-Id: I063707c160236725d27a1d1bfb197d3096a07b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238120
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-10 19:02:15 +00:00
Greg Daniel
c30f1a936d Move surface wait ops to GrRenderTasks.
Change-Id: Id989a666e67be85af6ed72447696657b8c11aaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239443
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-06 19:57:26 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Michael Ludwig
6d1c0d4196 Avoid use of SkMatrixImageFilter to handle CTM for backdrop filtering
The DrawDeviceWithFilter function used to rely on SkImageFilter's
applyCTMForBackdrop, which would create a new DAG and use an
SkMatrixImageFilter node to account for the transformation. However,
that filter is really meant to perform a transformation prior to the
CTM matrix. Abusing matrix math to instead have it map the backdrop
contents back into the CTM local space grossly inflated the size of the
temporary images needed when under many perspective transforms.

This CL instead takes over control of the CTM decomposition and draws
the backdrop (src) content into a temporary layer directly, and then
feeds that through the image filtering. The code is somewhat cumbersome
to follow because of the combination of coordinate spaces and need to
make everything relative to the top left corner of the images.

When the rest of my image filter refactor is more underway, I believe that
a lot of the coordinate space math and image origin accounting will
be much cleaner, but the overall backdrop filtering strategy would remain
similar to this new implementation.

Bug: skia:9074
Change-Id: Ibd2995e81d2b308c74b2d298da5e38daa74c8677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239108
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 16:35:18 +00:00
Chris Dalton
d6cda8d1cb Rename GrGLIRect to GrNativeRect
This will allow us to reuse the "setRelativeTo" logic in more places
than GL.

Bug: skia:
Change-Id: Ic67b211d2a1b27535187ddae8e4771f595dc0397
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239414
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-05 15:46:18 +00:00
Jim Van Verth
e784f75beb Reland "Add launch screen to iOS apps"
This is a reland of bf8dad281e

Original change's description:
> Add launch screen to iOS apps
> 
> Bug: skia:
> Change-Id: I7ebe94213c26c31c1b0dbd1b8951f87263cd41a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/175826
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Hal Canary <halcanary@google.com>

Bug: skia:
Change-Id: I111242899339186fba2b8753ee43bc0fb2ea5295
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239437
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-05 14:05:08 +00:00
Jim Van Verth
f643ba7a90 Revert "Add launch screen to iOS apps"
This reverts commit bf8dad281e.

Reason for revert: Need to fix infra Housekeeper bot

Original change's description:
> Add launch screen to iOS apps
> 
> Bug: skia:
> Change-Id: I7ebe94213c26c31c1b0dbd1b8951f87263cd41a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/175826
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Hal Canary <halcanary@google.com>

TBR=jvanverth@google.com,halcanary@google.com,benjaminwagner@google.com

Change-Id: Ie540cc4d3209cf5e92d4c66812243721b1ac7fc2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239105
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-04 20:21:48 +00:00