Commit Graph

49696 Commits

Author SHA1 Message Date
Brian Osman
a7685b2343 Runtime effects: Allow null children
Two related things:
1) SkRuntimeEffect will allow null child shaders when calling
   makeshader. This will produce a GrSkSLFP with null FP children.
   Fix some code that assumed that children were non-null.
2) Change the input color passed to any children to be the SkSLFP's
   input color, rather than the default (white). This lets nullptr
   children in runtime effect have the desired behavior (they are the
   paint color or similar, depending on context).

Change-Id: Iabffc50b0a893a56403c5240f32a5da6a88d81f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301980
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-14 21:33:57 +00:00
Joe Gregorio
3bbde3a092 Add one R preview bot.
Bug: skia:10371
Change-Id: I3e5c8b34b7b80fff492de11ec769b33e2be3671c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302577
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2020-07-14 21:22:27 +00:00
Herb Derby
b2db9797c5 subclass GrPathSubRun from GrSubRun
Move PathGlyph to GrPathSubRun, and make the array for the path
data directly in the alloc instead of in a vector.

Change-Id: I861cb934e356f526f96e593d25019b00451f77b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302640
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-14 20:49:07 +00:00
Brian Salomon
4759dcaa8b Remove under used IsACopyNeededForMips helper.
Also don't overwrite YUVA planes unless all succeed.

Removes an unnecessary use case of GrSamplerState::Filter::kMipMap as
the single caller was always assuming mip mapping is in use.

Bug: skia:10344

Change-Id: I2309a364c8ba244f2a220f415835348d0d79ef35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302641
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-14 20:39:37 +00:00
Brian Salomon
0ea330703e Make GrTextureProducer take optional subset and domain rects
Split bicubic into separate functions.

Removes usage of null GrSamplerState::Filter to indicate bicubic.

Bug: skia:10344

Change-Id: Ife649ba84afe3a06d7d8fb0d46677ce96fc264dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302636
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-14 20:27:59 +00:00
Herb Derby
252a3c0e11 make GrAtlasSubRun a subclass of GrSubRun
Add API for GrSubRun.

Make sure the API presented by GrSubRun works. Use the original
implementation as the first subclass. It's named SkAtlasSubRun for now
even though it handles both path and atlas drawing. The next subclass
will be pulling out paths.

Change-Id: Id9b2feaa2c9ad9214736ff4a9f577d1de4d4212d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302582
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-14 19:33:17 +00:00
Greg Daniel
a726cecbd4 Update GrDawnBuffer to handle mappable xfer buffers.
Change-Id: Ib6c065bda7d801f985d11c11fba121ece805f758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300199
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
2020-07-14 19:16:37 +00:00
Robert Phillips
c7228c604e Set up to use new GrDirectContext factories in Chrome
Here is the Chrome-side CL waiting on this CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2297920 Use new GrDirectContext factories instead of deprecated GrContext ones)

Change-Id: Ic607c8f4d3b87b38b5a56a2c44012b7402e074dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302583
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-14 18:56:17 +00:00
Herb Derby
3d00a97bce extract and rename SubRun to GrSubRun
TBR=reed@google.com

Change-Id: I8be10fc421ab34de2d2307093f8eee0537d234ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302578
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-14 18:32:27 +00:00
John Stiles
955adbe02c Replace various one-liner sorting functor adapters with lambdas.
These tiny adapter classes aren't needed, since all of our clients have
support for lambdas.

Change-Id: Ibf22b1fd0adb3707db570432c50720df9c9329e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302581
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-14 17:45:26 +00:00
Ben Wagner
9d5c55cedf Move makeFontData to SkTypeface_FreeType.
SkTypeface_FreeType uses SkFontData and makeFontData as a way to lazily
create FT_Face objects. Other SkTypeface types do not need this, so
remove it.

Change-Id: I2f2f829deac9f7f6aac06f9ce84f856922d8a861
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299443
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-07-14 17:00:23 +00:00
Stephen White
1c47c8d248 Roll Dawn, and update to new TextureDataLayout API.
BufferCopyView's offset/bytesPerRow/rowsPerImage were deprecated in
favour of the aggregated TextureDataLayout member.

Bug: skia:10497

Change-Id: I89c508c1ba9dd8a25222469cdef23549a93cd9a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302580
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
2020-07-14 16:55:06 +00:00
Jim Van Verth
bb80fcdd41 Add Direct3D compressed texture support.
Implements GrD3DGpu::onCreateCompressedTexture and fixes
GrD3DGpu::onUpdateBackendTexture. D3D expects row data for texture
uploads to be aligned to 256 bytes, so any compressed data for smaller
textures needs to be unpacked to this row pitch.

Also uses the non-compressed routines to implement
onUpdateCompressedBackendTexture and onWrapCompressedBackendTexture.

Change-Id: I20fe4a64fa9b14231590f031ef6fdfadff5de256
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302396
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-07-14 16:49:26 +00:00
Brian Salomon
f990b6ab4a Remove GrTextureProducer::DetermineDomainMode.
We now rely on GrTextureEffect and GrBicbicEffect
to determine if shader-based tiling is required.

GrTextureProducer is still responsible for noticing that
the proxy is approximate because GrTextureEffect doesn't
consider that in its basic Make() factory (as opposed to
MakeSubset()).

Change-Id: I8e1aeb9edbcfa73ea0bf80b5256ee1ca21fe9c81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301985
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-14 16:48:46 +00:00
Mike Reed
2fe1569298 Create mipmaps when creating images
Follow-on CLs:
- add serialization for mips to pictures
- implement for other image types (e.g. lazy(?), gpu)
- improve generated mip quality

Bug: skia:10411
Change-Id: Id874f170e9cb8ae4405dc4f6249e1ea6274f20aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297739
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-14 16:02:26 +00:00
Brian Osman
12c5d29ba6 In FPs, store pointers for all child slots, even nullptr
This simplifies things like ConstantOutputForConstantInput and
invokeChild. It also removes the need for child indices: generated
FPs now directly refer to their children by slot number.

Change-Id: I69bbb042d5d72d21b999256f969c467702d0774d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302436
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-07-14 15:43:56 +00:00
Greg Daniel
ceebe424b1 Revert "Add GrContext api to update compressed backend textures."
This reverts commit 2c180304dc.

Reason for revert: attempted workaround did not fix techno spark so needs further investigation

Original change's description:
> Add GrContext api to update compressed backend textures.
> 
> Bug: chromium:1099255
> Change-Id: I0c3f25ddb037e47e3b910fa89c3d8b3aa27b3114
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302265
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ib5433def02dc5dad97dcdbd4476ced6de2361e6a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1099255
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-07-14 15:05:58 +00:00
John Stiles
df07800f95 Include the SkTSort header only where it is used.
Change-Id: If51be35205b40c4a22979a4b49b031126af1dde7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302500
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-14 14:19:06 +00:00
Greg Daniel
43833b028a Add GrContextOption to limit the number of cached secondary command buffers.
Bug: skia:10438
Change-Id: I3116fc1c7ee75f9b7a712c05199a9ed4a0d419c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302291
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Emircan Uysaler <emircan@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-14 13:51:26 +00:00
Mike Reed
380fba6e4b remove support for serialized pictures before aug 2019
Change-Id: I9b2a2dbac4110665e06882b9cbbc6f59e6bc0c21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302397
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-14 13:25:17 +00:00
Robert Phillips
f4f8011aef Add Context factories to GrDirectContext
In order to stage the transition from GrContext to GrDirectContext, both
of them will have to have the factories for a while.

This CL also removes all internal uses of the old (GrContext) factories.

Change-Id: Ibe1edd0818ea23a0d54257c55f35f12526047ef3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302263
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-14 12:40:46 +00:00
skia-recreate-skps
73e76a39ec Update Go Deps
Change-Id: I91ad3dce235b0a5c6256948c93e7dc0970b1f5a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302496
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-07-14 05:47:56 +00:00
skia-autoroll
47ab248791 Roll Chromium from b39fabb9a3ae to 2a68959faa37 (427 revisions)
b39fabb9a3..2a68959faa

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

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

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

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: nifong@google.com
Change-Id: I7ce9b97ac9fd90e7569282af29af9e14105d2aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302486
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-14 04:46:41 +00:00
skia-autoroll
b4302f94c5 Roll ANGLE from 7d82d29398cc to d98afb787a24 (9 revisions)
7d82d29398..d98afb787a

2020-07-13 m.maiya@samsung.com Vulkan: Enable VK_KHR_get_memory_requirements2 extension
2020-07-13 enga@chromium.org Revert "Refactor DisplayGbm::generateConfigs"
2020-07-13 nguyenmh@google.com Multi-frames serialization + comparision for capture replay test
2020-07-13 xinyi.he@arm.com Vulkan: Disable GL_EXT_robustness extension on Mali
2020-07-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 44ef9e08c459 to 8726fda3f865 (8 revisions)
2020-07-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 94f1ce331e85 to 04c82ec6f36f (9 revisions)
2020-07-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 5aaa0c2bc821 to 4e13c90944e9 (7 revisions)
2020-07-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from 145050bf2b98 to d704d1bc0e11 (2 revisions)
2020-07-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 6cd27bab06f4 to ad65826a2ab1 (7 revisions)

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

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1105208
Tbr: nifong@google.com
Change-Id: I3800a24f43f016749f4ea27924710b9f21711516
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302487
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-14 04:42:36 +00:00
skia-autoroll
ecff79362c Roll SwiftShader from ad65826a2ab1 to cd0af6456eb1 (5 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/ad65826a2ab1..cd0af6456eb1

2020-07-13 capn@google.com Remove dead ASTC code for GLES
2020-07-13 capn@google.com Rename command classes to match API calls
2020-07-13 srisser@google.com Add decoder for BC6h
2020-07-13 sugoi@google.com Image dirtiness
2020-07-13 amaiorano@google.com Android: build against llvm-10 instead of llvm-7

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

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

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

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: nifong@google.com
Change-Id: Iacd86abd20864bb6b1197cb661676f9851eb0ff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302454
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-14 04:41:36 +00:00
skia-recreate-skps
b0a95776ab Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: Ia3bf7166278d95a000cb2d61b2a18c2faccd9db9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302478
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-07-14 01:00:21 +00:00
John Stiles
6e9ead9166 Revert "Remove custom SkSort algorithms."
This reverts commit 70474c1cb0.

Reason for revert: bot build failure

Original change's description:
> Remove custom SkSort algorithms.
> 
> SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
> The difference is small on randomized inputs, but quite significant for
> semi-ordered inputs (forward/backward/repeated). There doesn't seem to
> to be any compelling advantage to SkTQSort.
> 
> Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u
> 
> (These performance numbers are from an optimized build my local machine;
> it's possible that we might see different results on the test bots.)
> 
> Change-Id: Iaf19563041547eae7de2953be249129108f093b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,brianosman@google.com,johnstiles@google.com

Change-Id: I1126dd4cda95716dac225ad32d5b0e5cf3f09421
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302447
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-14 00:25:05 +00:00
John Stiles
70474c1cb0 Remove custom SkSort algorithms.
SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
The difference is small on randomized inputs, but quite significant for
semi-ordered inputs (forward/backward/repeated). There doesn't seem to
to be any compelling advantage to SkTQSort.

Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u

(These performance numbers are from an optimized build my local machine;
it's possible that we might see different results on the test bots.)

Change-Id: Iaf19563041547eae7de2953be249129108f093b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-13 23:35:20 +00:00
John Stiles
affae53173 Add various missing header files to BUILD.gn.
Change-Id: I6f4409e9e8c6d4a6d71bc41e57dce7417d7788f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302440
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-13 22:35:50 +00:00
Chris Dalton
5bdbdf44a9 Update glMultiDraw... to use GLuint* for baseInstances
There seems to be some inconsistency across specs, but GLuint* is the
correct type to use for this array.

TBR=bsalomon@google.com

Bug: skia:10419
Change-Id: I4106b98278850e30e748746159ea4efc05688c0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302433
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-07-13 22:13:30 +00:00
Ben Wagner
81e4bf2870 Use public api to serialize typefaces.
SkFontData can be phased out now that there is the public
SkFontParameters and SkFontArguments and supporting methods implemented
on all SkTypefaces. After this change onMakeFontData can be moved to the
FreeType backed typeface as an implementation detail.

Change-Id: I26c41ecbbe9d3c6a5bd401e908fef67d325e1770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299442
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-07-13 21:18:49 +00:00
Herb Derby
342273cbaa remove firstSubRun
Since exposing subRunList, there is no reason to have the additional API
call for getting the head of the list.

Change-Id: Ib4bf8b7b89484154ad8d576bb5397810628f1a11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302258
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Herb Derby <herb@google.com>
2020-07-13 20:57:58 +00:00
Greg Daniel
2c180304dc Add GrContext api to update compressed backend textures.
Bug: chromium:1099255
Change-Id: I0c3f25ddb037e47e3b910fa89c3d8b3aa27b3114
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302265
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-07-13 20:42:38 +00:00
Herb Derby
1a0cf309cb Make many things private in SubRun
Change-Id: I385ab487486f7d97c3b35e3a2cc0a9c03dd06b73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302273
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 20:17:58 +00:00
Robert Phillips
1a57857fb6 Retract GrContext.h from headers
GrContext is going away. These #includes have been letting it slip in
where it shouldn't.

Change-Id: Idbf24aeba4454d272ad3ebc8ea0d75ae4d9e6e10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301978
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-13 20:03:58 +00:00
Herb Derby
d68ad7d7b0 move regenerate() from VertexRegenerator to SubRun
Delete VertexRegenerator.

Change-Id: If48fb3664f8b0185d1e4c2c439f1e378641a669d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302272
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-13 19:48:28 +00:00
Mike Reed
2955973dca remove helper now that g3 is updated
Change-Id: If14455faac4554729dfc16bb1d5299f2458a2d2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302260
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-13 19:46:28 +00:00
Herb Derby
2604a89d33 make single draw() for SubRun
Change-Id: I293298562393bcd092d719e1402d361528d8369f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302336
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-13 18:28:48 +00:00
Herb Derby
52ceaea51d prepare regenerate to move to SubRun
Move the only method into it's call site. The regenerate call will
be moved to SubRun in the next CL. The regenerate call will need
different implementations for the different types of SubRun.

Change-Id: I5396790211ea26cb96b23e823bd2c41c6c5cbaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302268
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 18:10:58 +00:00
Andy Weiss
25a1d4f2a0 Fix Mac GPU references
https://skia-review.googlesource.com/c/skia/+/301920 broke the macos
build by not including the gpu/gl references back in for macos. This
makes the same changes as that CL for the mac.

Change-Id: Iad75355f505ee2942724aa721d3a7753c10ba06e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302329
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Guruji Panda <guruji@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-13 18:04:28 +00:00
Dan Field
439709a97d Expose multi-frame methods for SkCodecImageGenerator
This will allow Flutter to avoid some usages of SkCodec
and have consistent EXIF handling for multi-frame formats
that support EXIF.

Change-Id: I80daee9b00777d88d0a960cc0f0d76da6680e257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302270
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2020-07-13 17:54:28 +00:00
Brian Osman
3b5a4fac1e Use stable sort for Viewer's help screen
Fixes flickering help text

Change-Id: I61159e6946125e9e2ce7be3f8f8f6103473855be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302266
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-07-13 17:25:56 +00:00
Herb Derby
a5b9860871 improve the speed of empty GrTextBlobs
Empty text blobs can be the result of a singular matrix, or glyphs that
result in empty rects. If the initial matrix is singular, then we
need to regenerate, otherwise keep the cached empty GrTextBlob to
go fast.

We assume that if the text blob is empty, and the initial matrix is not
maps rect to rects, then the matrix is singular.

Bug: skia:10483

Change-Id: I3bea8abe667d3a2435437ad11198ce7553687133
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302296
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-13 17:01:06 +00:00
Herb Derby
c1583cba22 move drawTextPaths from RTC to SubRun
Move drawing text as paths to the SubRun in anticipation of producing
a virtual draw() interface.

Change-Id: Iba9f948a8036a955a0205a098279825a72dc95c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302261
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 16:49:50 +00:00
John Stiles
85894305bf Replace ModulateRGBA effect with Xfermode using modulate blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).

Change-Id: Ie2203f7613503476fa9d045aba58d9ef39f3ea26
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302264
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 16:16:50 +00:00
John Stiles
7bf2600475 Replace ModulateAlpha effect with Xfermode using src-in blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).

Change-Id: Ie81e8b82d9b9c441533760d4e9f7e149bc0d969d
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302262
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-13 16:12:50 +00:00
Brian Osman
06b78cf02b SkRuntimeEffect: Guard against programs with no "main"
Bug: oss-fuzz:24070
Change-Id: I310e3793e6099f23f93c5feed8dfcd596cecbda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302257
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>
2020-07-13 15:37:50 +00:00
Adlai Holler
74470aec51 Make GrAsDirectContext public
As soon as I started migrating Chrome, this function showed its
public usefulness. It'll keep coming up over and over again.

Change-Id: Ic6fd08af9b64a4c3287e7fedc9cd0e29bbaf837d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302259
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 15:30:00 +00:00
John Stiles
7c1967700b Split GrConstColorProcessor into three separate .fp effects.
ConstColorProcessor contained three separate InputModes with their own
unique behaviors, but every (non-test) call site simply hardcoded one of
the InputModes.

This change also allows the actual const-color processor to remove the
inputFP entirely; it is never sampled.

The GM slide has been split into three separate slides as well.

Change-Id: I2b77f4eab4d655f06e3704fb6fde8d4f8c70a075
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301987
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 15:07:12 +00:00
John Stiles
d9800f8fda Redesign const-color unit test to leverage sk_gpu_test::test_ops.
The previous implementation invoked SkPaintToGrPaint to create a
base-layer GrFragmentProcessor, and then manually poked an extra
GrFragmentProcessor onto the GrPaint's color processor stack. This
approach is not compatible with a world where a GrPaint is only allowed
a single GrFragmentProcessor.

Redesigned the test to use a different approach. We now manually create
the base-layer processor, and then create a second ConstColorProcessor
which uses the base layer as an input processor. This composite FP is
then drawn using `sk_gpu_test::test_ops`.

Change-Id: I8a2781549ba3d5aee85a520b9b34a70c0e66093a
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301986
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-13 15:04:37 +00:00