Commit Graph

19255 Commits

Author SHA1 Message Date
Mike Reed
473f69276f fix nextContour bug
Calling nextContour() needs to ensure that we've already measured the "current" one.

Bug: skia:
Change-Id: I501c26d0b068028d67103888f06ec89125a5407a
Reviewed-on: https://skia-review.googlesource.com/114692
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-16 15:11:31 +00:00
Greg Daniel
e464160f69 Fix Vulkan Copy as draw shader
Bug: skia:7663
Change-Id: I745900ccc56c697e4abb982e921d99bc28502b33
Reviewed-on: https://skia-review.googlesource.com/114687
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-16 13:36:51 +00:00
Robert Phillips
874b5357da Prevent crash when flushing while DDL recording
Change-Id: I35e96d3c3020092b33d9b952394d40d4fd5a587b
Reviewed-on: https://skia-review.googlesource.com/114685
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-16 13:30:01 +00:00
Brian Osman
91fba61f24 Support GL_OES_EGL_image_external on newer GLSL without essl3
Bug: skia:7713
Change-Id: I15c6a55370848cd211c783c886923f31dec1788c
Reviewed-on: https://skia-review.googlesource.com/114505
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-16 13:08:32 +00:00
Greg Daniel
6e9a4f6327 Make TestForPreservingPMConversions helper use lazy createTextureProxy call.
Bug: skia:
Change-Id: I337efc531aa5685c138b2f9e2bd47b47ba4e1fd5
Reviewed-on: https://skia-review.googlesource.com/114583
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-16 12:25:51 +00:00
Robert Phillips
6ceaafa7b9 Handle GrContext creation failure in DDL
TBR=bsalomon@google.com
Change-Id: Ib34448a60cb127ef89bcb0b1f85d07abc91af582
Reviewed-on: https://skia-review.googlesource.com/114569
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-15 21:25:16 +00:00
Brian Salomon
6a426c1d72 Cleanup SkImage YUV texture factories.
Remove unused GrBackendObject variants.

Add versions without redundant size param.

Make this work with GrBackendTextures that weren't created with a GrPixelConfig.

Change-Id: Ic1bbf5f2817cebab938b4f31000126a6ab5c44d5
Reviewed-on: https://skia-review.googlesource.com/114460
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-15 19:41:26 +00:00
Mike Reed
e11d793294 detect non-finite pts
Bug: oss-fuzz:6638
Change-Id: I72dab6783099facbe8d658ec1bc4b175a383e174
Reviewed-on: https://skia-review.googlesource.com/114565
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-15 19:06:46 +00:00
Robert Phillips
f733a72b83 Disable CCPR path rendering in DDL mode
Change-Id: Ib16a7b037eff6cd0528177646c2eced467763a06
Reviewed-on: https://skia-review.googlesource.com/114560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-15 18:39:06 +00:00
Mike Reed
9c2916e0c7 drawTextRSXform should not apply matrix to shader
drawTextRSXform should draw the same as drawTextOnPath (as regards shaders)

Bug: b/69904791
Change-Id: I393dd8fd7a5bdc6a018b1ca33592b208c7141868
Reviewed-on: https://skia-review.googlesource.com/114468
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-03-15 18:14:16 +00:00
Hal Canary
25375e80c2 GrGLES: unify MakeNativeInterface_{android,egl}
BUG=skia:3508
Change-Id: Ibc98ea3e579cb545635c28d345cae24f57d0c2a3
Reviewed-on: https://skia-review.googlesource.com/114471
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-03-15 17:10:56 +00:00
Cary Clark
b8421edb47 fix pathops fuzzers and debugging
En route to fixing fuzzer bugs, I discovered that most
debugging in pathops was broken. Pathops has extensive
runtime functions that trace links and connections between
data structures that are invaluable to debugging. The
only practical way to use these functions is to call them
from the debugger in immediate mode.

Some time, some where, the MSVS Immediate Window ceased
to be able to call functions that are members of structs
or classes, and functions that take templated parameters.

I can find no mention of this on the web, so I assume
that something about our setup is triggering this, but
I've had no luck finding the culprit.

In the meantime, I've added global functions wrapped in
a namespace to sneak calls to these functions without
MSVS being any the wiser. While this works, it is likely
to bitrot by tomorrow or next Tuesday so I will continue
to try to find and fix the root cause.

This also fixes the fuzzer bugs; generally one-line edits
that change asserts to fails. All pathops tests succeed
with this. To run all tests, do:
./out/debug/pathops_unittest -V -x
./out/release/pathops_unittest -V -x

TBR=caryclark@google.com
Bug: skia:
Change-Id: I956ae3d8df6d25e155e62bd6dede64519c7fbdb1
Reviewed-on: https://skia-review.googlesource.com/114321
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-03-15 17:07:16 +00:00
Herb Derby
c2ec4e8d83 SkAutoGlyphCache change some sites to Find*.
Change-Id: Iec3a0c60106017394fcdd981052713b6e42fa595
Reviewed-on: https://skia-review.googlesource.com/114506
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-03-15 16:59:46 +00:00
Robert Phillips
7f4419696b Make CreateBackendFormatFromTexture shared code
TBR=bsalomon@google.com
Change-Id: I19e6e6c8dc32ba584738545d443de092e4987a5a
Reviewed-on: https://skia-review.googlesource.com/114374
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-15 16:51:36 +00:00
Greg Daniel
4f4a53f948 Fix initialLayout update in Vk createTestingOnlyImage
Bug: skia:
Change-Id: I5d4321e68c065e3775266994c65a4abf18360731
Reviewed-on: https://skia-review.googlesource.com/114497
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-15 15:10:56 +00:00
Alexis Hetu
0e90f9849a Check GL_EXT_texture_format_BGRA8888 before GL_APPLE_texture_format_BGRA8888
When both GL_EXT_texture_format_BGRA8888 and GL_APPLE_texture_format_BGRA8888
extensions are present, the presence of GL_APPLE_texture_format_BGRA8888 was
preventing GL_EXT_texture_format_BGRA8888 from allowing BGRA8888 to be used
as a render target. By checking for GL_EXT_texture_format_BGRA8888 first,
this solves the issue.

The issue was encountered trying to run vr_pixeltests on top of SwiftShader
on the bots with a version of SwiftShader exposing both extension strings.

Change-Id: I446ec502a4703d24c24339708dcbbe9c334a7533
Reviewed-on: https://skia-review.googlesource.com/114495
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Alexis Hetu <sugoi@google.com>
2018-03-15 14:51:06 +00:00
Cary Clark
5d389c2359 protect PathMeasure against input paths with NaNs
found by fuzzer

R=kjlubick@google.com
Bug: skia:
Change-Id: Ifde8706a7ca6fad785a1b0b50f3df3fb099c0e36
Reviewed-on: https://skia-review.googlesource.com/114477
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-03-15 14:34:26 +00:00
Robert Phillips
38eb740b94 Remove SK_RASTER_RECORDER_IMPLEMENTATION
TBR=bsalomon@google.com
Change-Id: I9608ce5ce2b9d38c5e356d8428a8ff05df6ccda7
Reviewed-on: https://skia-review.googlesource.com/114490
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-15 12:55:06 +00:00
Greg Daniel
0fe4ed8598 Revert "ccpr: Unblacklist vulkan"
This reverts commit 30ce2a3620.

Reason for revert: Crashing drivers on intel and powerVR. Possible SPIR-V error

Original change's description:
> ccpr: Unblacklist vulkan
> 
> All issues have been resolved.
> 
> Bug: skia:
> Change-Id: Id63d63ad081725885cb0225b410b0d3972abd8f7
> Reviewed-on: https://skia-review.googlesource.com/113060
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ibb9ea75cc0fbe2db0ff11a8b22bac8f47242f775
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/114540
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-15 12:27:37 +00:00
Greg Daniel
057627f6f1 Make sure we set correct GrPixelConfig in promise images
Land just the Promise image fixes from, https://skia-review.googlesource.com/c/skia/+/114261

Bug: skia:
Change-Id: I917cf2c1f5c6e51f9d7f1d3ec4526db551e89d84
Reviewed-on: https://skia-review.googlesource.com/114472
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-15 12:22:16 +00:00
Chris Dalton
30ce2a3620 ccpr: Unblacklist vulkan
All issues have been resolved.

Bug: skia:
Change-Id: Id63d63ad081725885cb0225b410b0d3972abd8f7
Reviewed-on: https://skia-review.googlesource.com/113060
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-15 04:14:46 +00:00
Hal Canary
96f3a42a92 GrGLES: clean up android_get_gl_proc
Change-Id: Ia65b582d17c80e27574042c02363ec75bafcb0db
Reviewed-on: https://skia-review.googlesource.com/114440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-03-14 21:26:25 +00:00
Greg Daniel
56008aac75 Add SkColorType getter on SkImage.
Bug: skia:
Change-Id: I131fb5f7faf3f54e0eb6d31b800d224e6d4963ce
Reviewed-on: https://skia-review.googlesource.com/114464
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 20:10:49 +00:00
Greg Daniel
a421112ac4 Reland "Add back missing unique key checks when creating CachedBitmap/Image Proxies"
This reverts commit 4f57eb8002.

Reason for revert: Doesn't look to be cause of chrome roll failures

Original change's description:
> Revert "Add back missing unique key checks when creating CachedBitmap/Image Proxies"
> 
> This reverts commit b78dd5d01e.
> 
> Reason for revert: possibly breaking chrome roll
> 
> Original change's description:
> > Add back missing unique key checks when creating CachedBitmap/Image Proxies
> > 
> > Its possible that this could fix perf regression in Chrome.
> > 
> > Bug: 811452
> > Change-Id: I2d4f7827092b361469586580f0c7c843ab2d5cec
> > Reviewed-on: https://skia-review.googlesource.com/114280
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I71646befd07bf28442ac3b9225c021cd141bf398
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 811452
> Reviewed-on: https://skia-review.googlesource.com/114422
> 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: I957d66123bce150387a1ce6a80bcfc06c82d5fa1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 811452
Reviewed-on: https://skia-review.googlesource.com/114426
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 19:09:39 +00:00
Herb Derby
67c47f2329 Add glyph cache warming - prototype
A system for prewarming the cache using a single "RPC"
This improve performance by ~5X.

This is a checkin of rough code so I can use small
changes clean it up.

BUG=skia:7515

Change-Id: Id0192b4f533c257b0a7eea0170b1e25c336d6432
Reviewed-on: https://skia-review.googlesource.com/105440
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-03-14 18:50:39 +00:00
Ethan Nicholas
48e2405733 fixed SkSL SPIR-V vector comparisons
Bug: skia:
Change-Id: I57788fe427f62e20c6e073fd96279910febef22e
Reviewed-on: https://skia-review.googlesource.com/114367
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-03-14 18:18:51 +00:00
Herb Derby
efbf00c819 Add accessor and less for raw glyph ID and WS
Accessor is for debugging and Android.
Less is for ordered containers.

Change-Id: Ic4b7e0e9e32506f8594db961c274f93c5b5d1cee
Reviewed-on: https://skia-review.googlesource.com/114369
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-03-14 18:03:11 +00:00
Chris Dalton
85fcfc59b0 Add incompleteShortIntPrecision to SkSL StandaloneShaderCaps
TBR=ethannicholas@google.com

Bug: skia:
Change-Id: If3b86e414d74072dd3e38a5507bbcbcecc3946f6
Reviewed-on: https://skia-review.googlesource.com/114378
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-03-14 18:00:31 +00:00
Greg Daniel
8a3f55c659 Revert "Improve handling of GrPixelConfig in GrBackendTex/RT ctors"
This reverts commit 7d2b16ad13.

Reason for revert: Maybe breaking chrome?

Original change's description:
> Improve handling of GrPixelConfig in GrBackendTex/RT ctors
> 
> Make sure that no client facing code was relying on what we set as the
> default value for fConfig by making in kUnkown.
> 
> Bug: skia:
> Change-Id: Ie52ff08ba8deeacc16fe06eb0dd0c7292b2edf91
> Reviewed-on: https://skia-review.googlesource.com/114261
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 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: I91e190d72407f9c4bee93a031a557f740bb49b66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/114423
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 17:32:41 +00:00
Mike Reed
1be1f8d097 hide SkBlurMaskFilter and SkBlurQuality
SK_SUPPORT_LEGACY_BLURMASKFILTER

Bug: skia:
Change-Id: Ic3e27e08e6e3cd2ffc1cd13b044e197bebc96236
Reviewed-on: https://skia-review.googlesource.com/113940
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-03-14 17:27:36 +00:00
Herb Derby
c29c76aae5 Experiment: relax 4 byte alignment for glyph images
This experiment remove the need for rowbytes to be
4 byte aligned in width. This causes waste in data
transfer between the Renderer and GPU process.

BUG=skia:7515

Change-Id: Iad0383ee0adbacaa791bf4251325867e82fdbea1
Reviewed-on: https://skia-review.googlesource.com/114371
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-03-14 17:26:11 +00:00
Greg Daniel
4f57eb8002 Revert "Add back missing unique key checks when creating CachedBitmap/Image Proxies"
This reverts commit b78dd5d01e.

Reason for revert: possibly breaking chrome roll

Original change's description:
> Add back missing unique key checks when creating CachedBitmap/Image Proxies
> 
> Its possible that this could fix perf regression in Chrome.
> 
> Bug: 811452
> Change-Id: I2d4f7827092b361469586580f0c7c843ab2d5cec
> Reviewed-on: https://skia-review.googlesource.com/114280
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I71646befd07bf28442ac3b9225c021cd141bf398
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 811452
Reviewed-on: https://skia-review.googlesource.com/114422
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 17:22:32 +00:00
Chris Dalton
04a1de5545 ccpr: Add an attenuation parameter to triangle corners
Adds an attenuation parameter to corners that corrects the over-coverage
from linear interpolation.

Adds a GM for shared corners that ensures we're doing this right.

Bug: skia:
Change-Id: Iff8bd40554f9fda2e7e03faa3c9fbefe65f27568
Reviewed-on: https://skia-review.googlesource.com/114272
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-03-14 16:38:40 +00:00
Chris Dalton
c2d0dd658b Add a shader cap for incomplete short int precision
Bug: skia:
Change-Id: Iac36eb763e687f6ecc3acbd4afced66f95596be2
Reviewed-on: https://skia-review.googlesource.com/109003
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-03-14 16:35:50 +00:00
Robert Phillips
e4aae34f4f Provide promise images when rendering SKPs w/ DDL
Change-Id: I8014693eefb3c7811a1fc0354ee8441c90c97328
Reviewed-on: https://skia-review.googlesource.com/113213
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-14 15:00:12 +00:00
Brian Salomon
8a37583af5 Ensure that GrGpu state tracking is initialized before making a backend RT/Tex in tests
Change-Id: Ie5692d97678705306f514d5911bf331f784e7a40
Reviewed-on: https://skia-review.googlesource.com/114288
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-14 14:50:42 +00:00
Mike Reed
253258419b add explicit API to know if the writebuffer is using its external storage
To help with https://skia-review.googlesource.com/c/skia/+/114262

Bug: skia:
Change-Id: I83fcccdec0dbaef28d0e557ea6fb9bd0ed59ed44
Reviewed-on: https://skia-review.googlesource.com/114284
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-03-14 14:20:42 +00:00
Greg Daniel
7d2b16ad13 Improve handling of GrPixelConfig in GrBackendTex/RT ctors
Make sure that no client facing code was relying on what we set as the
default value for fConfig by making in kUnkown.

Bug: skia:
Change-Id: Ie52ff08ba8deeacc16fe06eb0dd0c7292b2edf91
Reviewed-on: https://skia-review.googlesource.com/114261
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 14:12:42 +00:00
Greg Daniel
b78dd5d01e Add back missing unique key checks when creating CachedBitmap/Image Proxies
Its possible that this could fix perf regression in Chrome.

Bug: 811452
Change-Id: I2d4f7827092b361469586580f0c7c843ab2d5cec
Reviewed-on: https://skia-review.googlesource.com/114280
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-14 14:09:13 +00:00
Mike Klein
d8853ec0fd exact divide by 255 with NEON
Change-Id: Ib121eb0d5af1f22f48f517fe909112a77d92032e
Reviewed-on: https://skia-review.googlesource.com/113666
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-03-14 02:38:52 +00:00
Herb Derby
ba321b6017 Cleanup size calculations in SkGlyph
BUG=skia:7515

Change-Id: Ie9d255a93ecff86ce018f8510332bdb280ec575e
Reviewed-on: https://skia-review.googlesource.com/113863
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-03-14 02:12:42 +00:00
Ben Wagner
f8a131dd47 Compile with GCC 7.2.0.
This suppresses the noexcept-type warning, since Skia doesn't have a
stable ABI in any event. GCC now warns on more printf style formats,
so we have to hide our bad test formats a little better. GCC now
also warns on implicit enum to bool conversions, which did catch two
issues.

Change-Id: Ib81769c421757186506873f0fe298ecd0106ae87
Reviewed-on: https://skia-review.googlesource.com/114263
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-03-13 22:18:18 +00:00
Florin Malita
40481bb392 Harden initial LinearGradient4f tiling
Even with verified/finite inputs, fx can sometimes collapse to infinity.

When that happens, attempting to apply repeat/mirror tiling produces NaN
results and things go south.

Catch these degenerate cases and tile to 0 (for lack of a better idea).

Note: leaving fx == +/- inf in clamp mode should be safe.

BUG=oss-fuzz:6622

Change-Id: I65711020057856b47045f67a52d906336ad1f173
Reviewed-on: https://skia-review.googlesource.com/114090
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-03-13 21:56:08 +00:00
Cary Clark
7eddfb8656 consolidate SaveLayerFlag internal references
Add a third define in SkCanvasPriv to complement
SkCanvas::kDontClipToLayer_PrivateSaveLayerFlag and
SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag.

SkCanvas::kDontClipToLayer_PrivateSaveLayerFlag exists only to define
SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag and
SkCanvasPriv::kDontClipToLayer_SaveLayerFlag.

SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag is used only by
Android framework.

SkCanvasPriv::kDontClipToLayer_SaveLayerFlag is used internally.

Note that changes to CanvasStateTest.cpp inside
SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG aren't testable by existing
skiabots; it requires building an Android framework aware version
of dm. CanvasStateTest.cpp may have bit-rotted.

R=reed@google.com,scroggo@google.com
Bug: skia:6454,skia:7690
Change-Id: I74f2a54636fae89a5a88a7e13f1baba49d3e2115
Reviewed-on: https://skia-review.googlesource.com/112401
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-03-13 19:36:12 +00:00
Ben Wagner
c582827b76 Include correct trace.h.
SkTraceEventCommon.h currently includes <utils/Trace.h>, but doesn't
actually use anything directly from it. In addition, Skia doesn't
directly depend on libutils, but instead on libcutils. As a result,
replace the <utils/Trace.h> include with <cutils/trace.h> which is what
actually provides all the needed macros and declarations.

Change-Id: Ic6a7283c71fc94058f735b1b3e541fec3a7db760
Reviewed-on: https://skia-review.googlesource.com/114099
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-03-13 18:29:42 +00:00
Brian Salomon
296de50b4c Fix possible overflows in hair line path renderer vertex counts
Bug: chromium:820913
Change-Id: I77f9b40cf6173369a4a1b943d71734c305893e09
Reviewed-on: https://skia-review.googlesource.com/114140
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-13 17:42:32 +00:00
Ethan Nicholas
98ad5b7a4b Fixed some shader cache issues
We now check GL_NUM_SHADER_BINARY_FORMATS to ensure that it is greater
than zero, and handle errors that occur when we try to install a
cached shader by falling back to using GLSL.

Bug: skia:
Change-Id: I1ac46243e9c561d15e1b4190b68afbf514fc8079
Reviewed-on: https://skia-review.googlesource.com/113820
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-03-13 16:36:02 +00:00
Leon Scroggins III
0118e9756d Remove calls to computeOutputColor- Type and Space
Bug: b/70846442
Test: I5110881203c000474116a94a48f2afc9a9b62001

These methods were already called by the client. The client may have
further overridden the SkColorType (and therefore the SkColorSpace), so
respect their final decision on both.

Change-Id: Iddcf618e474784b0a000fd516250c44285dacc6b
Reviewed-on: https://skia-review.googlesource.com/114062
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-03-13 15:42:52 +00:00
Brian Salomon
52e943a469 Add testing-only backend render target support to GrVkGpu.
Update unit tests to use backend render targets on non-GL contexts

Add named DM configs for rendering to Vulkan backend render targets and textures.

Make src data ptr param to createTestingOnlyBackendTexture be const.

Change-Id: I17f5375ed9bb08422006698956469d3151c4954c
Reviewed-on: https://skia-review.googlesource.com/113276
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-13 15:02:57 +00:00
Cary Clark
65247e595d avoid divide by zero
R=kjlubick@google.com
Bug: skia:7623
Change-Id: Ia9fb31201a39a4540d94f97e8d2f06eb290ab6e5
Reviewed-on: https://skia-review.googlesource.com/114082
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-03-13 15:01:43 +00:00