Commit Graph

8001 Commits

Author SHA1 Message Date
Brian Salomon
0f39699192 Reland "Make it easier to test rectangle textures by using createBackendTexture."
This is a reland of 4e37751693

Original change's description:
> Make it easier to test rectangle textures by using createBackendTexture.
> 
> Also allows internal creation of rectangle textures, only used by unit
> tests currently.
> 
> Previously GrContext::createBackendTexture() would ignore the request
> for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
> supported and always fails for EXTERNAL.
> 
> Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Change-Id: Ibf6921c97278c9f0f71c46883cfbaa04f229affa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297865
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-22 16:13:04 +00:00
John Stiles
956ec8a8bc Update GrCCClipProcessor to support an input FP.
GrReducedClip will now combine both analytic and CCPR FPs using child
FPs instead of via RunInSeries. (There is still an fShader component
which, if present, is combined via RunInSeries for now.)

Change-Id: Ia7e0ced1e64927b94a8e64adfb5a773c2c175963
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297808
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-22 13:57:17 +00:00
Greg Daniel
b57765532b Don't submit vk command buffer in updateBackendTexture.
So apparently I did all the work to allow us to not submit in
updateBackendTexture, but then I never actually removed the submit...

Bug: chromium:1087124
Change-Id: Id08a9c5e116cff57dbbeada74186f94da6e28656
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297866
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-20 13:13:03 +00:00
Derek Sollenberger
96f8db0323 Revert "Make it easier to test rectangle textures by using createBackendTexture."
This reverts commit 4e37751693.

Reason for revert: breaking some mac test bots

Original change's description:
> Make it easier to test rectangle textures by using createBackendTexture.
> 
> Also allows internal creation of rectangle textures, only used by unit
> tests currently.
> 
> Previously GrContext::createBackendTexture() would ignore the request
> for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
> supported and always fails for EXTERNAL.
> 
> Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ia14c60ae996757369f1711ec0851e199cbbd4157
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297812
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-06-19 19:14:39 +00:00
Brian Salomon
3f4de78fa5 ProcessorCloneTest checks against original FP against clone.
Previously the test checked two clones against each other. It seems
more useful to test an original against a clone.

Change-Id: Ie49a39829a0f5ee24724e4acefad50e539104f48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297460
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-19 18:17:58 +00:00
Brian Salomon
4e37751693 Make it easier to test rectangle textures by using createBackendTexture.
Also allows internal creation of rectangle textures, only used by unit
tests currently.

Previously GrContext::createBackendTexture() would ignore the request
for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
supported and always fails for EXTERNAL.

Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-19 17:50:18 +00:00
Greg Daniel
d4928d03e2 Implement flush finish proc support for d3d backend.
This also adds a GPUTEST_FOR_D3D_CONTEXT macro to help with debugging
tests.

Change-Id: I72db01d148755c3bbbbb4d948d441a31dcf9482b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297717
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-19 16:28:33 +00:00
John Stiles
5081942c0d Optimize CPP code generation.
Previously, we were limiting our calls to appendVAList to 512-byte
chunks to avoid a potential buffer overflow. This had two problems:
1 - it did not avoid the buffer overflow :(
    see chromium:1092743
2 - every call to appendVAList is expensive; it incurs a resize of the
    code buffer (alloc new, memcpy, free old)

This CL removes the 512-byte cap as the buffer overflow issue was
resolved at http://review.skia.org/297276

This CL also includes a few more minor improvements.
- `codeAppendf` now uses a raw string so the gencode is easier to read.
- Optimized `SkStringPrintf("%s", foo)` to `SkString(foo)`.
- Optimized `strA = strB` to `strA.swap(strB)` where safe to do so.

Change-Id: Ia0909a68719848dd2ca655066a9bc6929c8fd09f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297358
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-19 13:25:05 +00:00
John Stiles
75c9c5bd26 Add unit tests for untested SkString APIs.
Unit tests for SkString::appendVAList would have preemptively caught the
associated fuzzer failure.

Change-Id: I19a414e5e937f9e3fbe0f75e062b4befa6e2877b
Bug: chromium:1092743
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297473
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-19 13:08:52 +00:00
Greg Daniel
5ed3c11a80 Reland "Don't release vk memory allocator until context is deleted."
This reverts commit c35c073c80.

Reason for revert: fix benches

Original change's description:
> Revert "Don't release vk memory allocator until context is deleted."
> 
> This reverts commit 11afa63693.
> 
> Reason for revert: breaking perf bots
> 
> Original change's description:
> > Don't release vk memory allocator until context is deleted.
> > 
> > Bug: chromium:1081806
> > 
> > Change-Id: I0a7a92408a3f2119e6b70d8eef6aa4f2d1982d4b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297357
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I48d200cb72eb30c119359e89c5a9123213e62a5e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1081806
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297457
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: chromium:1081806
Change-Id: I6d80af6a1fab2fd6e2e15e9a2c7deefd7a7866ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297475
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-18 22:04:23 +00:00
Brian Salomon
92b9ccf53e Use child texture effects in ProcessorRefTest
Also remove unused buffers. FPs no longer support reading from buffers.

Bug: skia:10139

Change-Id: Id1e2d7ef2cfa7f11a95cb0ce448c69af755c2b65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297176
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-18 20:18:33 +00:00
Greg Daniel
c35c073c80 Revert "Don't release vk memory allocator until context is deleted."
This reverts commit 11afa63693.

Reason for revert: breaking perf bots

Original change's description:
> Don't release vk memory allocator until context is deleted.
> 
> Bug: chromium:1081806
> 
> Change-Id: I0a7a92408a3f2119e6b70d8eef6aa4f2d1982d4b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297357
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I48d200cb72eb30c119359e89c5a9123213e62a5e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1081806
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297457
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-18 17:38:31 +00:00
Greg Daniel
11afa63693 Don't release vk memory allocator until context is deleted.
Bug: chromium:1081806

Change-Id: I0a7a92408a3f2119e6b70d8eef6aa4f2d1982d4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297357
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-18 17:27:48 +00:00
Brian Salomon
f629a9022f Make Clip test FP use texture effect child
Bug: skia:10139

Change-Id: I32d13b11b613996f4b83e3cf50e28993985bcb08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297061
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-18 15:31:23 +00:00
Dominic Mazzoni
8c662a7d6e Get rid of deprecated API to add children to PDF tag nodes.
fChildren/fChildCount was replaced with fChildVector and Chromium
migrated to the new API a while back, it's now safe to remove the
older interface.

Bug: chromium:607777
Change-Id: I7311d3b51f1b71209dcc024ae51637536d560619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297260
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-18 13:57:23 +00:00
Florin Malita
4190f27b41 Fix SkParse::FindNamedColor OOB
Plus some minor cleanup and asserts.

Bug: oss-fuzz:23395

Change-Id: I667bee2d7f21864defe2fd97df9eb4e99d69d9ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296451
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-06-17 14:23:14 +00:00
Robert Phillips
5f0cda4ad4 Refine VkYcbcrSamplerHelper to only hold backend memory for YCbCr textures
This arrangement allows the backend texture to outlive the YCbCr SkImage.

Change-Id: I34939d05bf1091c8efcacb687dc1900729d4cbe5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296478
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-16 14:05:30 +00:00
John Stiles
8c71f3e7d7 Improve error reporting in ProcessorCloneTest.
Previously, when REPORTER_ASSERT reported a failure, there was no
additional information describing the FP that could not be cloned in the
error log. Now, we print out a very simple tree of the FP and its
children.

Change-Id: I141cfb17ca431864a6f555d56f0335293f259c4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296452
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-15 19:53:54 +00:00
John Stiles
e3a39f7053 Update ConstColor FP to support an input FP.
In the "ignore input" mode, the input FP contributes nothing and is
never sampled. In the "modulate input" cases, the input FP is sampled
as one would expect.

Change-Id: I96717d63d8e3d7ef6aa4eaaf88154c6e5ce47e55
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296299
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-15 18:45:04 +00:00
Herb Derby
a08bde606a GrTextContext::Options -> GrSDFTOptions
Rename GrTextContext::Options to GrSDFTOptions. Remove GrTextContext.

TBR=reed@google.com

Change-Id: Ic89966cfe630cc6ee757977a6d63ae1da9e39ef0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296176
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-15 17:14:04 +00:00
John Stiles
92219b464a Fix pointer ownership issue with SkSL static switches.
When collapsing static switches, we were not handling the symbol table
in SkSL::Block correctly, which led to assertion failures in some cases.

This CL is based on the fixes in http://review.skia.org/296178
but removes the need to track pointers-to-unique-pointers.
We do this by splitting the work into two parts:
1 - determine range of statements to move
2 - actually move statements

Because the statements are all consecutive, keeping track of this range
is not actually that difficult and we don't need to do any checks twice.

Change-Id: I71ad745ef1e4b4f5f6b753762e65fa49b2399adc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296440
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-15 17:09:54 +00:00
Dominic Mazzoni
127c607818 Add separate PDF tag attribute interfaces for names and strings
In PDF files, "names" and "strings" are not the same thing, but I was
conflating them. Separate out the interfaces for adding attributes to
PDF struct tree elements so there's a way to add either a name or a string,
and similarly for arrays of names or arrays of strings.

Fix the table test to correctly use a name for the "Scope" attribute
and an array of strings for the "Headers" attribute.

Bug: chromium:607777
Change-Id: Ib30bded2bbcf96e31ba6925fb062615558dea0db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296338
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-06-15 15:46:29 +00:00
John Stiles
3779f448ca Add helper method to clone and register a child FP.
This will remove common boilerplate from our gen-code, and gives us a
place to put common child-cloning boilerplate.

Change-Id: I6101655af89d4c5844ec908b81ce4f6e5d59f834
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296177
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-15 15:43:05 +00:00
Mike Reed
82d619699d remove (unused) clipmask from savelayer
Change-Id: I44f64a8c98c019a8f4878b0b6f6d82489aa8252c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296179
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-06-15 14:26:44 +00:00
Greg Daniel
01f278c834 Better handle backendFormat to CompressionType.
We also fix getReadSwizzle with this change.

Change-Id: I1989d8347dc97d7a4c75aa9094a0146419c6d8fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295819
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-12 21:47:14 +00:00
Herb Derby
45fe2e8a99 move methods to options class
Change-Id: I5e4abcec1b9f99997cd68b433490e13eaa76f3f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296123
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-12 21:03:34 +00:00
Greg Daniel
9efe386978 Add SkSurface flush call that takes a GrBackendSurfaceMutableState.
This new api will eventually replace the version that takes an

SkSurface::BackendAccess.
Change-Id: I48cd013725e14027f386b0b111223459944ac44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295567
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-12 20:40:54 +00:00
Herb Derby
3d6bf04366 make options robust
Options used to rely on an external call to SanitizeOptions to
ensure they were correct. Now that defaults are set directly,
make sure that the values coming in make sense.

Change-Id: If6cfc027722b6a7717a920b482ec5be8f7526367
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296040
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-06-12 17:05:22 +00:00
Michael Ludwig
e06a8972f0 GrClips know their device dimensions
If GrClips know their dimensions then getConservativeBounds() does not
need any arguments and isRRect() can remove its rtBounds argument.

I also updated GrFixedClip to report the render target bounds as a
degenerate rrect in its isRRect implementation if it was wide open. Its
apply() function was also simplified to take advantage of the prior
GrScissorState work where the rectangle was always valid to access and
contained within the render target bounds.

Change-Id: I627b97976cb176b1c80627462027034b06ad2cb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290957
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-11 22:41:24 +00:00
John Stiles
30212b7941 Fix implicit fallthroughs throughout Skia.
This CL is not fully comprehensive; for instance, it does not contain
fixes for backends that don't compile on Mac. But it does resolve the
vast majority of cases that trigger -Wimplicit-fallthrough.

A few minor bugs were found and fixed, but none that were likely to
affect normal operation.

Change-Id: I43487602b0d56200ce8b42702e04f66390d82f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295916
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 22:29:53 +00:00
Mike Reed
9290d01c6f Add filter-quality to imageshader factory
The old factories (makeShader) will behave as before: they will inherit
the filter-quality from the paint.

The new factory takes an explicit filter setting, and will use that
regardless of the paint.

Big follow-ups:
- update callers to not rely on setting in SkPaint
- revise/enhance settings in imageshader
    - settings for scaling up and down
    - control over trilerp, etc.
    - other: 4x4 kernels? trilerp bias?
- move mipmaps to always be explicit requests a SkImage factory time


Bug: skia:10344
Change-Id: If87b06d4fd6eafd8b9cdecda7c00d69897066ef8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295086
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-11 22:15:33 +00:00
Robert Phillips
85aa42820e Move VkYcbcrSamplerHelper's context functionality into VkTestHelper
This should make the YCbCr sampler helper usable in a GM (with a normal Vk context).

Change-Id: I75451f6ca934f7b59c48349c77234856d0946a12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295766
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-11 19:39:21 +00:00
Herb Derby
082232b142 simplify option flow
The GrTextContext::options would flow from the GrRecordingContext to
the GrDrawingManager to the GrTextContext, and finally to the
GrRenderTargetContext.

Just find them on the GrRecording context off the GrRenderTargetContext.

Change-Id: I902481d20072c2470905261ab81c2b6456f25343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295559
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-11 18:05:36 +00:00
John Stiles
88183900a5 Honor return value of registerChildProcessor when creating child FPs.
The current implementation ignores return value from
`registerChildProcessor` and, surprisingly, assumes that a cloned FP
index will match the original FP index. This version honors the return
value.

(In practice, I have not seen any cases where the current implementation
has caused actual breakage.)

Updating common code-gen had large ripple effects in the SkSL unit
tests. While repairing the tests, I also took the opportunity to use
raw-strings to pass the source SkSL text, and annotated the `expectedH`
and `expectedCPP` blocks to make the tests easier to understand at a
glance.

Change-Id: I71be69d9e4620963b3ef49ad8e0dba3b40af7f4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295452
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 17:46:54 +00:00
Ethan Nicholas
739e1caf35 Fixed SkSL optimization issue
When collapsing static switches down to a single statement, we detect
break statements and don't copy them. But the logic was broken; we
weren't copying the entire statement in which the break occurred, which
could be a block, causing some of the code to simply be omitted.

Change-Id: Ic5b59c11d12326c93d49080193a0a5297732bfb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295776
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-11 17:24:24 +00:00
Herb Derby
4598fa1b1a move test op creation to GrTextAtlasOp
Change-Id: If6de2f7812ead2d3722d528805901e0f7e67a6b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295358
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-11 16:26:43 +00:00
Stephen White
36248741c2 Dawn: implement Dawn support for BackendAllocationTest in Gray8 mode.
Bug: skia:10362
Change-Id: I56d1f618dcdf96133f1932b7ac8d4602ddb93a59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295575
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-11 14:26:44 +00:00
Robert Phillips
0d6ce7cc13 Split VulkanTestHelper out into its own files
The aim here is to unify VkTestHelper with the VkYcbcrSamplerHelper's context creation code. AFAICT they have a ~90% overlap.

Change-Id: Iba8d1482b8c1d7164682f90e19d2183d8cfe45d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295583
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-11 13:49:33 +00:00
Greg Daniel
e8d3ccadfe Remove GrPrepareForExternalIORequests from flush.
Now that we have the GrContext setBackendTextureState calls we no longer
need these to be on flush.

Bug: skia:10254
Change-Id: I7c44667a327de11dd853e3e71b114959a7bcee86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295447
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-10 20:00:20 +00:00
Leon Scroggins III
11a52d3dfa Remove SK_LEGACY_WEBP_LOOP_COUNT
Bug: b/145995037
Bug: skia:5457

Android is switching to the new behavior with ag/10041691, so the
legacy flag is no longer needed.

TBR=djsollen@google.com

Change-Id: I786807e4cb8b4ed4cd41fd2776ae2915f8bc62cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263176
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-06-10 17:57:45 +00:00
Brian Osman
ff7bee9817 Remove SkReader32, and some API from SkWriter32
After removing all unused API from SkReader32, it only had a handful
of functions, and it was (rightly) only used by SkReadBuffer. Remove
the temptation to use it by just folding it into SkReadBuffer.

SkWriter32 had some unnecessary functions as well (only used in unit
tests), so those are gone. There is still a strange relationship:
SkWriteBuffer is just an interface - SkReadBuffer is actually the
complement of SkBinaryWriteBuffer/SkWriter32. Those two classes produce
data in the exact same format, but with slightly different interfaces.
(The choice about which one is used is mostly about high-level
serialization vs. low-level helpers).

Change-Id: I1e823755febecd2e053ea732b21295d8f4d9d832
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295557
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-10 16:45:56 +00:00
Robert Phillips
ae413d8b81 Move VkYcbcrSamplerHelper to its own files
The intent is to reuse this helper to create a YCbCr GM.

Change-Id: I4d6af42745dbf845e28753bec670ad4a75c393b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295443
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-10 16:39:17 +00:00
Brian Osman
9e4e4c7e97 Reland "Switch persistent cache to use SkReadBuffer/SkWriteBuffer"
These are much safer than SkReader32/SkWriter32 (they do validation and
ensure we never read past the end of the buffer).

Where we used to just assert that the contents of the cache were valid,
we now validate everything, and fail gracefully by discarding the cache
contents if it's corrupted or invalid.

Reland includes a new skipByteArray API. The previous technique for
reading into an std::string relied on data(), which doesn't return a
writeable pointer until the C++17 standard library.

Bug: skia:9402
Change-Id: I3b88efbf8ca590c8ad4f8164f7c07eee12696ec6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-10 14:55:37 +00:00
Greg Daniel
1db8e7990a Add GrContext API to allow updating GrBackendSurfaceMutableState.
This is currently only supported for the Vulkan backend

Bug: skia:10254
Change-Id: I9274799098dc00dec5abcbcec95ce7cc23fec537
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293844
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-10 13:15:55 +00:00
Adlai Holler
d71b7b05ba Move lastRenderTask into drawing manager
Bug: skia:10320
Change-Id: I5a25d8c0bf00b379a37c479e79d4ff16403e9dfe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294339
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-08 20:49:16 +00:00
Greg Daniel
03535f4f22 No longer move queue index of VkImage back to initial state on release.
From what I can tell no one is currently depending on this feature and
continuing to support it is starting to become a pain. Clients will
be able to manually request VkImages (via flush api) go back to their
original queue, so there is a path if someone really needs this.

Bug: skia:10254
Change-Id: I91283bba451fa9bf52b466f587d3f7c5c9365242
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294657
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-08 14:21:19 +00:00
Stephen White
af6cf631af Revert my recent change to WritePixelsNonTexture_Gpu.
This check isn't correct, since most backends will use a fallback path if
writePixels directly to a surface fails.

That fallback path doesn't work for Dawn currently, so skip the test
on the Dawn backend.

Change-Id: I07f9a25640bc579d6b0952e208237368d007b06d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294702
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-06-05 21:17:16 +00:00
Michael Ludwig
4e221bd41c Initial clipShader implementation for SkClipStack and GPU
Change-Id: I0af800900a7fbd9d16af0058ee0754358ebc3875
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293562
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-05 20:17:58 +00:00
Stephen White
9f7485b4bb Dawn: fix unsupported writePixels mode and test.
Dawn does not support writePixels to a TextureAsRenderTarget, so update its caps to reflect that.
Also update the WritePixelsNonTexture_Gpu test to check the caps.

Bug: skia:10333
Change-Id: I4dcf2e0fecc34cba9586e5cab71739e427301efb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294597
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-06-05 18:07:43 +00:00
Michael Ludwig
de00dc9004 Detect empty clip when difference op clips everything
Change-Id: Ifbe0f3ae6e01d65f18351903da8aef63170ce6c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294457
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-05 15:34:59 +00:00