Commit Graph

1888 Commits

Author SHA1 Message Date
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
Jim Van Verth
bf8dad281e 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>
2019-09-04 18:44:21 +00:00
Hal Canary
3e710b0231 gn: try again to fix fuchsia
Change-Id: Ie5e437fa08fb85c764703d8e292e696a568f5dcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239117
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-09-04 14:33:42 +00:00
Hal Canary
c7b263b603 gn: move all skia_* declare_args to skia.gni
motivation:  put them all in one place.

Change-Id: Id40aff1f6ddc36b99b14567f110b5084da7e2bd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238899
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-09-03 18:29:22 +00:00
Brian Salomon
beb7f525c8 Make GrSurfaceProxy constructors take arg that determines participation in
GrResourceAllocator.

Removes LazyInstantiationType. All callbacks can be invoked one time (if successful).
Lazy callbacks indicate whether their lifetime should be extended, which is used by
promise image proxy callbacks.

Promise image proxies are no longer deinstantiated at the end of flush and
GrDeinstantiateProxyTracker is removed. They will be instantiated the first time
they are encountered in GrResourceAllocator::addInterval (without actually adding
an interval) and then remain instantiated.

Also removes some "helper" versions of proxy factory functions that took fewer
params. They weren't much used outside of test code and as the total number of params
has grown their relative utility has diminished. We could consider a params struct
or radically simpler helpers that take only a few params if desired.

Change-Id: Ic6b09e7b807b66cb9fcbb7a67ae0f9faf345485f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-03 14:58:41 +00:00
Ben Wagner
edcce3145a [gn] Add pool for dsymutil
dsymutil seems to kill the machine when too many processes are run in
parallel, so we need to use a pool to limit the concurrency when
passing large -j to Ninja (e.g. Goma build).

Change-Id: I84404291db4781f86268256ab888cef8d07c770e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234477
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-09-03 14:08:09 +00:00
Ben Wagner
d51ea41ce4 [gn] Move dsymutil from link command to a separate action
Change-Id: I18a3bd5e845305e3b2521d076fd641bd5175b618
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234327
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-09-03 14:02:49 +00:00
Hal Canary
452ce044f0 iOS toolchain: no -soname for is_component_build=true
Change-Id: I81835ffdd1fbdaa12d662527e38b42532f2ea8e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238756
Commit-Queue: Hal Canary <halcanary@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-03 13:52:49 +00:00
Michael Ludwig
0a1e9efa39 Don't use AA convex path renderer if direction can't be determined
Without the changes to GrShape and GrAAConvexPathRenderer, this new GM
would not draw the red circle at the center when using Ganesh. Raster
drew the red circle. The difference came about because they checked
convexity after transforming by the view matrix, and Ganesh checked
before.

With this particular path construction and the very large scale factor
on the CTM, the convexity calculator in local space computed small
enough edge vectors that it thought the contour backtracked on itself
instead of winding in a consistent direction.

The GrAAConvexPathRenderer would claim it could draw the convex path,
but later when actually preparing to draw, it would do nothing if it
turned out the convex path didn't have a direction. This CL updates it
so that the convex path renderer's canDraw() function matches what it
is actually able to draw.

There is the separate issue of the convexity/direction checking
precision.

Bug: chromium:996140
Change-Id: I6f2af2d9ba6752663d97c8573deb2d767a3f1245
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-02 01:57:03 +00:00
Ethan Nicholas
d4efe685dd SkSL sample() now permits specification of coordinates
Bug: skia:
Change-Id: I16073008ac852f1864bd1d2bd38087a5b661d05a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232581
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-08-30 15:29:13 +00:00
Jim Van Verth
68cb8b0239 Switch to new IOS windowing system.
This replaces the SDL-based system and should allow Metal to work on iOS.
OpenGL and raster will render but there's no touch input yet.

Bug: skia:8737
Change-Id: I863accc47f0e1781192d567dbe54d1e321c3cd2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231561
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-08-29 20:13:03 +00:00
Jim Van Verth
066ceb15b6 Implement fences and semaphores for Metal.
GrFence is implemented by a single MTLSharedEvent where we increase the
value with each new invocation. GrSemaphore uses a MTLEvent (the
assumption here is that we are signaling and waiting on the same device)
with an associated value that defaults to 1. For generating a large
number of GrSemaphores at once it should be possible to use the same
MTLEvent but with different assigned values.

Bug: skia:8243
Change-Id: Ic7de2d9d295fbe51e67bc7c3c4354257cb0774d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233416
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-08-28 19:38:56 +00:00
Stephen White
ef2dc90172 Dawn: update for GrGpuCommandBuffer -> GrOpsRenderPass change.
Change-Id: Ifbe4bcd40bcf316868d23c2edf73b2371c6cb312
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237119
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-26 20:05:55 +00:00
Mike Klein
a2931beb4b remove MSRTC bots and GN support
We've failed to get these bots to report where issues happen
any more finely than the name of the executable, which makes
them a real pain to fix when they go red.

We don't expect we'll be able to run cleanly in this mode for
long without bots enforcing it, so remove support from GN too.

Change-Id: Ie86f0cbf2f5f859ac2ddb869da7e5b8d31b33fa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237195
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-26 17:49:28 +00:00
Florin Malita
922e2254b1 Add a colortype conversion bench
curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
  46/46  MB	4	65.4µs	65.5µs	67.1µs	75.5µs	5%	█▅▁▁▁▁▁▁▁▁	nonrendering	ctconvert_4_4_readpixels
  46/46  MB	3	80.4µs	80.7µs	82.2µs	93.8µs	5%	█▁▁▁▂▁▁▁▁▁	nonrendering	ctconvert_4_4_drawbitmap
  46/46  MB	3	76.5µs	76.6µs	80.5µs	93.4µs	8%	▇▁▁▁▁▁█▄▁▂	nonrendering	ctconvert_4_6_readpixels
  46/46  MB	2	155µs	155µs	157µs	174µs	4%	█▁▁▁▁▁▁▁▁▁	nonrendering	ctconvert_4_6_drawbitmap

Change-Id: Ib53f76a289ee101a85054d773cadcea475baf280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237141
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-08-26 15:41:54 +00:00
Greg Daniel
2d41d0d363 Remove GrGpuTextureCommandBuffer class and rename to GrOpsRenderPass.
Change-Id: Ia6e666a7bb986bb3dc769d25919580bca17b4748
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236556
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 15:34:14 +00:00
Stephen White
b7eaedcfcc Dawn: implement a ring buffer for uniform uploads.
GrDawnGpu vends ring buffer slices out of a persistent (larger) buffer.

GrDawnProgramDataManager::setData() now returns a BindGroup containing
the (possibly new) UBO bindings, as well as the texture and sampler
bindings.
Change-Id: Id6694d6f44a815cfbffe4293779bf9bf558a2365
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235866
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-23 17:42:47 +00:00
Greg Daniel
f41b2bd449 Reland "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
This reverts commit f21bf9e50b.

Reason for revert: relanding with infra fix

Original change's description:
> Revert "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
>
> This reverts commit 2a5954140b.
>
> Reason for revert: breaking everything
>
> Original change's description:
> > Merge GrOpList and GrRTOpList and rename to GrOpsTask.
> >
> > Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I27840ea0343e8e6b388556afb7bd2e76386d611d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236349
> 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: Ibd3a06e4a91dbb1f225dcc8d17d0db3967b6f85f
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236350
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-22 20:52:09 +00:00
Greg Daniel
f21bf9e50b Revert "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
This reverts commit 2a5954140b.

Reason for revert: breaking everything

Original change's description:
> Merge GrOpList and GrRTOpList and rename to GrOpsTask.
> 
> Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I27840ea0343e8e6b388556afb7bd2e76386d611d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236349
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-22 20:12:38 +00:00
Greg Daniel
2a5954140b Merge GrOpList and GrRTOpList and rename to GrOpsTask.
Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-22 19:33:01 +00:00
Greg Daniel
5abfff229c Delete unused GrTextureOpList.
In a follow up CL I will be merging GrRenderTargetOpList and GrOpList
since we no longer have need for that separation.

Change-Id: I267ead3beeceaece504968ca69165c425d38f761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-22 18:06:22 +00:00
Greg Daniel
e227fe4e53 Move CopyOps to CopyRenderTask.
This also means copies are no longer part of OpList or GpuCommandBuffer.

Change-Id: I234de2c93ca13e069d7e4423a3c8b292be2eb500
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235831
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-21 18:22:23 +00:00
Robert Phillips
e1efd38cf0 Remove GrPendingIOResource
AFAICT these three remaining uses of GrPendingIOResource were just real-ref placeholders (i.e., they just added 1 pending read and then held on to the GrPendingIOResource until object destruction).

Change-Id: Iba6bb199477d846d079999f09794422e240c675a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235458
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-21 17:29:43 +00:00
Greg Daniel
bbfec9db84 Move transferFrom commands from GrOp and into GrRenderTask.
These Ops don't need to go through the GrGpuCommandBuffer.

Change-Id: Ifa9c7d801c97c225989d2542709c89f36ddfdc5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235799
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-20 15:23:03 +00:00
Hal Canary
82e3afa99d SkQP: split make_apk script into create_apk and make_apk
gn_to_bp:  wrap defines in ifndef

create_apk.py assumes you are either run from the aosp tree, or you are
being run from make_universal_apk.py, which now defers to create_apk.py
for all functionality, even argument parsing.

tools/skqp/generate_gn_args moved some functionity into skqp_gn_args.py,
which is now used by create_apk.py

create_apk now accepts android sdk license for you.

create_apk and make_universal_apk.py now are better about cleaning up
after exceptions happen.

Old script make_apk.sh now just points at make_universal_apk.py

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP,Test-Debian9-Clang-NUC7i5BNK-CPU-Emulator-x86-devrel-All-Android_SKQP

Change-Id: I2dba20ef7017987cabb2bd49f070e2b1594785d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235678
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-20 15:08:03 +00:00
Herb Derby
82963a3c97 Remove SkRemoteGlyphCacheImpl.h
Move everything to SkRemoteGlyphCache.cpp. Add a call
to SkStrikeServer (AddGlyphForTest), to make tests work.
* Misc cleanups

Change-Id: I22bea686838f60cf96d097e1ea025cb5399903e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235096
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-15 21:20:09 +00:00
Michael Ludwig
d18c98cd86 Move Context into separate header/namespace
The new namespace 'skif' will contain many more types down the road
to help with image filter implementations. Too many to make inner
classes like Context was, but once the namespace exists, it doesn't
make sense for Context to be the only inner class.

Bug: skia:9282
Change-Id: I4ed76bd5f6c8f0b8ca2f2e1c5d76006c7cccf91e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234581
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-15 20:08:29 +00:00
Brian Salomon
9c73e3df83 Turn off -Wreturn-std-move-in-c++11
Change-Id: I127c979670c3dc7dac2e35908a795afbdefca8f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234902
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-15 17:45:58 +00:00
Brian Salomon
096b091874 Make GrBlend.h private
Change-Id: I77f3dbc80d85d3a19e8986dae42450ee5b8c07a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234668
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-15 13:34:57 +00:00
Brian Salomon
201cdbb646 Make GrSamplerState.h and GrRenderTarget.h private
Change-Id: Id7a270f5a528e1a4a6d94474fa092545252753b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234667
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-15 12:22:11 +00:00
Stephen White
9d4219229b First implementation of GrTextureRenderTarget.
Change-Id: I0e6bc516eb43e7f7062f9d19e7ef8093324b551d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233997
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-14 20:11:03 +00:00
Stephen White
0850dcdb2e First implementation of GrDawnTexture.
Change-Id: I9c636c939dffbb0b395f3e9ed3d9a55784a6d390
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233981
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-14 19:03:37 +00:00
Ben Wagner
6cb6a07116 Use COM_DECLSPEC_NOTHROW STDMETHODIMP
Use STDMETHODIMP because it's the right thing to do, use
COM_DECLSPEC_NOTHROW because STDMETHOD uses it but STDMETHODIMP does
not, leading to warnings from clang and maybe also from msvc, see
https://developercommunity.visualstudio.com/content/problem/325764/msvc-1582-generates-warning-c4986-in-atl-header-fi.html

This also removes SkBlockComRef, since even WRL has abandoned the
similar RemoveIUnknown. These classes were helpful in the transition to
using smart pointers, but are incompatible with final implementations.

Change-Id: I53a618ee629af638d9d8625ccd5acb0db6529950
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233988
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-14 17:14:03 +00:00
Chris Dalton
3d77027d26 Reland "Initiate regeneration of mipmaps from proxy DAG land"
This is a reland of fe19203eb7

Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
> 
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
> 
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Change-Id: Ic904d0b1bcb451bcb74cfae2204fb7297eaff108
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234016
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-14 16:01:31 +00:00
Brian Salomon
2c59659821 Make GrRectBlurEffect be analytical rather than use a texture LUT.
The math isn't that complex and the existing code has intergralization of
the profile size that makes getting the texture coords correct tricky
(and currently wrong).


Bug: skia:9319
Change-Id: Ic928737ce4c40d28ee0696c3628e914f35ffe371
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233985
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-14 13:35:37 +00:00
Ben Wagner
fd91d20a46 [gn] Don't use cc_wrapper for link steps
I'm aware of two uses for cc_wrapper:
 - Goma support for linking is experimental, and normally just falls
   back to the local compiler.
 - ccache site says it always falls back to the real compiler for
   linking. https://ccache.dev/

The msvc toolchain already does not use cc_wrapper for linking; this
change removes it for gcc_like_toolchain. This matches Chromium, e.g.
2cde7f21ab/build/toolchain/gcc_toolchain.gni (221)

Change-Id: I7199c23343233a2435e4d28e7269f67efac36d72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234316
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-13 16:15:48 +00:00
Mike Klein
f815301b1a add GM for skbug.com/9331
Release and debug builds draw differently on my machine,
and if I tack #pragma clang optimize off onto cull_rect()
in SkDashPath.cpp, they both draw like a debug build.

I'm not very familiar with this code, so it may help my
diagnosis to see what other bots draw.

Bug: skia:9331
Change-Id: I1798503c0e5956ec767d8e0021ccca7a1d2a8ac3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233999
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-12 19:32:40 +00:00
Sergey Ulanov
2739fd2f09 Reland: Enable YCbCr sampler support on platforms other than Android
Previously YCbCr Vulkan samplers were supported only on Android for
external images, while Vulkan requires YCbCr sampler for I420 YUV image
formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
This CL:
 - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
   VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
 - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
   fExternalFormat=0.
 - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
   have ycbcr info.

Bug: chromium:981022
Change-Id: Id4d81b20d9fda4d9ad0831f77e6025eed3db2bfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233776
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
2019-08-12 14:21:01 +00:00
Robert Phillips
3e7fa79f2c Revert "Initiate regeneration of mipmaps from proxy DAG land"
This reverts commit fe19203eb7.

Reason for revert: Turned a lot of bots red

Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
> 
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
> 
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Iaa8391b8fbd5a4f851ca41834c1dfeee4be6fedd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-10 13:00:33 +00:00
Chris Dalton
fe19203eb7 Initiate regeneration of mipmaps from proxy DAG land
This allows us to resolve all the textures before executing a command
buffer, rather than interrupting execution as is currently done in the
GL backend.

Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-10 00:39:50 +00:00
Stephen White
f813ef7d1b Dawn backend: implement stencil, primitive topology, separate blends.
Remove beginDraw()/endDraw() in favour of applyState().
This allows for varying primitive topology between meshes in a single

draw: call applyState() prior to drawing each mesh in case the
primitive type changed.
Initial support for onClear() and onClearStencil() in GrNXTGpuRTCommandBuffer.
Modify beginRenderPass() to take the LoadOps for color and stencil, so we
can encode render passes for stencil operations.
Add support for reverse-subtract blend equation.
Also apply options overrides in caps initialization.
Change-Id: I8547961c414187dbc763a67d6c7ec4383d6ce6f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-09 21:20:10 +00:00
Greg Daniel
9fc5e8da98 Revert "Enable YCbCr sampler support on platforms other than Android"
This reverts commit cc4573dfed.

Reason for revert: Seems to be crashing in Win Intel vulkan bots

Original change's description:
> Enable YCbCr sampler support on platforms other than Android
> 
> Previously YCbCr Vulkan samplers were supported only on Android for
> external images, while Vulkan requires YCbCr sampler for I420 YUV image
> formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
> VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
> This CL:
>  - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
>    VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
>  - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
>    fExternalFormat=0.
>  - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
>    have ycbcr info.
> 
> Bug: chromium:981022
> Change-Id: I3989f72e918a257a081b81ae20429a6771229ad6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230918
> Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,sergeyu@chromium.org

Change-Id: Ia9c229fbec4cd397fb04304753fa49f34336ed3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:981022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233563
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-09 19:09:05 +00:00
Sergey Ulanov
cc4573dfed Enable YCbCr sampler support on platforms other than Android
Previously YCbCr Vulkan samplers were supported only on Android for
external images, while Vulkan requires YCbCr sampler for I420 YUV image
formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
This CL:
 - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
   VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
 - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
   fExternalFormat=0.
 - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
   have ycbcr info.

Bug: chromium:981022
Change-Id: I3989f72e918a257a081b81ae20429a6771229ad6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230918
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-09 18:01:13 +00:00
Mike Klein
639fce9060 Revert "add a stub for running fiddles as GMs"
This reverts commit adfc22df86.

Reason for revert: breaks building DM in Android, probably Google3 too.  Shame.

Original change's description:
> add a stub for running fiddles as GMs
> 
> This is about the 15th time I've hacked this up.
> 
> Change-Id: I0c75c0d04133d867e942c39eba693fd7227ba0f5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233240
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I56207630eeba4fb411111fd40e6bc532cef39407
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233241
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-09 15:40:52 +00:00
Robert Phillips
702b37b965 Add unit test to prevent future memory regressions
Bug: b/138674523
Change-Id: Ie4e37763ca68c7fcfa2f78cfa3c85a21bb863f77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233558
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-09 15:39:01 +00:00
Stephen White
d67c71fc7b Dawn backend: first triangle.
Nothing is cached in this initial version; all the magic happens in
GrDawnGpuRTCommandBuffer::beginDraw(). It builds the program,
sets the uniform data, converts the vertex attributes, initializes
rasterization state and blend state, creates a pipeline and bind group
and sets them.
send[Indexed]InstancedMeshToGpu() encodes the Dawn draw commands.
GrDawnGpuProgramBuilder::beginRenderPass() then finishes
the command encoder and submits the resulting command buffer.

Change-Id: Ie9c160cd18a2c4ef1bde66f86a52227e3bf1b570
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230457
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-09 15:30:51 +00:00
Mike Klein
adfc22df86 add a stub for running fiddles as GMs
This is about the 15th time I've hacked this up.

Change-Id: I0c75c0d04133d867e942c39eba693fd7227ba0f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233240
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-09 14:38:10 +00:00
Jim Van Verth
220988189b Add adjustable max size for Metal dynamic allocation ring buffer.
Maximum ring buffer size is based on the maxBufferLength of
the system. Also includes a sample for testing upload pressure.

Bug: skia:8243
Change-Id: I36863b725ba9cbcb02d575b2ab9695d186fcd529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232759
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-08-07 15:59:42 +00:00
Ben Wagner
ab961e9db1 Use MD instead of MMD for compile dependencies.
The current use of MMD appears to ignore all includes which are resolved
from pointy bracket includes or system paths. This can lead to very
interesting incomplete rebuilds (or no rebuild at all) when updating
third_party headers or when the system headers are updated. The use of
MD makes the build depend on all the headers transitively included no
matter how they were included. This greatly increases the dependencies,
but only so much as to make them correct (barring the ever difficult
issue of a file being created with the same name earlier in the search
path).

Change-Id: I852e617f23b4ff0c5b4eb3068455428c9568e078
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232762
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-06 21:18:01 +00:00
Chris Dalton
08755129a1 Add a GrTextureResolveManager class
Adds a GrTextureResolveManager class and plumbs it through calls to
generate the drawing manager's dependency DAG. This new class is
currently unimplemented, but it wraps GrDrawingManager and will
eventually give limited access to functionality for making new tasks
that regenerate mipmaps and/or resolve MSAA. We will use this object
to move mipmap generation up to the DAG/proxy level.

Bug: skia:
Change-Id: Ie1deef21e7ae579a0262f2eeb93d451f0740d823
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232633
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-06 20:47:31 +00:00
Mike Reed
560e9178bd specialize drawAtlas for raster backend
2x faster than calling drawVertices as the impl.

Lots more to do in future CLs
- much of the time is spent in malloc, as we cons-up private shaders.
  we *could* create a private shader and wack its data for each draw
  (breaking the immutable contract, but that may be ok for a raster-only
  internal-use shader...)
- also spend time building the pipeline for each draw, even though
  all that has changed is a color payload (and the ctm). A custome
  stage(s) that exposed its private data could be reused with new
  data...

Bug: skia:
Change-Id: I0ff15155e37c0af7931abd34c0883701a47a048a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203168
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-05 21:01:47 +00:00
Chris Dalton
6b49810f98 Extract a GrRenderTask base class from GrOpList
This is a more abstract representation of something that can
participate in the DAG by modifying a GrSurfaceProxy's pixels. This
will serve as the direct base class for future DAG participants that
aren't opLists, and help to eventually remove GrTextureOpList.

Bug: skia:
Change-Id: Ia903c0188e0f6a6602781b90ee8da87ba3cc13f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231277
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-02 16:56:09 +00:00
Stephen White
bb6bed1d07 First implementation of GrDawnProgramBuilder.
Conversion of SkSL to (Dawn-friendly) SPIR-V.
Conversion of GlBlendCoeff -> dawn::BlendFactor.
Conversion of GlBlendEquation -> dawn::BlendOperation.
Creation of dawn::ColorState from color format, write mask, blend state.
Building of basic BindGroupLayouts and BindGroups (the equivalent of
Vulkan's DescriptorSets).
Handling the RTAdjustment uniform, which handles the viewing transform.

Change-Id: If8aef19d71f81bc805defcf5fd7c4ebe3b9547db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231177
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-08-02 14:25:00 +00:00
Michael Ludwig
06eacf44d5 Add new SkImageFilters factory API
In preparation for moving the filter-specific headers from include/effects and into src/effects/imagefilters, this exposes a more convenient API where all filters provided by Skia are accessible from the same factory.

It also only exposes the factories that take the shared enums (SkColorChannel, SkTileMode), so the per-filter enums can be phased out (SkBlurImageFilter::TileMode, etc.). It also accepts an SkIRect* instead of an SkImageFilter::CropRect* since all uses seem to be for integer rectangles and flags are either always on or always off. This will allow us to later remove the CropRect type.

Bug: skia:9280
Change-Id: I71f77ff44b573f87b837d6523b9eb565521f0f36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230876
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-02 13:33:35 +00:00
Mike Klein
0e00816875 sketch SkVMBlitter
I'm having a hard time implementing SkRasterPipeline with SkVM,
so maybe it makes sense to try stepping over it instead?

Have not done much timing, except that it's noticeably slower
to generate GMs with this blitter turned on than turned off:
use of uniforms is forcing us into the interpreter.

I decided to start off with a perfect div255()... I'm curious to
see if we can live with perfect instead of an approximation.

Change-Id: I752f4a32ebe32ca550c9762aaad9ad86670b79d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231117
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-08-01 22:22:03 +00:00
Mike Reed
64acf4f7cf remove unneeded bitmapprovider abstraction
Change-Id: Idd413389bb0828a6fc73b7285b4ed7b6fe48af6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231638
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-01 21:24:02 +00:00
Robert Phillips
ffe27290ff Add GrCaps::getTestingCombinations
This will decrease our reliance on GrPixelConfig for testing.

Bug: skia:6718
Change-Id: I951f57cce229792d994391dbba74dd206bbfb923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230893
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-01 14:46:36 +00:00
Stephen White
79b81c9b47 First implementation of GrDawnProgramDataManager.
Also add GrDawnCaps to friends of GrShaderCaps, as the other backends do.

Change-Id: Iae60cae7168ad9194f7808c2f51f41de10e53071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230747
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-31 20:28:46 +00:00
Stephen White
83d8a949ae First implementation of GrDawnVaryingHandler.
Change-Id: I49a233a28d16622b286ffc4150446b33f899a891
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230557
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-07-31 19:55:57 +00:00
Stephen White
4da34bf747 First implementation of GrDawnUniformHandler.
Change-Id: I76824eca6e72505004b4dfb03fc35c2849176ecb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230459
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-30 14:40:38 +00:00
Mike Reed
9dc0b9e2f8 remove code now that loopers are dead (w.r.t. canvas and paint)
We can't remove the loopers themselves, as they are still used
by android and chrome (they just don't ever pass them to skia).

Eventually each of those clients will resolve this, but for now
we just keep the classes (and tests) in skia.

Bug: skia:4783
Change-Id: I5f507e6bb82280f2bc7c0b21eebe59c287aa9265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230579
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 12:49:28 +00:00
Chris Dalton
07931aaeaa Rename labrynth.cpp -> labyrinth.cpp
Bug: skia:
Change-Id: I80b09b2ffd7615e486315d715d3d28d06764658a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229759
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-29 22:16:29 +00:00
Stephen White
5048a6a756 First draft of GrDawnBuffer.
This first implementation calls SetSubData() to upload, and simply
uses malloc'ed buffers for onMap()/onUnmap().

Change-Id: I433b4b094a77fbfe1a21447127795b46fdfb9803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230458
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-29 21:34:27 +00:00
Greg Daniel
eecc687376 Remove need for GrVkPipelineLayout class.
Change-Id: Ib37cc549bfd52a5fb3f1f8ef76d0117ed2a1f43d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230419
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-29 19:32:38 +00:00
Chris Dalton
db5210fbab Add a gm for the labyrinth bug
Bug: chromium:913223
Change-Id: I1e229af7fbc61f316fccdc4c7ece27de5932be60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229479
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-07-24 17:23:15 +00:00
Chris Dalton
c3318f09cd ccpr: Add an MSAA atlas mode
Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.

Bug: skia:
Change-Id: I9fb76d17895ae25208124f6c27e37977ac31b5eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227428
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-19 20:52:17 +00:00
Stephen White
985741a554 First draft of Dawn backend: clears are working.
First draft of (mostly stubbed-out) GrDawnGpu.
Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
First draft of DawnTestContext.
First draft of psuedo-fences for Dawn, implemented with MapReadAsync.

Change-Id: I443f3370522639e82f2fa0eebe6b206c372f13a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228137
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-18 18:09:12 +00:00
Michael Ludwig
43c6da2a15 First pass at ImageFilter DAG visualizer sample
Change-Id: I04493af0a6ce1425c4acf68365135722dd3c218b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227857
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-17 20:59:37 +00:00
Greg Daniel
fad9fbc3c4 Revert "First draft of Dawn backend: clears are working."
This reverts commit 6cebea42a8.

Reason for revert: breaking google3 roll

Original change's description:
> First draft of Dawn backend: clears are working.
> 
> First draft of (mostly stubbed-out) GrDawnGpu.
> Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
> First draft of DawnTestContext.
> First draft of psuedo-fences for Dawn, implemented with MapReadAsync.
> 
> Change-Id: Id009436f4441f26ffbc82d485d7af3a499b3281b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226857
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org

Change-Id: Ie494b5a403e8537c6539551533ae8b9156e90a61
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228120
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 17:23:02 +00:00
Stephen White
6cebea42a8 First draft of Dawn backend: clears are working.
First draft of (mostly stubbed-out) GrDawnGpu.
Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
First draft of DawnTestContext.
First draft of psuedo-fences for Dawn, implemented with MapReadAsync.

Change-Id: Id009436f4441f26ffbc82d485d7af3a499b3281b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226857
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-17 16:29:22 +00:00
Hal Canary
e574f1e409 [reland] SkMetaData: move from src/ to tools/
Original: https://skia-review.googlesource.com/c/skia/+/227436
Change-Id: Iec326027319f39b0402e1b5c03b327cb26249159
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227778
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-17 13:14:38 +00:00
Greg Daniel
12e7585495 Revert "SkMetaData: move from src/ to tools/"
This reverts commit 9d844d8ce5.

Reason for revert: breaking google3

Original change's description:
> SkMetaData: move from src/ to tools/
> 
> Change-Id: If581c8ceeaa76985535cb7b6772742f0011cfe8e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227436
> 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>

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

Change-Id: Ifadad46f0663b743d3e57bb6317707f2a2fac07d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227636
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-16 00:28:44 +00:00
Hal Canary
9d844d8ce5 SkMetaData: move from src/ to tools/
Change-Id: If581c8ceeaa76985535cb7b6772742f0011cfe8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227436
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-07-15 18:45:09 +00:00
Brian Salomon
4ce6989332 Fix building Metal backend with CMake
Change-Id: Ica940030367327cb2e35f90b1cc6b4202d4f3422
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227062
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-13 03:05:11 +00:00
Mike Reed
bae6169435 Revert "Revert "reimpl parts of arctTo using doubles to handle shallow angles""
This reverts commit bc525d65a1.

Change-Id: I92550317784be4084412d855cf475b77cd36d6da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227059
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-12 15:29:55 +00:00
Hal Canary
f72728e3f1 documentation/build, BUILDCONFIG: Visual Studio Build Tools 2019
deprecate 2015

Docs-Preview: https://skia.org/?cl=226502
Change-Id: I32cd75937ebdc774138499c4cd79c1eda29bd0f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226502
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-12 14:17:16 +00:00
Florin Malita
bc525d65a1 Revert "reimpl parts of arctTo using doubles to handle shallow angles"
This reverts commit 1ec17042ff.

Reason for revert: *SAN bots + G3 roller breakage

Original change's description:
> reimpl parts of arctTo using doubles to handle shallow angles
> 
> Bug: 982968
> Change-Id: Ieaf70a406265876655447bd0584717063483808f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226847
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: If27d78b5d01815ded5354922ef6e2e4eb92f7a3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 982968
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227056
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-07-12 12:21:46 +00:00
Mike Reed
1ec17042ff reimpl parts of arctTo using doubles to handle shallow angles
Bug: 982968
Change-Id: Ieaf70a406265876655447bd0584717063483808f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226847
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-11 20:58:44 +00:00
Robert Phillips
a5e78be278 Make Mock GrBackendFormat use GrColorType (instead of GrPixelConfig)
The switch to GrColorType does mean that we can no longer represent compressed backend formats in the Mock backend surfaces.

This will require a Chrome CL before it can land in Skia.

TBR=bsalomon@google.com
Change-Id: Ie4e2d4826f960664a21d3de79933eb1cb5d06896
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225538
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-09 17:43:14 +00:00
Hal Canary
a1e88e7fb3 Sample/Lines remove boring sample
Change-Id: I8d266641d283af298a5d44b2889d4fdd4173aeee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225722
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 19:09:43 +00:00
Hal Canary
8010c17dc1 SamplePdfFileViewer: delete dead code
Change-Id: I4ba5f22e4370665699546c82f0948a14f9396526
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225543
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-03 20:15:44 +00:00
Mike Klein
5b52c52141 simplify Android NDK build config
If you just use the right compiler driver wrapper, recent NDKs automate
lots of the stuff we used to have to do ourselves.

Simplifying further, bump baseline ndk_api from 16 (Jellybean) on 32-bit
machines and 21 (Lollipop) on 64-bit to 21 across the board.  This makes
using libc++ a lot easier, as it hooks into a bunch of APIs that were
added in 18 and 21.  There's probably some way to work around this, but
the easiest thing is to just roll up.

Tested building {x86,arm}x{32,64} from a Linux host,
   and running  {    arm}x{32,64}.

Kind of flailing around in later CLs trying to get linking not to hang
on Windows.  I figure it's got something to do with lld?

Cq-Include-Trybots: skia.primary:Build-Win-Clang-arm64-Release-Android
Change-Id: I340b06fb9d372281146679d932417aaba3196045
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225506
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-07-03 18:47:11 +00:00
Mike Klein
febc162c78 ndk r20 compat.
Something's trying to link libc++.so by default,
so ask it to link libc++.a with -static-libstdc++.

Either way, the linker can't find libc++ without
adding another library directory path.

I think both changes should be harmlessly ignored
before r20.

Change-Id: I5b67e1dcb8b40548dae5a8300151e4392ae551f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225436
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-03 02:14:18 +00:00
Michael Ludwig
425eb45435 Reland "Replace GrQuadList with variable-length quad buffer"
This reverts commit 19628ec144.

Reason for revert: fixed struct size on 32-bit iOS

Original change's description:
> Revert "Replace GrQuadList with variable-length quad buffer"
> 
> This reverts commit f281604429.
> 
> Reason for revert: Breaking G3 and iOS Build
> 
> Original change's description:
> > Replace GrQuadList with variable-length quad buffer
> > 
> > Change-Id: I5cc391e8d143032893511695961f5251f40e8291
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223803
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,michaelludwig@google.com
> 
> Change-Id: I55947c068c6472c301952e33cbc36d04505f9800
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223993
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I7522270d467faf0f4e777831e9186bad010409ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224184
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-27 14:58:09 +00:00
Brian Salomon
19628ec144 Revert "Replace GrQuadList with variable-length quad buffer"
This reverts commit f281604429.

Reason for revert: Breaking G3 and iOS Build

Original change's description:
> Replace GrQuadList with variable-length quad buffer
> 
> Change-Id: I5cc391e8d143032893511695961f5251f40e8291
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223803
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I55947c068c6472c301952e33cbc36d04505f9800
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223993
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-27 01:02:03 +00:00
Michael Ludwig
f281604429 Replace GrQuadList with variable-length quad buffer
Change-Id: I5cc391e8d143032893511695961f5251f40e8291
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223803
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-26 19:53:42 +00:00
Nathaniel Nifong
0c4fbf1bbb Include sharing proc in skia static library when building for android.
So it can be used for SKP serialization.

Bug: 9203
Change-Id: I094d5222f220bb79c7f61fd5ebebf48e23e97b0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223705
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-06-25 20:37:53 +00:00
Emircan Uysaler
23ca4e7dc5 Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.

Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 16:04:00 +00:00
Nathaniel Nifong
0426c38daa Reland "Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger."
This is a reland of 7635013ad1

Original change's description:
> Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger.
> 
> Change-Id: I73affae3cd05a2aa6ac1c75c8e049d352bbf3a85
> Bug: 9176
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217135
> Commit-Queue: Nathaniel Nifong <nifong@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

Bug: 9176
Change-Id: Ifef1ff45ac0013ba3015f88c7ecd75527b28b604
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222505
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-06-21 15:49:21 +00:00
Florin Malita
c7a773b6fa Add SkShaderMaskFilter.h to public header list
Change-Id: I53a927e743d908ed5ce136a0f9eb9887753e1317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222779
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-06-21 14:40:25 +00:00
Brian Salomon
384981be3d Revert "Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger."
This reverts commit 7635013ad1.

Reason for revert: breaking bots 

Original change's description:
> Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger.
> 
> Change-Id: I73affae3cd05a2aa6ac1c75c8e049d352bbf3a85
> Bug: 9176
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217135
> Commit-Queue: Nathaniel Nifong <nifong@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

TBR=djsollen@google.com,mtklein@google.com,kjlubick@google.com,reed@google.com,nifong@google.com

Change-Id: Ie5e5dac46ba1beeb8de0a29c1a7be1264616fe92
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 9176
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222502
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-20 18:52:01 +00:00
Nathaniel Nifong
7635013ad1 Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger.
Change-Id: I73affae3cd05a2aa6ac1c75c8e049d352bbf3a85
Bug: 9176
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217135
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-06-20 17:33:04 +00:00
Mike Reed
3fd3cc94c3 runtime shaders
This extends the runStriped to all for return data.
GPU impl not done yet, will be done in a follow-on CL.

Change-Id: Ib107d2945f6fdb34ce1b5405a6c88a5ae7e9f7ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221539
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-06-20 17:11:05 +00:00
Mike Klein
13daa4f305 no -ffoo-sections on Darwin
-dead_strip works just fine there without those flags,
and they interfere with embedded bitcode.

Change-Id: If3766d245334fd9fa275e90fe67216ababafcecb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222450
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-20 15:35:54 +00:00
Robert Phillips
b520476ee6 Swap GrSurfaceProxy over to being held via sk_sp
This CL:
   replaces GrProxyRef with sk_sp
   streamlines GrIORefProxy to be more like SkRefCntBase (i.e., move the fTarget pointer to GrSurfaceProxy)

Change-Id: I17d515100bb2d9104eed64269bd3bf75c1ebbbb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221997
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-20 11:43:45 +00:00
Michael Ludwig
613282042d Reland "Consolidate quad optimizations into single internal function."
This reverts commit 7694b90eb0.

Reason for revert: suppression: https://chromium-review.googlesource.com/c/chromium/src/+/1666472
Original change's description:
> Revert "Consolidate quad optimizations into single internal function."
>
> This reverts commit 646616a78f.
>
> Reason for revert: Suspected as cause of layout test changes.
>
> Original change's description:
> > Consolidate quad optimizations into single internal function.
> >
> > Routes all non-textured quad draws through single internal function
> >
> > Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I0dc6a0d948c0f5e9221ff6c9fbbbbbb9bc3d9bc0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221737
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I4e5d39d603d32b18c48db291fb1650fe33e9ba11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222096
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-06-19 18:26:10 +00:00
Brian Salomon
7694b90eb0 Revert "Consolidate quad optimizations into single internal function."
This reverts commit 646616a78f.

Reason for revert: Suspected as cause of layout test changes.

Original change's description:
> Consolidate quad optimizations into single internal function.
> 
> Routes all non-textured quad draws through single internal function
> 
> Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I0dc6a0d948c0f5e9221ff6c9fbbbbbb9bc3d9bc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221737
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-18 21:00:32 +00:00
Michael Ludwig
646616a78f Consolidate quad optimizations into single internal function.
Routes all non-textured quad draws through single internal function

Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-18 18:20:09 +00:00
Brian Osman
fb32ddf622 Revert "Revert "Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU""
This reverts commit 37a59ef1af.

Change-Id: If38da265ebbb196e72c7d035ba51028438787e2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221541
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 14:47:12 +00:00
Greg Daniel
f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00
Robert Phillips
37a59ef1af Revert "Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU"
This reverts commit 90507286cc.

Reason for revert: Seems to be breaking some builds

Original change's description:
> Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU
> 
> Change-Id: I7236a30040ab532086e68d6e9de2898dd7acaa32
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221098
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: Ie230315a72ebcfae32bc9ce7bafec1f87106cff2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221536
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-18 11:35:18 +00:00
Brian Osman
90507286cc Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU
Change-Id: I7236a30040ab532086e68d6e9de2898dd7acaa32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221098
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-17 21:16:18 +00:00
Brian Salomon
3ec1f54750 Revert "Store GrSwizzle on proxies for texturing and swizzling."
This reverts commit 23093135d1.

Reason for revert: Breaking Google3 :(

Original change's description:
> Store GrSwizzle on proxies for texturing and swizzling.
> 
> Bug: skia: 6718
> Change-Id: I023d7507da9334e984ac8209a32323d616b3d79d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214305
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ie2303ad090f58de07db7b0ac2d42e06e5e5bbcc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221338
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-17 17:55:16 +00:00
Greg Daniel
23093135d1 Store GrSwizzle on proxies for texturing and swizzling.
Bug: skia: 6718
Change-Id: I023d7507da9334e984ac8209a32323d616b3d79d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214305
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-17 17:04:48 +00:00
Brian Osman
e5c1f97de1 Pre-CL so I can prep Chrome for splitting up SkSL sources
Change-Id: Ie4c8e8c5df8f3d37ea49d0c0f7e432e6999b7f0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221243
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-17 14:54:58 +00:00
Brian Osman
08a8496135 Interpreter: Simplify interface quite a bit.
Slightly sharper, but far easier to hold:

- Remove Value union from interface, everything is a 32-bit
  value type, or a collection thereof.
- Collapse to one version of Run (that takes count), and make
  it a member on ByteCode.
- Similarly, move disassemble to ByteCodeFunction.

Change-Id: I07c85e65991178b3f52e20e815c25f36bc9c4257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220753
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-14 16:04:58 +00:00
Stephen White
0c72ed3057 GrTessellator: fix for even/odd fill type and path holes.
When extracting contours for the even/odd fill type, connected holes
in the interior of a shape don't get rendered correctly.

The fix is to extract the subcontours separately from the outer contour.
To do this, we abort contour extraction the first time we re-encounter
the starting vertex.  This causes the hole to be extracted as a
separate contour.

Bug: 908646
Change-Id: I047b77c74605987c40c12a228fd2898c9aa74e55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220776
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-06-13 21:09:45 +00:00
Brian Osman
569f12f0e5 Interpreter: Vectorized interpreter
This converts the SkSL interpreter to operate in SIMT fashion. It handles
all the same features as the previous scalar implementation, but operates
on N lanes at a time. (Currently 8).

It's modeled after GPU and other parallel architectures, using execution
masks to handle control flow, including divergent control-flow.

Change-Id: Ieb38ffe2f55a10f72bdab844c297126fe9bedb6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217122
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-13 15:50:55 +00:00
Brian Salomon
217522c40d Add SkRasterPipeline support for more load/store formats and GrSwizzle.
Adds loads/stores (but not dst loads/gathers) for:
*fp16 single and two channel
*fp32 two channel
*normalized unsigned 8 bit two channel
*normalized unsigned 16 bit single and two channel

TODO: 4 channel unsigned normalized 16 bit.

MISSING: fp32 single channel. No matching current or future GrColorType
planned AFAIK.

Intent is to support all (noncompressed) GrColorType load/stores in
order to implement fallbacks for 3D API limitations on texture uploads
and render target readbacks (some of which require swizzling).

Also, can be used to support YUV<->RGB planar
splitters/joiners on CPU.

Bug: skia:8962
Change-Id: I258d5682a1f4025b31639a97b1a1a02077a2453f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219999
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-11 20:31:02 +00:00
Shachar Langbeheim
db610b3038 third-party.gni: Search includes using -I.
This will ensure that the headers from the dependencies will have
precedent over system headers, thus preventing situations where system
headers will block dependency headers and prevent compilation.

Change-Id: I0d480a6d3898f2da99cf2706c5335aaac05b4e4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220276
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-11 19:04:29 +00:00
Julia Lavrova
a3552c5e6d Reland "SkParagraph"
This is a reland of 10ad0b9b01

Original change's description:
> SkParagraph
>
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I46cf43eae693edf68e45345acd0eb39e04e02bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219863
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-11 17:20:36 +00:00
Herb Derby
07cd38dc13 Revert "SkParagraph"
This reverts commit 10ad0b9b01.

Reason for revert: Breaks google3 build

Original change's description:
> SkParagraph
> 
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=borenet@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com,kjlubick@google.com,reed@google.com,drott@chromium.org,jlavrova@google.com

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

Change-Id: I3f4ef2f34b7489d008c2fe92527d39fba0e16ff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219858
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-10 13:16:53 +00:00
Greg Daniel
46cfbc67f6 Reland "Reland "Remove support for copyAsDraw in gpu copySurface.""
This reverts commit 4c6f9b7670.

Reason for revert: Landing with neuxs 7 and androind one fixes

Original change's description:
> Revert "Reland "Remove support for copyAsDraw in gpu copySurface.""
>
> This reverts commit 84ea04949c.
>
> Reason for revert: nexus 7 and android one broken
>
> Original change's description:
> > Reland "Remove support for copyAsDraw in gpu copySurface."
> >
> > This reverts commit c5167c053b.
> >
> > Reason for revert: fixed
> >
> > Original change's description:
> > > Revert "Remove support for copyAsDraw in gpu copySurface."
> > >
> > > This reverts commit 6565506463.
> > >
> > > Reason for revert: seems to break things?
> > >
> > > Original change's description:
> > > > Remove support for copyAsDraw in gpu copySurface.
> > > >
> > > > The major changes on a higher lever are:
> > > > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > > > takes in a proxy and returns a new one with the data copied to it. This
> > > > is the most common use case within Ganesh.
> > > >
> > > > 2) The backend copy calls no longer do draws, require origins to be the
> > > > same, and won't do any swizzling or adjustment of subrects. They are
> > > > all implemented to be dumb copy this data to this other spot.
> > > >
> > > > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > > > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> > > >
> > > > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > > > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > > > call the priv methods on GrSurfaceContext.
> > > >
> > > > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > >
> > > Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> > > 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: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I310930a9df30535f45a065263a40239141e15562
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219384
> 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: I88df4f19aa26ed77b5af4e25d138387cbabd1934
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219386
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-07 17:38:33 +00:00
Julia Lavrova
10ad0b9b01 SkParagraph
Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-07 17:23:23 +00:00
Ben Wagner
2b4dcd381c Remove duplicate simple samples, make one a gm.
SampleBigBlur is super simple and now covered by gms and AnimBlur
sample.

SampleBigGradient now has a gm shallow_gradient_linear.

SampleConcavePaths has a more complete gm concavepaths.

SamplePoints now has an almost exact gm.

RasterAllocatorSample is made into a gm so that it will be run by d. It
appears to be the only test of SkRasterHandleAllocator, so it should
probably run.

Change-Id: Iad7b99d0f92898fc4b2fdccc5aae35d0277f2fff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219400
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-06-07 01:39:32 +00:00
Greg Daniel
4c6f9b7670 Revert "Reland "Remove support for copyAsDraw in gpu copySurface.""
This reverts commit 84ea04949c.

Reason for revert: nexus 7 and android one broken

Original change's description:
> Reland "Remove support for copyAsDraw in gpu copySurface."
>
> This reverts commit c5167c053b.
>
> Reason for revert: fixed
>
> Original change's description:
> > Revert "Remove support for copyAsDraw in gpu copySurface."
> >
> > This reverts commit 6565506463.
> >
> > Reason for revert: seems to break things?
> >
> > Original change's description:
> > > Remove support for copyAsDraw in gpu copySurface.
> > >
> > > The major changes on a higher lever are:
> > > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > > takes in a proxy and returns a new one with the data copied to it. This
> > > is the most common use case within Ganesh.
> > >
> > > 2) The backend copy calls no longer do draws, require origins to be the
> > > same, and won't do any swizzling or adjustment of subrects. They are
> > > all implemented to be dumb copy this data to this other spot.
> > >
> > > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> > >
> > > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > > call the priv methods on GrSurfaceContext.
> > >
> > > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> >
> > Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> > 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: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
> No-Presubmit: true
> No-Tree-Checks: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I310930a9df30535f45a065263a40239141e15562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219384
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 17:42:02 +00:00
Ethan Nicholas
fc9941665b Major rearchitecture of SkSL parsing, focused on improving performance.
Bug: skia:
Change-Id: I83e3a094d26085fc4d586e5d2581e0d61c55634e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/145080
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-06 14:33:32 +00:00
Greg Daniel
84ea04949c Reland "Remove support for copyAsDraw in gpu copySurface."
This reverts commit c5167c053b.

Reason for revert: fixed

Original change's description:
> Revert "Remove support for copyAsDraw in gpu copySurface."
>
> This reverts commit 6565506463.
>
> Reason for revert: seems to break things?
>
> Original change's description:
> > Remove support for copyAsDraw in gpu copySurface.
> >
> > The major changes on a higher lever are:
> > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > takes in a proxy and returns a new one with the data copied to it. This
> > is the most common use case within Ganesh.
> >
> > 2) The backend copy calls no longer do draws, require origins to be the
> > same, and won't do any swizzling or adjustment of subrects. They are
> > all implemented to be dumb copy this data to this other spot.
> >
> > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> >
> > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > call the priv methods on GrSurfaceContext.
> >
> > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> 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: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 13:56:31 +00:00
Michael Ludwig
0f809020ec Add GrQuadUtils namespace to hold ResolveAAType function
Change-Id: I6357af83b55be8efa8dfd709acde908296c05f82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216605
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-05 23:06:02 +00:00
Chris Dalton
5b5403e75b ccpr: Preserve fill rules for cached paths
Fixes a bug where even-odd fill rule was not being preserved on paths
that were reused from a stashed fp16 coverage count atlas.

Bug: skia:8782
Change-Id: I6698498a6f4c8df8eff10b19beb80e49663a577c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218047
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-06-05 18:24:08 +00:00
Greg Daniel
c5167c053b Revert "Remove support for copyAsDraw in gpu copySurface."
This reverts commit 6565506463.

Reason for revert: seems to break things?

Original change's description:
> Remove support for copyAsDraw in gpu copySurface.
> 
> The major changes on a higher lever are:
> 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> takes in a proxy and returns a new one with the data copied to it. This
> is the most common use case within Ganesh.
> 
> 2) The backend copy calls no longer do draws, require origins to be the
> same, and won't do any swizzling or adjustment of subrects. They are
> all implemented to be dumb copy this data to this other spot.
> 
> 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> 
> 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> call the priv methods on GrSurfaceContext.
> 
> Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-05 17:37:11 +00:00
Greg Daniel
6565506463 Remove support for copyAsDraw in gpu copySurface.
The major changes on a higher lever are:
1) The majority of all copies now go through GrSurfaceProxy::Copy which
takes in a proxy and returns a new one with the data copied to it. This
is the most common use case within Ganesh.

2) The backend copy calls no longer do draws, require origins to be the
same, and won't do any swizzling or adjustment of subrects. They are
all implemented to be dumb copy this data to this other spot.

3) The GrSurfaceContext copy call has now been moved to priv and renamed
copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.

4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
call the priv methods on GrSurfaceContext.

Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-05 17:04:31 +00:00
Brian Salomon
e2826ab59c Add API to invalidate GL texture parameters from GrBackendTexture.
This is modeled on how we coordinate VkImage layout changes between
GrContext and clients.

A type GrGLTextureParameters is used to track the current parameter
state.

When a client creates a GrBackendTexture in order to wrap a resource
they created a new GrGLTextureParameters is created and the wrapped
GrGLTexture will share ownership.

When GrContext creates a non-wrapped GrGLTexture, the GrGLTexture
creates a new GrGLTextureParameters and any GrBackendTextures created
from that GrGLTexture will share ownership.

Clients indicate parameter changes by calling
GrBackendTexture::glTextureParametersModified().

We still assume all texture parameters may have changed after a call
to GrContext::resetContext() (for now). The "timestamp" that is used
to implement this has been moved from GrGpu to GrGLGpu as there were
no other use cases.

Change-Id: Ic24e00488fad254a29d5eec6890278b67df6efae
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217385
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-05 13:50:25 +00:00
Michael Ludwig
d17e05aeda Extract GrQuadList into separate header
Change-Id: I152ea5a40c4cc65ef5250ca575622a25cf6d1d2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216603
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-04 18:08:06 +00:00
Michael Ludwig
663afe501a Move GrPathUtils, GrRect, and GrShape into src/gpu/geometry/
Change-Id: I864d3c2452f3affdc744bf8b11ed3b3e37d6d922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216602
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-04 13:36:05 +00:00
Mike Klein
68c50d015b sketch an skvm
With all the thinking around a stack-based interpreter,
I figured I'd sketch out some ideas for a register VM too.

I kind of have the hunch that this is the direction that
will actually let us replace large amounts of Skia's CPU
backend with an efficient interpreter or JIT.

Change-Id: Ia2b5ba4a3fc27556f5b6ba95cd1ace46d3217403
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216665
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-03 19:53:48 +00:00
Herb Derby
d249e8c95d One ShouldDrawAsPath to rule them all!
In addition, inline all the small functions from
SkFontPriv.cpp.

Change-Id: I9d642aa194a3fc4d7eb451c89314892f591c5d81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217865
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-03 17:30:18 +00:00
Ethan Nicholas
40679c3aa5 added SkSL bench
Bug: skia:
Change-Id: I8497ddbc5c5fef4e0fa87f3b9828034ba34284cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217636
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-06-03 16:01:30 +00:00
Michael Ludwig
fd4f4df3ea Move GrQuad to src/gpu/geometry folder
Change-Id: I3d1b8e8268c2cd0d1ceec93c847069494b9aa965
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216601
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-31 19:56:59 +00:00
Brian Salomon
d6f3f18d51 Color matrix effect rewritten as .fp
Also adds flexibility to unpremul the input, clamp the output, premul the
output or not.

Also fixes SkMatrix44 as a ctype.

The intent is to reuse this for rgb->yuv conversion in async rescale and
read.

Bug: skia:3962
Change-Id: I470d1cfebdbd79d8541b633c1747d510a5549ac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217128
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-31 14:25:05 +00:00
Herb Derby
b3043e4d70 Collapse the SkTextInterceptsIter into base class
Reorganize the glyph Intercepts code to allow bulk operation.
This is just reorganizing and inlining existing code.

+ Shorten some long lines.

Change-Id: I1a01b50d94386279d3a8715a78266ee8a27547b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216606
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-05-30 13:57:38 +00:00
Brian Salomon
cf49b64720 Define SK_GL in Flutter.
Change-Id: Ia4e035be40b712758821727add1fa730b95362c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215828
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-28 13:13:46 +00:00
Jim Van Verth
7730d7cb8f Revert "Change Metal to not take ownership of objects"
This reverts commit 186a295111.

Reason for revert: Metal bots failing

Original change's description:
> Change Metal to not take ownership of objects
> 
> Prior to this change, Skia/Metal interfaces take ownership of the Metal
> objects passed in (that is, the caller should count passing the object
> to Skia as "freeing" the object).
> 
> Change this behavior so that Skia/Metal retains its own separate
> ownership of the Metal objects.
> 
> Make GrBackendTexture and GrBackendRenderTarget maintain their own
> references to the underlying MTLTexture by using the CFRetain/CFRelease
> interfaces. Do this by adding a private GrMtlBackendSurfaceInfo.
> 
> Move GrMtlBackendSurfaceInfo (formerly GrMtlTextureInfo) out of the
> union in GrBackendTexture and GrBackendRenderTarget because unions
> cannot have nontrivial constructors and destructors (how fVkInfo isn't
> causing a compile error is unclear).
> 
> Change-Id: Iae3719c0715825d86503d03c766e47f0f6015bdf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215685
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,ccameron@chromium.org

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

Change-Id: Ie569fe1938857706b5413876a9480ef1eb3314ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216221
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-05-28 03:30:23 +00:00
Christopher Cameron
186a295111 Change Metal to not take ownership of objects
Prior to this change, Skia/Metal interfaces take ownership of the Metal
objects passed in (that is, the caller should count passing the object
to Skia as "freeing" the object).

Change this behavior so that Skia/Metal retains its own separate
ownership of the Metal objects.

Make GrBackendTexture and GrBackendRenderTarget maintain their own
references to the underlying MTLTexture by using the CFRetain/CFRelease
interfaces. Do this by adding a private GrMtlBackendSurfaceInfo.

Move GrMtlBackendSurfaceInfo (formerly GrMtlTextureInfo) out of the
union in GrBackendTexture and GrBackendRenderTarget because unions
cannot have nontrivial constructors and destructors (how fVkInfo isn't
causing a compile error is unclear).

Change-Id: Iae3719c0715825d86503d03c766e47f0f6015bdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215685
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-05-25 01:53:25 +00:00
Mike Reed
6a5f7e29a8 split RGB into YUV planes
Change-Id: Ifd1d010068691e187561a25aff45d8b67ae62c39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215442
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-23 19:57:30 +00:00
Robert Phillips
459b295bed Expand backend allocation API to allow an initialization color (only for GL to start)
Change-Id: I8e676e80f85f14c81c3cec8d766d0fdc7e25f426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214445
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-23 15:11:04 +00:00
Stephen White
c4dbc3758f GrTessellator: improved straight skeleton implementation.
This patch improves the straight skeleton implementation used by
GrTessellator to collapse overlap regions in the alpha gradient border.
The resulting quality improvement can be seen in the
"thinconcavepaths" GM, for example, where the coverage values of
the "thin right angle", "thin rect and triangle" and "skinny snake"
are now lower and match the raster backend more closely. It also improves
correctness, such as on the linked Chromium bugs below.

Previously, the straight skeleton was performed using the same Vertex
and Edge classes used for tessellation, but this led to fragility in
maintaining the connectivity and ordering required by those classes.
Instead, that functionality has been moved to new SSEdge and SSVertex
classes. Their construction results in alternating SSVertex and
SSEdges around the boundary of the each overlap region, shrunk by one
SSEdge as the boundary collapses.

Applying events may now also create further events (chained events),
as intersections between newly-adjacent bisectors change the structure
of the skeleton. This is always calculated from the bisectors of
original boundary, not the shrunk boundary of the straight skeleton,
which is why each SSEdge points at its originating Edge. If the edges
are parallel or near-parallel, the bisector may be infinite. This is
handled by a new flavour of create_event(), which does a Line/Line
intersection (rather than an Edge/Edge intersection) to find the
intersection between the infinite bisector and an adjacent bisector.

Several ancillary bugs were fixed: the priority queue used to represent
edge events was sorting the inner edges incorrectly. These need to be
sorted in descending not ascending order of coverage. Its implementation
was moved from Skia's TDPQueue to std::priority_queue(), which is more
flexible in specifying a comparator.

check_for_intersection()'s partner synthesis code was moved into a new
function, compute_bisector(), also used by the chained skeleton events
code.

Degenerate edges are now removed during the simplify_boundary() pass.
They were previously detected but ignored, causing incorrect inner and
outer tangents to be computed in stroke_boundary().

An fSynthetic flag was added to Vertex, in order to detect vertices
which cannot be moved by an edge collapse event (e.g., intersections
with non-boundary edges, merged vertices, straight skeleton vertices).

More raw implementation notes:
Connect straight skeleton vertices as we find them, so we don't
have to use partnering (ss_connect()).
Only disconnect edges which are still alive after event application.
Add a check for near-parallel lines in compute_bisector().
Don't use edge type to determine direction to offset for bisectors.
The winding should already include this information.
Move Event ownership to SSEdge.
If we're down to the last two edges in a skeleton, don't check for events.
Add concave_arc_and_circle GM.
Add a collapsepaths GM.

Bug: 941429, 913349, 929915, 945853

Change-Id: Ib89e231d0e8611f8735fd3592db6391da096369d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215094
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-22 16:16:59 +00:00
Ben Wagner
729a23f50f Move ccpr headers for display list out of include/private.
This partially undoes 774168efac "Allow
CCPR in DDL mode (take 2)". The issue appears to have been the use of a
not fully defined type (destructor could not be instantiated) because
the private fields were also dllexported, requiring the destructors to
exist in all translation units which included the header. Only the parts
of the class which are actually public are now marked as exported.

Change-Id: I8a79bd5d8962e94c24f7563d496744bb278153fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214020
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-20 14:50:56 +00:00
Mike Klein
a8ceb775c1 Revert "remove SkMiniPicture and co."
This reverts commit 046ecb1b5e.

Reason for revert: Flutter

Original change's description:
> remove SkMiniPicture and co.
> 
> This was an optimization for Chromium that I believe is no longer
> relevant in a world of PaintOpBuffers.
> 
> Change-Id: Ic7526715a0ef1c3cec387a44189b7d56d5107af5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213680
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,reed@google.com,chinmaygarde@google.com

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

Change-Id: Ibf1ccee88c9ea140210cb9258ec96f9841e84c24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-20 13:18:48 +00:00
Brian Salomon
201700fa86 Initial version of rescaling async readback API
This is implemented at backend-neutral level and so misses some
opportunities to reduce the number of passes in the GPU backend.

Filter quality is interpreted as:
none - single nearest neighbor resampling
low - chain of bilinear resamplings. 2x up/down except for one
step which may be smaller than 2x.
medium - same as low
high - when both scale factors are up then same as low but with bicubic
filtering rather than linear. Otherwise, same as low.

Bug: skia:8962

Change-Id: I4467636c14b802d6a0d9b5c363c1ad9e87a1a44b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213831
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-17 16:39:10 +00:00
Robert Phillips
0c6daf034b Direct backend object allocation API
Change-Id: Ie8733a4db8061c67678a41cf239ce4407e967df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212965
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-17 12:14:48 +00:00
Brian Osman
c6568afa0b Remove Nima from DEPS, experiments, Viewer, etc.
Change-Id: Ide69d3c9f0f02e886bd0d52723d425a548edd2e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214187
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-16 17:02:11 +00:00
Ben Wagner
21bca28bda Move SkMessageBus.h into src/core
Not used by anything else in the include directory, probably don't want
to accidentially expose it either.

Change-Id: I50d255e2cac43d8405305a825fd194bb36edd8fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213826
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-15 15:33:48 +00:00
Ben Wagner
8bd6e8f198 Move SkTSearch.h into src.
No public headers are using it anymore, so move it from include/private
into src/core where SkTSearch.cpp resides.

Change-Id: I4499c629487ff1b8c391b44708616d67567a3e9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213674
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-15 14:15:07 +00:00
Ben Wagner
5162a74b0a Remove GpuLayerCacheTest
The gpu code doesn't have a layer cache anymore to test.

Change-Id: Iec931112e5e12c90f2cad0c6012dfd1d0f14ad25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213665
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-05-14 19:28:44 +00:00