Commit Graph

10203 Commits

Author SHA1 Message Date
Leon Scroggins
565f17f29d Reland "Make SkBitmap/SkPixmap::erase* do so in sRGB"
This reverts commit 832c931d5b.

Reason for revert: To confirm whether it was blocking, and update
Chrome if necessary

Bug: skia:8663

Original change's description:
> Revert "Make SkBitmap/SkPixmap::erase* do so in sRGB"
>
> This reverts commit 6f44647e52.
>
> Reason for revert: checking to see if this is blocking the Chrome roll
>
> Original change's description:
> > Make SkBitmap/SkPixmap::erase* do so in sRGB
> >
> > We generally consider untagged colors to be sRGB, so this makes us more
> > consistent with other parts of the API.
> >
> > Add a test.
> >
> > Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> > Change-Id: I5468c86ad92164797a65ffd9fbe471e01a97a2ca
> > Reviewed-on: https://skia-review.googlesource.com/c/179245
> > Commit-Queue: Leon Scroggins <scroggo@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=djsollen@google.com,mtklein@google.com,scroggo@google.com,brianosman@google.com,reed@google.com
>
> Change-Id: Ia592adf2c790d294da1e32c1e83f9f34e81d79cc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Reviewed-on: https://skia-review.googlesource.com/c/182083
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=djsollen@google.com,mtklein@google.com,robertphillips@google.com,scroggo@google.com,brianosman@google.com,reed@google.com

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel;luci.chromium.try:android-kitkat-arm-rel;luci.chromium.try:android-marshmallow-arm64-rel;luci.chromium.try:linux-chromeos-rel;luci.chromium.try:linux_chromium_asan_rel_ng;luci.chromium.try:win7_chromium_rel_ng;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:mac_chromium_rel_ng;luci.chromium.try:linux_chromium_tsan_rel_ng;luci.chromium.try:linux_chromium_rel_ng;

Change-Id: I226fd5b6f298fad648b1d05c8a8e806eac874a46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/182142
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-04-23 20:07:09 +00:00
Chris Dalton
ed6e82796b Add a flag for suppressing tessellation shaders
Change-Id: Ic29618c5eac9b3eed92ce0321162745645240d6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285142
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-23 18:35:48 +00:00
Joe Gregorio
b25f30348b Revert "Move SkFrontBufferedStream into Android-only dir"
This reverts commit 513720f28e.

Reason for revert: Breaking the google3 roll:
   https://sponge.corp.google.com/invocation?tab=Build+Log&id=5f96970b-8171-4c2f-abf3-006e11b8fff9

Original change's description:
> Move SkFrontBufferedStream into Android-only dir
> 
> Bug: skia:10154
> 
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
> 
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.
> 
> Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,scroggo@google.com,reed@google.com

Change-Id: Iaeedaed184cc35f507d5441631ae709e1c5cb1ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10154
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285100
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2020-04-23 18:23:30 +00:00
Leon Scroggins III
513720f28e Move SkFrontBufferedStream into Android-only dir
Bug: skia:10154

Add client_utils for code that is specifically for a single client.
Move SkFrontBufferedStream into its android/ subdir. Rename the class
to android::skia::FrontBufferedStream. Temporarily leave in
SkFrontBufferedStream until Android updates to the new API.

Add a new optional target for client_utils/android. It is built in dev
builds for testing, and when building for the Android framework.

Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-04-23 17:02:18 +00:00
Robert Phillips
6276819023 Allow SkThreadPool to be non-borrowing
The GPU thread has privileged access to the GPU so its work can't be easily borrowed.

Change-Id: I1eae4c86ff1c36cc1248f74fc48d76b1c243f0b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284764
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-23 16:11:28 +00:00
Brian Osman
d8f611dff1 Remove SkCanvasMatrix
Make it more explicit when we're converting between SkMatrix and
SkM44 (in either direction).

The IsScaleTranslate helper could have been static in SkCanvas,
but we're probably going to need it when we start pushing SkM44
down to SkDevice.

Change-Id: Ia013c7f59cdbac78b5a04fdcaafb62a0a626cb53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-21 21:29:54 +00:00
Mike Reed
7d45a7ac9c rm unneeded SK_SUPPORT_LEGACY_DIDCONCAT44
Change-Id: I65cec59749f0e7f5fb13675293720afecffa6a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284321
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-20 20:44:35 +00:00
Robert Phillips
8472a3d01c Update DDL test harness to use backendTextures to back tiles (take 2)
This better matches Chrome's use of DDLs.

With path, image, and text draws stripped out, here is the perf impact of this change:

           before CL   after CL
w/ DDLs      7.792      1.038
w/o DDLs     0.800      0.876

This perf improvement (in the DDL case) is from backend texture wrapping SkSurfaces being created w/o initialization. The prior method of SkSurface creation was resulting in double clearing of all the surfaces.

This perf improvement won't be seen by Chrome since they've always being using wrapped backend texture SkSurfaces.

TBR=bsalomon@google.com

Bug: 1056730
Change-Id: Ic04d322cad96df845e75437211208495862c6555
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283866
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-17 14:39:44 +00:00
Brian Osman
1c61eba304 SkM44: Remove unused determinant & redundant checks in invert
Also warn about unused returns from transpose(), which has different
semantics than the SkMatrix44 version.

Change-Id: I0cf271ee5e020a81ddd696cc269bdada937a841e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-16 20:25:41 +00:00
Mike Reed
b6af407d67 change Overdraw colorfilter to be pure sksl
About same speed on CPU as pipeline-callback

Change-Id: If8769bebb3c51b5ea61fc34d76dde0cfc16b8473
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283871
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 19:15:01 +00:00
Prashant Nevase
7a9c9d66f1 Make SkM44 public.
Make SkM44 public to be used in embedders as SkMatrix44 is deprecated.

Bug: skia: None
Change-Id: I16ac43ec80026f1486bf151aabbd9940698be7ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283836
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Prashant Nevase <prashant.n@samsung.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 11:50:37 +00:00
Mike Reed
938b4532b4 Revert "transition matrix44 to opt-in only"
This reverts commit 0f1f87d7bd.

Reason for revert: google3 and flutter also need the guard

Original change's description:
> transition matrix44 to opt-in only
> 
> In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/
> 
> Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I7c8cf2bc67aa267d442d0ca663e8378aa8feb409
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 10:01:29 +00:00
Mike Reed
0f1f87d7bd transition matrix44 to opt-in only
In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/

Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-15 18:34:26 +00:00
Robert Phillips
9ff1d841f6 Revert "Update DDL test harness to use backendTextures to back tiles"
This reverts commit 7ae9d2fca6.

Reason for revert: Triggering Vulkan Debug layer errors

Original change's description:
> Update DDL test harness to use backendTextures to back tiles
> 
> This better matches Chrome's use of DDLs.
> 
> With path, image, and text draws stripped out, here is the perf impact of this change:
> 
>            before CL   after CL
> w/ DDLs      7.792      1.038
> w/o DDLs     0.800      0.876
> 
> This perf improvement (in the DDL case) is from backend texture wrapping SkSurfaces being created w/o initialization. The prior method of SkSurface creation was resulting in double clearing of all the surfaces.
> 
> This perf improvement won't be seen by Chrome since they've always being using wrapped backend texture SkSurfaces.
> 
> TBR=bsalomon@google.com
> Change-Id: Ice3993ca125fce37804e58c353c265cf659dbe2f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283456
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ife023ede0774ec2cce4c0d6e7708c036347ebf54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283648
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-15 16:22:17 +00:00
Robert Phillips
7ae9d2fca6 Update DDL test harness to use backendTextures to back tiles
This better matches Chrome's use of DDLs.

With path, image, and text draws stripped out, here is the perf impact of this change:

           before CL   after CL
w/ DDLs      7.792      1.038
w/o DDLs     0.800      0.876

This perf improvement (in the DDL case) is from backend texture wrapping SkSurfaces being created w/o initialization. The prior method of SkSurface creation was resulting in double clearing of all the surfaces.

This perf improvement won't be seen by Chrome since they've always being using wrapped backend texture SkSurfaces.

TBR=bsalomon@google.com
Change-Id: Ice3993ca125fce37804e58c353c265cf659dbe2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283456
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-15 16:07:47 +00:00
Brian Osman
d1afef6b18 Support markers (custom matrices) in SkVertices Attributes
Bug: skia:9984
Change-Id: Ie799ffa19304978e2076f9ba790e8a34c1b03adf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283225
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-15 14:30:46 +00:00
Mike Reed
d276e3f009 SkMatrix44 is deprecated: use SkM44 instead
Change-Id: I9a269b9c0c3cda29d06827d016db3a3f963a91fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283504
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-15 13:30:46 +00:00
Mike Reed
14f62de958 SkCamera.h is deprecated
Change-Id: I57bd99f2bddb7ac182f7830245c9d342d2adda62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283430
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-14 16:15:14 +00:00
Mike Reed
eb1d5a2e23 Move markerstack into its own object:
- owned by canvas
- pointed to by devices

Change-Id: Ia5abc60434cd34810ceea09ecab63c6b25eb972e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283436
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-14 13:43:34 +00:00
Greg Daniel
c9624d5c73 Add sample quality to GrD3DTextureResourceInfo.
Change-Id: I3a33d2f80fcb243faec40b13960ea0310723e53e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283356
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-13 21:10:31 +00:00
Jim Van Verth
96bfeff55c More fixes to get D3D tests running.
* Set up D3D backend texture creation
* Fix GrD3DBackendSurfaceInfo initialization
* Minor fix to get wrapped RTs into the cache

Bug: skia:9935
Change-Id: Ic5319a7d059c4d969894529a326a91de0192f9eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282679
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-10 15:19:18 +00:00
Robert Phillips
4d932d170f Move the GrStrikeCache from the recording context to the direct context
This solidifies that the strike cache and, thus, GrStrikes can't be used when recording DDLs.

TBR=bsalomon@google.com
Bug: 1056730
Change-Id: I15ce3ac2c0a9db0f476c03ef855bd14d22551043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282536
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-09 18:47:27 +00:00
Ben Wagner
cc81e202b4 Take MorphologyImageFilter radii as SkScalar.
The morphology image filters work on pixels, so took the radii as
integers. However, these radii will be mapped through the CTM, so any
rounding should happen as late as possible or the effect will be overly
discretized.

Bug: skia:10110
Change-Id: I62ab6c37d0b4612690addc48c9bc473099ac36b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282636
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-09 18:27:17 +00:00
Mike Reed
7fe6ee30c4 Add markCTM(id) api, to replace functionality of saveCamera.
Will need followups on Vertices and SkSL to use these handles.

Change-Id: If775cb01168f601541e889bfa2421129e505b4a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282416
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 17:07:36 +00:00
Brian Osman
68219bfaca Add Usage::kColor to SkVertices custom attributes
Always treated as unpremul, RGB(A) sRGB colors. Automatically
transformed to destination color space, and premuled.

Bug: skia:9984
Change-Id: I78fdb16482f70714a8a8b64a9552e8874d7966fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-08 23:57:27 +00:00
Brian Salomon
dc8fcdb735 Add getter for channels to GrBackendFormat
Bug: skia:10078

Change-Id: I0172a87d836a606a55e60b73ba255a41313e9c12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282266
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-08 19:54:27 +00:00
Greg Daniel
8561fc23c9 Update gpu flush semaphore contract.
From my scanning of clients this should not change how any of our main
users interact with semaphores. The biggest change here is that we don't
give up on submitted all the semaphores if a creation fails. We just
submit the semaphores we do have. It also makes it explicit that the
client is responsible for deleting any initialized semaphore regardless
if we were able to submit the semaphores or not or if the semaphore was
wrapped or created by Skia.

The motivation for this change is to more align the current API with
how things will work when we separate flushing and submit into different
calls.

Bug: skia:10118
Change-Id: I3e8b5d3a9852ddb2b5dc972fee21bf46ded7a36f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282265
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-08 17:30:16 +00:00
Chris Dalton
03fdf6a9a9 Implement support for indirect draws
Change-Id: Ib1c0570d747bf9f46be3486f37eba3af53ed1e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281642
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-04-07 19:41:18 +00:00
Mike Reed
7d08f4b797 remove deprecated concat44 -- use concat
Change-Id: I769a4148b29ef90ffc5f9944013ea2c131146f75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281861
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-07 17:40:17 +00:00
Chris Dalton
a77cdee048 Reland "Rename instanceAttribSupport -> drawInstancedSupport"
This is a reland of 17f05c737e

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
>
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I2e15ac72d86747c30e71bb50d30da48a5a342772
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282118
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 16:54:37 +00:00
Mike Reed
a735ad98db stage changing didCocnat44 virtual
SK_SUPPORT_LEGACY_DIDCONCAT44

Change-Id: Ie208c245d7121fddc693a7d3c5d6866441c27433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281864
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-07 15:50:57 +00:00
Florin Malita
0022f5cf1b [SkTrimPathEffect] Preserve wrap-around continuity
In inverted mode (Mode::kInverted), the trim result represents the
logical segment [stop..start] (wrapping around at the path's end).

We currently emit two segments [0..start] and [stop..1], in that
exact order.  This behavior breaks continuity for single closed
contour paths.

Update SkTrimPath to

1) emit the segments in the correct order ([stop..1],[0..start])

2) skip the connecting moveTo for closed paths

Bug: skia:10107
Change-Id: Icd280554ba7291c985f504793feff104df2a4a99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281882
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-04-07 14:40:17 +00:00
Chris Dalton
31c028c54b Revert "Rename instanceAttribSupport -> drawInstancedSupport"
This reverts commit 17f05c737e.

Reason for revert: chrome

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
> 
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I2b28e3066f27b9d63713f93c0b44d7ba92fcdba9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281868
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:22:37 +00:00
Mike Reed
2f92c93dc7 virtual for saveCamera
Change-Id: Iff486ae8dbf94971cfd513954299e2635c13ef1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281585
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-06 21:31:47 +00:00
Brian Osman
aa9983aec8 Add usage field to SkVertices::Attribute
Bug: skia:9984
Change-Id: I237585fe8c7178f3a0a108afaa02d07fd8e202b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281438
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-06 21:26:17 +00:00
Chris Dalton
17f05c737e Rename instanceAttribSupport -> drawInstancedSupport
Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-06 18:53:57 +00:00
Mike Klein
a9741ee25a first sksl on skvm
Exactly enough implemented to run

    fm --skvm -b cpu -s runtime_shader -w foo

This shader

     0: 0077 load2 0
    10: 00a2 pushimmediate 998277249(0.0039215688593685627)
    22: 0070 dup
    31: 0094 multiplyf2
    40: 0080 loaduniform 2
    50: 00a2 pushimmediate 1065353216(1.0)
    62: 00c1 store4 2
    71: 00b4 return 0

becomes this blitter, including matrix, blending, asserts, etc:

    17 registers, 57 instructions:
    0	r0 = uniform32 arg(0) 4
    1	r0 = to_f32 r0
    2	r1 = splat 3F000000 (0.5)
    3	r0 = add_f32 r0 r1
    4	r2 = uniform32 arg(0) 2C
    5	r3 = uniform32 arg(0) 28
    6	r2 = fma_f32 r0 r3 r2
    7	r3 = uniform32 arg(0) 0
    8	r4 = uniform32 arg(0) 24
    9	r5 = splat 3F800000 (1)
    10	r6 = uniform32 arg(0) 38
    11	r6 = min_f32 r6 r5
    12	r7 = splat 0 (0)
    13	r6 = max_f32 r7 r6
    14	r8 = splat 437F0000 (255)
    15	r9 = mul_f32 r6 r8
    16	r9 = round r9
    17	r10 = splat FF (3.5733111e-43)
    18	r10 = pack r9 r10 8
    19	r9 = splat 3B808081 (0.0039215689)
    20	r11 = uniform32 arg(0) 20
    21	r12 = uniform32 arg(0) 1C
    22	r11 = fma_f32 r0 r12 r11
    23	r12 = uniform32 arg(0) 18
    24	r0 = splat 3F800001 (1.0000001)
    25	r13 = min_f32 r6 r0
    26	r14 = splat B4000000 (-1.1920929e-07)
    27	r13 = max_f32 r14 r13
    28	r13 = eq_f32 r6 r13
    29	assert_true r13 r6
    loop:
    30	    r6 = index
    31	    r6 = sub_i32 r3 r6
    32	    r6 = to_f32 r6
    33	    r6 = add_f32 r6 r1
    34	    r13 = fma_f32 r6 r4 r2
    35	    r13 = mul_f32 r9 r13
    36	    r6 = fma_f32 r6 r12 r11
    37	    r13 = min_f32 r13 r5
    38	    r13 = max_f32 r7 r13
    39	    r15 = mul_f32 r13 r8
    40	    r15 = round r15
    41	    r6 = mul_f32 r9 r6
    42	    r6 = min_f32 r6 r5
    43	    r6 = max_f32 r7 r6
    44	    r16 = mul_f32 r6 r8
    45	    r16 = round r16
    46	    r15 = pack r16 r15 8
    47	    r15 = pack r15 r10 16
    48	    store32 arg(1) r15
    49	    r15 = min_f32 r13 r0
    50	    r15 = max_f32 r14 r15
    51	    r15 = eq_f32 r13 r15
    52	    assert_true r15 r13
    53	    r13 = min_f32 r6 r0
    54	    r13 = max_f32 r14 r13
    55	    r13 = eq_f32 r6 r13
    56	    assert_true r13 r6

And that JITs using 11 ymm registers.

Change-Id: Ib45b5fa6aee427f290b77d8900f10d433ad81133
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281746
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-06 17:32:28 +00:00
Mike Reed
3ef77ddf9e clean up public m44 and camera api
saveCamera() is no longer experimental

In a separate CL, will stage changes to concat virtual to take M44.

Change-Id: Iaf37ce2f24ab1223c54aeb1e79eaebf18f87fece
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281589
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-06 15:34:17 +00:00
Jim Van Verth
04513752fd Remove D3D12X.
Causing flutter roll issues and we don't need it.

Bug: skia:10105
Change-Id: I2f0ec916984b33045fcd1961417b823f97355725
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281717
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2020-04-06 12:02:37 +00:00
Michael Ludwig
e99c56fae7 Use the LICENSE provided by Microsoft
The generic google notice didn't satisfy the dart script.

Tracked down this LICENSE at the root of the D3D12 Library project:
https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/LICENSE

This matches "the MIT" license mentioned in the d3dx12.h header, hopefully
that's enough for the license script to detect a match, w/o needing to
update the script itself.

Bug: skia:10105
Change-Id: I1d4bf52b888a13f6727503024cb8f3e933078542
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281594
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-05 14:56:55 +00:00
Michael Ludwig
a5efd68b52 Add license for include/third_party/d3d
TBR: rmistry@google.com, jvanverth@google.com
Bug: skia:10105
Change-Id: I12f84d74bb633fb6e69bc21478ba05962dba6a1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281590
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-04 22:53:55 +00:00
Mike Reed
ab7e8b3bcc plumb camera info down to devices
Change-Id: I8bad4ba28034400890f52cd1c4ef0f907de17007
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281579
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-03 20:07:04 +00:00
Jim Van Verth
d6ad48086d Add GrD3DBuffer.
Supports buffer creation and destruction.

Bug: skia:9935
Change-Id: I6d8c6d67209a8857989a9384818272e7108177ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281577
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-04-03 19:47:56 +00:00
Brian Osman
717d386e0b Remove more remnants of SkVertices bone support
Bug: skia:9984
Change-Id: Ib79cf2509f5f92672cbb0b6060b8b33f99e9ac28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281162
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-02 14:12:06 +00:00
Brian Osman
f5ecf51f47 Stop including SkVertices.h from so many places
Change-Id: I50c1f230803faef731b32cad7cd60b7b421678e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281160
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-02 14:07:46 +00:00
Heather Miller
2fc431eaea Update Skia milestone to 84
Change-Id: I7bee49c916a76b78fd5b671461513339e27f2cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281158
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2020-04-02 13:43:06 +00:00
Brian Osman
46aacc7710 Fix SkVertices serialization bug. Also remove Builder getters for counts.
We already checked the SkSafeRange earlier (after its last use). Here we
need to be checking the SkSafeMath object. Oops.

The counts are directly copied from the constructor to the vertices'
fields - the user already knows what they are (and the tests are
verifying a tautology).

Bug: skia:9984
Change-Id: I33c62e02825718e497834b0dfa40d0d56e46a197
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280963
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-02 00:28:36 +00:00
Brian Osman
ffd11f4ab3 Adding attribute types to SkVertices
Adds structure to the per-vertex (now custom) data.
Attributes currently just have a type, but the next
step is to augment that with semantic flags to handle
transformation logic in the vertex shader.

Added unit tests and GMs that exercise attributes of
varying float counts, as well as normalized bytes.

Bug: skia:9984
Change-Id: I02402d40b66a6e15b39f71125004efb98bc06295
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280338
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-01 23:23:26 +00:00
Greg Daniel
6e35a00916 Have GrContext abandoned call also check if the underlying device is lost.
Change-Id: Iba09b8f39138e99cbd987880b2da07fdec799248
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280638
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-01 18:33:23 +00:00
Jim Van Verth
9aa9a683d3 Implement local version of gr_cp and use for GrD3DTextureResourceInfo.
Bug: skia:9935
Change-Id: I4c2d70f69e30f78caca0f49629880565f178f495
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280609
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-01 16:06:17 +00:00