Commit Graph

22519 Commits

Author SHA1 Message Date
Jim Van Verth
2a330e689b Check for zero offsets for PolyUtils
Bug: oss-fuzz:13202
Change-Id: Iee0ec8bdfe6345c91a584607cc499d69d227a919
Reviewed-on: https://skia-review.googlesource.com/c/194422
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-25 16:11:06 +00:00
Mike Reed
5532c2a34f fill the layer if there is a backdrop filter
Bug: skia:8783
Change-Id: I92448382117b1bd05a0ad5cf7ecd72181631389b
Reviewed-on: https://skia-review.googlesource.com/c/194601
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-25 15:32:36 +00:00
Nigel Tao
e3b205b120 Update Wuffs version
Bug: skia:8764
Bug: skia:8767
Bug: skia:8764

This pulls in the Wuffs bug fix:
ab7d6de318
"Let Wuffs compile with MSVC (Microsoft Visual C++)".

This also pulls in fixes for
https://github.com/google/wuffs/issues/20
"Check for "not enough pixel data" and return an Error or Warning"

Change-Id: Ie75e57504f1ec872418e8851e10de9159f714bc5
Reviewed-on: https://skia-review.googlesource.com/c/193200
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-25 15:25:36 +00:00
Herb Derby
90ec9fbbf2 Change SDFT to use a bulk api for the callback
Change-Id: I280b11d134c1b1b03f979cc80a087fe176f659e5
Reviewed-on: https://skia-review.googlesource.com/c/194425
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-22 22:17:29 +00:00
Ben Wagner
86c9c95b2e Compare to the correct hinting.
Without this change no-hinting subpixel-antialias requests on Mac 10.14
will not be gamma adjusted when they should be.

Bug: chromium:933137

Change-Id: I666f9f37ac849ed76a6b6aaab4966f4dd9fb5fb3
Reviewed-on: https://skia-review.googlesource.com/c/194188
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-02-22 20:11:25 +00:00
Leon Scroggins III
8546335d2d Allow setting an SkColorSpace on SkAnimatedImage
Add a new constructor which merges the SkISize scaledSize with the
SkImageInfo. This allows passing an SkColorSpace to the decode.

Update the test to call the new API.

Bug: b/123301872
Change-Id: I9fd89198e97ac9b8e6dc9fcfe89ed38913a0fe69
Reviewed-on: https://skia-review.googlesource.com/c/189303
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-22 18:58:05 +00:00
Ethan Nicholas
ee1c8a733e Revert "Revert "SkSL now supports null child processors""
This reverts commit bce7d86270.

Bug: skia:
Change-Id: I3ccaf47b3d4b9dcb9e049671117183a374526032
Reviewed-on: https://skia-review.googlesource.com/c/194185
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-22 17:50:30 +00:00
Robert Phillips
6989370877 Move DrawingManager to RecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I278fe9d321f8e0a4f5e9b489b1a5cc01b8974521
Reviewed-on: https://skia-review.googlesource.com/c/191287
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-22 17:25:00 +00:00
Greg Daniel
59dc1481a0 Track GrVkResources in command buffer associated with pipeline barriers.
This makes sure we don't call the release proc on an external image before
the transition to the external queue finishes on the gpu.

Bug: skia:
Change-Id: I35b0e3899fcd859cd5ccaa57df9427a47d434210
Reviewed-on: https://skia-review.googlesource.com/c/194004
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-22 16:56:37 +00:00
Brian Salomon
8cabb327e7 Make it safe to enter the cache from a GrTexture idle proc.
This fixes an issue in Chrome where Skia is calling a promise SkImage
texture release proc from ~SkImage that in turn flushes a SkSurface.
Prior to this change this caused an assert because we had already
decremented the GrTexture's ref count priot to calling the release
proc. This made the GrTexture purgeable, but the cache had not yet
been notified that the texture was purgeable and still had it in its
array of non-purgeable resources. This triggered an assert in the
cache's self-validation checks during the flush.

Now we call the release proc just prior to decrementing the ref count.
This also makes it legal to re-ref the resources from the release proc.

Bug: chromium:933526
Change-Id: I8cd921b77ca3dfe112089f9a553c1a625160d16d
Reviewed-on: https://skia-review.googlesource.com/c/194000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-22 16:12:35 +00:00
Tom Anderson
b1beba53b7 Make SkFontConfigInterface_direct and sysroot-aware
CL [1] adds support for setting the fontconfig sysroot with an environment
variable.  Chromium plans on using this in tests.

The string returned when getting the FC_FILE property is relative to the
sysroot, so to get the full path, the sysroot must be prepended.

[1] https://cgit.freedesktop.org/fontconfig/commit/?id=730deada8cf609157d07b7c2bf2985672614c4c0

Bug: chromium:822737,chromium:908463
R=bungeman
Change-Id: I6d9dfbb3bdc6bdcd2aab73e757dcef46ae9229e4
Reviewed-on: https://skia-review.googlesource.com/c/127108
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-22 15:03:54 +00:00
Robert Phillips
2184fb7bbd Move StrikeCache and TextBlobCache to RecordingContext
TBR=bsalomon@google.com
Change-Id: I09a918eee4fab2091b0cbbbe83bc66418e43045e
Reviewed-on: https://skia-review.googlesource.com/c/193471
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-21 23:01:32 +00:00
Robert Phillips
bce7d86270 Revert "SkSL now supports null child processors"
This reverts commit 0e8dc4ce36.

Reason for revert: ASAN complaints

Original change's description:
> SkSL now supports null child processors
> 
> Bug: skia:
> Change-Id: Icb3f2d57b393e3d40247aaad98c17344b507f0d7
> Reviewed-on: https://skia-review.googlesource.com/c/193379
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org

Change-Id: Ibf739b3c6afd32d44f6b20705922618c29960d16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/194020
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-21 22:54:08 +00:00
Chris Dalton
298238a848 vk: Hold refs to sampled textures as opposed to raw ptrs
Bug: skia:8776
Change-Id: Ie2956d0d6df627b7689bfc2765173e1042563d28
Reviewed-on: https://skia-review.googlesource.com/c/194006
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-21 22:19:42 +00:00
Ethan Nicholas
0e8dc4ce36 SkSL now supports null child processors
Bug: skia:
Change-Id: Icb3f2d57b393e3d40247aaad98c17344b507f0d7
Reviewed-on: https://skia-review.googlesource.com/c/193379
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-21 21:50:32 +00:00
Mike Klein
63c4d35969 Revert "remove linear sRGB singleton"
This reverts commit b03b80066b.

Reason for revert:  !@#$%^&*

Original change's description:
> remove linear sRGB singleton
> 
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Change-Id: I01e2515cfa8e5356ee862ea7184bb7ceb4c9176f
> Reviewed-on: https://skia-review.googlesource.com/c/192038
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ic88368e193aaa48b9aa6d3a6c145377681b2a5db
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/194005
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-21 21:16:16 +00:00
Leon Scroggins III
3d86ff86d7 Remove SK_SUPPORT_LEGACY_ANDROID_CODEC_COLORSPACE
Bug: b/123377741

Android no longer defines this flag, so remove the dead code.

Change-Id: I35bce8a0677ee86730effa6be297ad9718cee1c2
Reviewed-on: https://skia-review.googlesource.com/c/194001
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-02-21 19:28:02 +00:00
Greg Daniel
89df78400a Return correct GrBackendFormat when ycbcr conversion is valid.
Bug: skia:
Change-Id: Ieb24c0169a150c153a468fbbe9a8f60766516860
Reviewed-on: https://skia-review.googlesource.com/c/193698
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-21 18:05:02 +00:00
Mike Klein
b03b80066b remove linear sRGB singleton
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I01e2515cfa8e5356ee862ea7184bb7ceb4c9176f
Reviewed-on: https://skia-review.googlesource.com/c/192038
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-21 17:31:12 +00:00
Mike Reed
8cca7a4314 remove old code behind SK_SUPPORT_LEGACY_SETLENGTH
Bug: skia:
Change-Id: Ie47c9973e0981e8dd104fd6faf874d2ccf487093
Reviewed-on: https://skia-review.googlesource.com/c/193689
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-21 15:47:11 +00:00
Mike Reed
20ebd0cb38 remove SK_SUPPORT_LEGACY_TEXTBLOBCACHEDIFFCANVAS_CONSTRUCTOR code
Bug: skia:8773
Change-Id: I36cdce15be46384909d1670749ab184871135252
Reviewed-on: https://skia-review.googlesource.com/c/193820
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-21 00:31:31 +00:00
Michael Ludwig
ddeed37bf8 Support decal mode in GrTextureProducer
Bug: skia:
Change-Id: I9dab07c527f20d58896b17d6c3ea4e632835db3b
Reviewed-on: https://skia-review.googlesource.com/c/193366
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-20 22:22:10 +00:00
Ethan Nicholas
6dcc325f35 fixed SkSL parser unary expression recursion depth limit
Bug: 892506
Change-Id: I244532ee80617dd5f0bbdd2184ccec7325a219f2
Reviewed-on: https://skia-review.googlesource.com/c/193584
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-20 21:03:15 +00:00
Greg Daniel
216a9d7c3b Fix setting of GL texture swizzle when using 1 for swizzle.
Bug: skia:
Change-Id: I96a128fa0bad282ae4566a6cb967d0de459448b1
Reviewed-on: https://skia-review.googlesource.com/c/193467
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-20 16:24:20 +00:00
Herb Derby
881c962762 Break up InitDistanceFieldPaint
Break InitDistanceFieldPaint along code that is common and,
code that is specific to GPU.

Change-Id: Ic831491829fe402a46f4e612c2598d987ae19c8c
Reviewed-on: https://skia-review.googlesource.com/c/193371
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-20 15:40:09 +00:00
Robert Phillips
bc42944741 Switch image filters over to GrRecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Note that special images and surfaces are only created when drawing so they get GrRecordingContexts.

Change-Id: I1493c32604a2cbd8054c916334fa1186f3bfd918
Reviewed-on: https://skia-review.googlesource.com/c/192822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-20 14:05:48 +00:00
Mike Reed
f922c783fd add colorspace param to textblobdiff canvas
Bug: skia:8773
Change-Id: Ib5d04e02a1568ad8a2b3f1baccb9544515f772f9
Reviewed-on: https://skia-review.googlesource.com/c/193373
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-20 04:52:48 +00:00
Ben Wagner
b059194c08 Make SkShaper an interface.
The interface here is not ideal, but there will need to be some build
clean-up before it can be changed.

Change-Id: Ic4d55634405f4c8d9c194e4e6f368287c9669dcd
Reviewed-on: https://skia-review.googlesource.com/c/193036
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-19 22:06:47 +00:00
Michael Ludwig
3e2cc0673c Only perform matrix concat when actually logging histograms
Bug: skia:
Change-Id: I61a710b570601d0d1178cf1dbe0d46d20872e9f1
Reviewed-on: https://skia-review.googlesource.com/c/193364
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 21:11:37 +00:00
Herb Derby
78540b9569 Clarify parameter naming for setMinAndMaxScale
Change-Id: I6313aa977a7394481a57446d07e57040f8ff3f6f
Reviewed-on: https://skia-review.googlesource.com/c/193369
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-02-19 20:33:27 +00:00
Michael Ludwig
ce62dec022 Add general quad methods to GrRTC
Refactor compositor GM to use GrRTC directly instead of adding draw ops.
Adds a test row for using drawTextureSet now that it takes dst clips.

Bug: skia:
Change-Id: I6863ef1286cab0f0e5cf989e4aaef8ff2ca0abb8
Reviewed-on: https://skia-review.googlesource.com/c/193023
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 18:54:40 +00:00
Robert Phillips
9338c60013 Switch FP creation over to GrRecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I925030c818f00559d4c953ae07af53667b44aab9
Reviewed-on: https://skia-review.googlesource.com/c/192032
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 18:24:27 +00:00
Michael Ludwig
136f45a636 Formalize edge-aa interaction with GrAA
With this formalization, the edge-AA APIs in GrRTC can distinguish
between tiling cases and regular drawing cases implemented using
kNone or kAll for the AA flags. This means fillRectToRect can be
implemented in terms of fillRectWithEdgeAA.

It also means the drawTexture cases will properly handle
isolated draws and tiled draws when drawing into MSAA.

Bug: skia:
Change-Id: I248dd001919228a958cf84b6bc91363b58b72c0b
Reviewed-on: https://skia-review.googlesource.com/c/192023
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 17:49:57 +00:00
Mike Reed
c9c52548b7 simplify even more the new setlength impl
Bug: skia:
Change-Id: I160de9807369125d49774deefd1402c5a39ae41f
Reviewed-on: https://skia-review.googlesource.com/c/193360
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-19 16:10:42 +00:00
Hal Canary
90791e27d8 SkPaint: make bitfield defaults more explicit
Change-Id: I7008a5c7f00fab43a28e3623ae8943ed76440ce3
Reviewed-on: https://skia-review.googlesource.com/c/193177
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-19 15:29:42 +00:00
Michael Ludwig
009b92e3aa Add general quad factories to GrFillRectOp and GrTextureOp
Bug: skia:
Change-Id: I1f9e9013d20496554891b72749ed9b0844747566
Reviewed-on: https://skia-review.googlesource.com/c/191570
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-19 15:11:02 +00:00
Mike Reed
b2101503c7 check math in stroker
Fixes asan complaint in test_CubicStrokerUnbounded

Bug: skia:
Change-Id: I1a4bde4e170d60877feca3013d193042fc0c6694
Reviewed-on: https://skia-review.googlesource.com/c/193176
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-19 14:31:11 +00:00
Leon Scroggins III
4407636943 SkWuffsCodec: Initialize when incomplete part 3
Bug: skia:8767
Bug: oss-fuzz:13020

Follow on to https://skia-review.googlesource.com/c/skia/+/189866
Even if the dirty_rect is not empty, it's possible there is still some
memory we need to initialize. No need to look at the dirty_rect at all;
if the image is interlaced, the dirty_rect could fill the frame even if
it doesn't touch all rows.

Restore the old location of dirty_rect. It is no longer needed this early.

Change-Id: Ie571a80dda3b83f248d87188dbaf139f94c17252
Reviewed-on: https://skia-review.googlesource.com/c/193027
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-19 13:57:11 +00:00
Mike Reed
d6c69d2163 Experiment: always use doubles for setLength
Should allow more stroke cases to succeed, and simplifies the impl.

Bug: oss-fuzz:6811
Change-Id: I53390f57372938ba6d732726486a567c26ff121f
Reviewed-on: https://skia-review.googlesource.com/c/131140
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-18 21:54:38 +00:00
Florin Malita
6cd8234293 Simplify optional input handling in SkMixerColorFilter
When the first input is null, swap with the second - this allows the
implementation to assume CF0 != null.

TBR=
Change-Id: I9b3d0aeecaffed3b56f8956138305b17d33eb1de
Reviewed-on: https://skia-review.googlesource.com/c/193164
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-16 21:11:09 +00:00
Robert Phillips
1efecea71f Make asFragmentProcessor entry point only take a GrRecordingContext (take 2)
This is split out of: https://skia-review.googlesource.com/c/skia/+/192032 (Switch FP creation over to GrRecordingContext)

TBR=bsalomon@google.com

Change-Id: Iebe8dce00abf09485717f59daae1bfeb8ba6d5bc
Reviewed-on: https://skia-review.googlesource.com/c/193160
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-16 14:07:50 +00:00
Herb Derby
b7c7b7883b Remove all empty glyph processing
The empty glyph processing is no longer needed since moving
the SkRemoteGlyphsCache to using getGlyphMetrics for tracking
glyph cache changes.

Change-Id: Iacf218b7d6eccc924181ea086792c0e8d7922ba0
Reviewed-on: https://skia-review.googlesource.com/c/193033
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-15 22:39:20 +00:00
Robert Phillips
a7f0013eca Revert "Make asFragmentProcessor entry point only take a GrRecordingContext"
This reverts commit e821d21e41.

Reason for revert: enh

Original change's description:
> Make asFragmentProcessor entry point only take a GrRecordingContext
> 
> This is split out of: https://skia-review.googlesource.com/c/skia/+/192032 (Switch FP creation over to GrRecordingContext)
> 
> TBR=bsalomon@google.com
> Change-Id: I48a5667b1ca31d5648571083fcda76564fae939b
> Reviewed-on: https://skia-review.googlesource.com/c/192687
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I9041b3479ef5004f14eb5a97c0e25e60f8b8ba14
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/193039
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 21:54:20 +00:00
Mike Reed
9407e24c29 make float more primary API for paint (esp. for alpha)
Bug: skia:8773
Change-Id: I82b1f22f300eadc93f79a35a1638b7eb6376169a
Reviewed-on: https://skia-review.googlesource.com/c/193031
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-15 21:50:16 +00:00
Robert Phillips
e821d21e41 Make asFragmentProcessor entry point only take a GrRecordingContext
This is split out of: https://skia-review.googlesource.com/c/skia/+/192032 (Switch FP creation over to GrRecordingContext)

TBR=bsalomon@google.com
Change-Id: I48a5667b1ca31d5648571083fcda76564fae939b
Reviewed-on: https://skia-review.googlesource.com/c/192687
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-15 21:39:43 +00:00
Robert Phillips
d44146b2da Switch GrSurfaceProxy's Copy methods over to GrRecordingContext
Fragment broken out of: https://skia-review.googlesource.com/c/skia/+/192822 (Switch image filters over to GrRecordingContext)

Change-Id: Iddb9d10b686201820685d1650144b4444b14b6bf
Reviewed-on: https://skia-review.googlesource.com/c/193030
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 20:50:43 +00:00
Robert Phillips
6a6de56655 Begin switching GrRecordingContext over to having the GrDrawingManager
The change forces the GrDrawingManager to only being able to access a GrRecordingContext.

Note that, like the ProxyProvider, the drawingManager still behaves differently if it is being used to directly render. In this case, the biggest difference is that the flush methods are disabled when DDL recording.

This pulls as much as possible out of https://skia-review.googlesource.com/c/skia/+/191287 (Move DrawingManager to RecordingContext) while keeping the drawingManager in the GrContext.

Change-Id: I1e5305fe0cb17ee0b243bfb8622f652310fc0507
Reviewed-on: https://skia-review.googlesource.com/c/192881
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 20:50:33 +00:00
Robert Phillips
c5058a61ae Add addOnFlushCallbackObject at GrRecordingContext level
The GrRecordingContext will (eventually) hold the drawManager so it is natural that it should accept onFlushCB objects

Change-Id: I48dc876bd18e5d5ebea75c33498e75faba1a0feb
Reviewed-on: https://skia-review.googlesource.com/c/193025
Auto-Submit: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-15 20:29:43 +00:00
Herb Derby
5a9c12002e Revert of CL/192440 which would not reland cleanly.
This is a revert of the following revert...

This reverts commit b5c1a79b55.

Reason for revert: Based on bad CL 192424

Original change's description:
> Calculate strike in path case
>
> Change-Id: I9036b23df7279003a41f6189117fb7dec784ee2a
> Reviewed-on: https://skia-review.googlesource.com/c/192440
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I322c45b6deb9ffa4cde567f02c55fcd6971fefc1
Reviewed-on: https://skia-review.googlesource.com/c/192882
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-15 19:26:03 +00:00
Florin Malita
f2965060c3 add mixer colorfilter
BUG=skia:

Change-Id: Icbee96056b17c5396a9d3783055ddd0b7d4fd3ff
Reviewed-on: https://skia-review.googlesource.com/c/9514
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-15 19:22:33 +00:00
Chris Dalton
4f5cbcdcb8 Remove shader caps argument from GrGLSLTypeString
Bug: skia:
Change-Id: I5a848055b5d59df24365992dcd259ec9bd0f8c61
Reviewed-on: https://skia-review.googlesource.com/c/192083
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-15 18:42:03 +00:00
Robert Phillips
7e90be9845 Stop using resourceProvider in GrRenderTargetContext's ctor
Change-Id: Iec4a4f2b6a9c4810e77e81bec6fe43d1afa0950e
Reviewed-on: https://skia-review.googlesource.com/c/193022
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-15 18:31:33 +00:00
Robert Phillips
be9aff25bd Remove GrContextPriv.h from GrRenderTargetContext.h
Change-Id: Ib3afe6d8f2f9607eededb4dd4ef9dbe305741cfb
Reviewed-on: https://skia-review.googlesource.com/c/192829
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 17:29:03 +00:00
Herbert Derby
b27cc444b7 Reland "Use bulk interface for paths"
This is a reland of 5b83d05bf4

In the original, the outline was calculated using the glyph's
position, which included the subpixel adjustment. It should have
been calculated at {0, 0} because all transformations including
subpixel placmenet happen while drawing.

Original change's description:
> Use bulk interface for paths
>
> Change-Id: I3a73f3b181542588470e3ce2c03d147423fef5cd
> Reviewed-on: https://skia-review.googlesource.com/c/192424
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: Id4987a8d0122ce73cae9ade33b853b1a9d080d1f
Reviewed-on: https://skia-review.googlesource.com/c/193021
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-15 17:25:13 +00:00
Hal Canary
75d4898a27 SkPDF: simplify subsetting code
move all compile-time logic into src/pdf/SkPDFFont.cpp

Change-Id: Ic983065ba7ab7f9e108e03b0065db8f4735ab9ca
Reviewed-on: https://skia-review.googlesource.com/c/192830
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-15 17:07:12 +00:00
Herb Derby
92d1912142 Revert "Use bulk interface for paths"
This reverts commit 5b83d05bf4.

Reason for revert: Unexpected GM changes

Original change's description:
> Use bulk interface for paths
> 
> Change-Id: I3a73f3b181542588470e3ce2c03d147423fef5cd
> Reviewed-on: https://skia-review.googlesource.com/c/192424
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: Iaf4feba65c7c60ef2d9fea7189a415e6d48c4aa9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/192833
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-15 16:31:14 +00:00
Herb Derby
5f5a016b1b Revert "Calculate strike in path case"
This reverts commit b5c1a79b55.

Reason for revert: Based on bad CL 192424

Original change's description:
> Calculate strike in path case
> 
> Change-Id: I9036b23df7279003a41f6189117fb7dec784ee2a
> Reviewed-on: https://skia-review.googlesource.com/c/192440
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: I218871efeff921663d4a2f26e04b4e0e41ca42ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/192831
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-15 16:24:35 +00:00
Brian Salomon
28bafb01c9 Add option to force GLSL string caching rather than program binaries.
Bug: chromium:924572
Change-Id: I055a6946528c75fa986c86fa562a2608b8958611
Reviewed-on: https://skia-review.googlesource.com/c/192827
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-02-15 15:32:09 +00:00
Robert Phillips
7af8fe55bd Switch GPU blur code over to using GrRecordingContext
This is split out of: https://skia-review.googlesource.com/c/skia/+/191287 (Move DrawingManager to RecordingContext)

Change-Id: I305249f1e63bd4720264b0531733a219c79fe10a
Reviewed-on: https://skia-review.googlesource.com/c/192686
Auto-Submit: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-15 15:19:09 +00:00
Brian Salomon
c405c27b1a Remove unused fields related to old multitexturing TextureOp.
Change-Id: I6a48410f2203a0a88831d02713b9b7475fb6e5a6
Reviewed-on: https://skia-review.googlesource.com/c/192826
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-15 15:08:39 +00:00
Robert Phillips
292a6b2cf0 Allow GrRecordingContext to create surfaceContexts
This is pulled out of https://skia-review.googlesource.com/c/skia/+/191287 (Move DrawingManager to RecordingContext)

Change-Id: Iba16acd9295ef7ca9d8cc96d439a907050228b6b
Reviewed-on: https://skia-review.googlesource.com/c/192684
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-14 21:47:28 +00:00
Ben Wagner
83597ce581 Remove typeface from SkShaper constructor.
It isn't used anymore.

Change-Id: I4079ff9944aa2483a0cd42130d0e69fb98935731
Reviewed-on: https://skia-review.googlesource.com/c/192820
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-02-14 21:41:28 +00:00
Herbert Derby
b5c1a79b55 Calculate strike in path case
Change-Id: I9036b23df7279003a41f6189117fb7dec784ee2a
Reviewed-on: https://skia-review.googlesource.com/c/192440
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-14 21:37:48 +00:00
Michael Ludwig
e9c57d3ef5 Clean up GrQuad ctors
Refactor Sk4f transformations into reusable internal function.
Switches the SkRect+SkMatrix ctor to a factory method.
Adds simple constructors for Sk4fs and SkRects w/o transforms.

Bug: skia:
Change-Id: I88a4a5f7304b1cf00d68c7772bb0fc19c97abee3
Reviewed-on: https://skia-review.googlesource.com/c/191569
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-14 20:46:39 +00:00
Nigel Tao
490e647e23 Have Wuffs output to BGRA, not indexed color
This lets us set the yet-to-be-decoded pixels for a partially decoded
image to be transparent. Prior to this commit, we decoded to an indexed
color buffer, which was not guaranteed to be able to represent
transparent pixels.

This is also one step towards fewer post-decode passes. The current
model has multiple separate passes: SkSwizzler handles expanding pixel
indexes to BGRA and subsetting / scaling, SkWuffsCodec handles blending
potentially transparent pixels over the previous frame and skcms handles
color correction. The long term plan is to remove the SkSwizzler from
that chain.

Bug: skia:8235
Change-Id: I9651fb8ec7a7811dd2cd77b22c9527c8b8a9963d
Reviewed-on: https://skia-review.googlesource.com/c/177960
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-14 20:36:58 +00:00
Herbert Derby
5b83d05bf4 Use bulk interface for paths
Change-Id: I3a73f3b181542588470e3ce2c03d147423fef5cd
Reviewed-on: https://skia-review.googlesource.com/c/192424
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-14 20:29:08 +00:00
Brian Salomon
67f01951d0 Use destructors to free resources owned by lazy proxy callbacks
Change-Id: I103355f12e808c636803491c86d3c887113f088c
Reviewed-on: https://skia-review.googlesource.com/c/192541
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-14 19:25:45 +00:00
Ben Wagner
10f3c40674 Don't respect FontConfig matrix for bitmap fonts.
FontConfig provides 10-scale-bitmap-fonts.conf which applies an inverse
"pixelsize" matrix. It is not known if this .conf is active or not, so
it is not clear if "pixelsize" should be applied before this matrix.
Since using a matrix with a bitmap font isn't a great idea, only apply
the matrix to outline fonts.

Change-Id: I5500120d091e73712949453a328d27b44f03b0c7
Reviewed-on: https://skia-review.googlesource.com/c/192680
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-02-14 19:19:45 +00:00
Florin Malita
562017b086 [SVGCanvas] Clean up public factories
Remove the internal-only/XMLWriter-based factory.

Update SkSVGDevice to always own the xml writer.

The only internal client passing an interesting XMLWriter is
SVGDeviceTest - update to use the device factory directly.

While at it, update the SkSVGDevice factory to return smart pointers
(Create -> Make).

Change-Id: Ibda1ca86ef9fb81ab512822000835ace1af67978
Reviewed-on: https://skia-review.googlesource.com/c/192580
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-14 19:17:35 +00:00
Robert Phillips
bc4994a682 Baulk at creating wait semaphores if we can't always delete them
Change-Id: I4ddc988972b90ed182a1f11a83e2858c2ba4ae9f
Reviewed-on: https://skia-review.googlesource.com/c/192400
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-14 18:40:35 +00:00
Michael Ludwig
d54ca8f754 Add blendmode to GrRTC::drawTexture
This makes drawTexture handle blend modes with a fallback to be consistent
with drawTextureSet. Simple draws (other than non src-over) should be
faster now since they will skip the extra overhead of the GrTextureAdjuster.

It also refactors the GrPaint emulation of GrTextureOp into a function,
which will be reused in the general-purpose quad APIs.

Bug: skia:
Change-Id: Idad67ec749b82c6894df6ec2b57987130125b910
Reviewed-on: https://skia-review.googlesource.com/c/191360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-14 18:21:50 +00:00
Greg Daniel
4b06a92ce2 Use kRGB_888x_SkColorType when importing R8G8B8X8 AHB.
Bug: skia:
Change-Id: If32fa0c711dd33c78cd57c73475f74bdeb470d8b
Reviewed-on: https://skia-review.googlesource.com/c/192420
Reviewed-by: Stan Iliev <stani@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-14 18:10:05 +00:00
Greg Daniel
f259b8ba17 Add kRGB_888X_GrPixelConfig
This is needed to support importing of RGBX AHB into skia's vulkan backend.
With this CL we only enable the new pixel config to be textureable.

Bug: skia:
Change-Id: Iba9180c14f3ef633ae846091cf453d68f82ce544
Reviewed-on: https://skia-review.googlesource.com/c/192035
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-14 15:01:55 +00:00
KDr2
a0dcd29f53 Fix bug of the destructor of SkSVGDevice
When SkSVGDevice owns `fWriter`, we must ensure that `fRootElement`
is destructed before `fWriter`. Otherwise, while `fRootElement` is
destrcuting, it tries to write data into `fWriter` who is alreay
deleted.

This bug is introduced by
https://skia-review.googlesource.com/c/skia/+/192040.

Change-Id: Idbb998a3c25f6e0d731e5070fd9f9bdde3afcd1a
Reviewed-on: https://skia-review.googlesource.com/c/192301
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-14 13:32:34 +00:00
Mike Reed
1f63b51649 remove unused variable
Bug: skia:
Change-Id: I0300d5c0b616ed87426aa7329491cf1d2b8c58f2
Reviewed-on: https://skia-review.googlesource.com/c/192107
Reviewed-by: Nigel Tao <nigeltao@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-14 03:08:00 +00:00
KDr2
e77142e0d6 Fix bug of SkSVGCanvas::Make
The method `SkSVGCanvas::Make(const SkRect& bounds, SkWStream* writer)`
passes a pointer to a stack-allocated object to the returned SkCanvas.

TBR=
Change-Id: Ica7933adc59764a69eb2fb6312df91ffffd5627b
Reviewed-on: https://skia-review.googlesource.com/c/192040
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-14 02:09:30 +00:00
Herb Derby
afbe1c49d9 Remove empty processing from drawGlyphRunAsBMPWithPathFallback
Change-Id: I9946614342b4a3883b25f749f54dbfc97f3460d4
Reviewed-on: https://skia-review.googlesource.com/c/192104
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-13 23:48:00 +00:00
Brian Osman
5105d68f93 Use half-floats for out-of-gamut color in GrAAFillRRectOp
Bug: skia:
Change-Id: Id093f295708b1f6719bece9899ebadfb9a473e46
Reviewed-on: https://skia-review.googlesource.com/c/192101
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2019-02-13 21:41:19 +00:00
Nigel Tao
9859ef8d20 Keep scaledHeight calculation across oID calls
Prior to this commit, scaledHeight was only computed for the first
onIncrementalDecode call, and if y-sampling was requested, forgotten for
subsequent calls.

Bug: skia:8235
Change-Id: I87e8c2ba1b6a07b589841b0d7fbe9325f6bad76f
Reviewed-on: https://skia-review.googlesource.com/c/191880
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-13 20:38:39 +00:00
Herb Derby
a4c6487f6c Use SkStrikeSpec to consolidate SkDescriptor, Effects and Typeface.
Introduce SkStrikeSpec. Allow an SkStrikeInterface to return on
that represents the strike. Have GrTextBlob::Run::setFont() use
SkStrikeSpecs.

Misc Cleanups
* In SkStrikeCache::Node - rename fCache -> fStrike
* Parameter reformatting

Change-Id: I1b289e2cb4e5252d5c3cb776f3b2a31c6e1948b3
Reviewed-on: https://skia-review.googlesource.com/c/192029
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-13 18:48:39 +00:00
Mike Klein
65e841715e rewrite SkMasks::CreateMasks to work in bytesPerPixel
This ought to make it a bit more clear that undefined
shifts (like 1<<31, 1<<32, 1<<33) are not possible,
only 1<<8, 1<<16, 1<<24.

Change-Id: Ia358f9204e5956ba6c23603c5961af86a991b659
Reviewed-on: https://skia-review.googlesource.com/c/192030
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Greg Kaiser <gkaiser@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-13 18:48:09 +00:00
Mike Reed
62ad46b059 fix contour-measure for move-line-move
Use RawIter, so we can dependably peek() (since consumeDegenerates in
Iter() make peeking unreliable), which caused us to think there were two
real contours in the test case.

Bug: oss-fuzz:13013
Change-Id: I0d85f3e6a83cb972c4d801dd9b17f0e388b926d0
Reviewed-on: https://skia-review.googlesource.com/c/192025
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-02-13 17:14:09 +00:00
Robert Phillips
6f0e02f5d7 Switch path renderers over to using GrRecordingContext
The path renderers convert paths into Ganesh ops when recording so should also be able to make due with only the GrRecordingContext.

Change-Id: Ie796af73ca5aa2a074ebd037d6d558ec85ff5928
Reviewed-on: https://skia-review.googlesource.com/c/191568
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-13 16:58:29 +00:00
Mike Reed
ff1c49258f fix rawiter::peek
Bug: skia:
Change-Id: I27f1b788c0e89da41479e9ef379f5a8feb02ea8e
Reviewed-on: https://skia-review.googlesource.com/c/192028
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-13 16:16:48 +00:00
Robert Phillips
b97da530f0 Switch Ops over to using GrRecordingContext
Since, by definition, the ops are created when recording, it makes sense that they should be able to make due with only the GrRecordingContext.

TBR=bsalomon@google.com
Change-Id: If64353aee30b35d0a16401f7de00954f44ed8c59
Reviewed-on: https://skia-review.googlesource.com/c/190670
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-13 15:53:09 +00:00
Ethan Nicholas
ac285b1c2a added constant 0 and 1 swizzle components to SkSL
Bug: skia:
Change-Id: I8f4dce314ebe0d5de7ba032a435f362eeb14edc4
Reviewed-on: https://skia-review.googlesource.com/c/191565
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-13 14:43:07 +00:00
Herb Derby
883a9911b2 Inline allocateNewGlyph
allocateNewGlyph is used in a single place.

Change-Id: Iccf06d647dddf8fb90ea888c61e9cbb77304ec1f
Reviewed-on: https://skia-review.googlesource.com/c/191665
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-12 22:28:48 +00:00
Herb Derby
14d64dd4c4 Remove unneeded SkPackedUnicharID
Change-Id: I85334081f3b114dc0855adcbee4156247fd457bb
Reviewed-on: https://skia-review.googlesource.com/c/191720
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-12 20:15:13 +00:00
Hal Canary
59cf562826 SkPaint: clean up ctor, dtor, etc
Change-Id: I5a333112f68fcd001f39e646570a246875c03bc3
Reviewed-on: https://skia-review.googlesource.com/c/191566
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-02-12 18:55:30 +00:00
Ben Wagner
da5df741c0 Make SkSpan C++11 compatible.
In C++11 constexpr operators cannot be defaulted.

Change-Id: Ibc73d9b9291f3e1a45bb5c0a7ff59c2b90a3e380
Reviewed-on: https://skia-review.googlesource.com/c/191567
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-12 17:02:10 +00:00
Herbert Derby
249b40e9de Remove redundant fGlyphMap.set
allocateNewGlyph calls fGlyphMap.set. No reason to call it again in lookupPackedGlyphID.

Change-Id: I3724094de6a76a9c5e9f11a1808b14c3dd50b64e
Reviewed-on: https://skia-review.googlesource.com/c/191561
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-12 16:38:30 +00:00
Ethan Nicholas
0dc8087e91 SkSL Metal backend can now handle CCPR
Bug: skia:
Change-Id: I796a40db46174b405495af8234c5b8d7920a46d6
Reviewed-on: https://skia-review.googlesource.com/c/189985
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-12 14:56:00 +00:00
Greg Kaiser
be03a851e4 SkUTF: Avoid potential nullptr dereference
next_fail() dereferences the first argument.  So calling
next_fail() with the first argument of 'ptr' when we know 'ptr'
is nullptr will cause a problem.

For NextUTF16(), we instead return -1 when we know 'ptr' is
nullptr, just as the code currently does for NextUTF8() and
NextUTF32().

Change-Id: Ifabb45c694d6e3dbeee5ac7b953f15895cea3a69
Reviewed-on: https://skia-review.googlesource.com/c/191420
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-12 13:50:10 +00:00
Mike Reed
233fc0b03c remove unused cruft
Bug: skia:
Change-Id: I41c66d87a82afaf0835b88ee8599e6da0d2a5f58
Reviewed-on: https://skia-review.googlesource.com/c/191424
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-12 03:53:25 +00:00
Nigel Tao
b7a1b5189d SkWuffsCodec: zero dst buffer before decodeFrame
https://skia-review.googlesource.com/c/189866 "SkWuffsCodec: Initialize
memory when incomplete" made some buffer zero'ing conditional on a
frame's dirty rectangle, which required moving the this->decodeFrame
call earlier in onIncrementalDecode, since we can't know the dirty
rectangle until after decodeFrame is called.

However, moving that earlier meant that it was now earlier than the
"sk_bzero(pixels.ptr + etc, etc)" call that zero-initialized the
destination buffer that decodeFrame writes to. The actual pixel indexes
that decodeFrame decodes are now overwritten by zeroes.

That prior commit fixed the fuzzer-discovered bug, in that it no longer
swizzles from uninitialized memory. Unfortunately, it's now often
swizzling from all-zeroed memory, so that the decoding is incorrect.

This commit moves the zero-ing to onStartIncrementalDecode, even
earlier. The "dm --match Gif" tests are happy again.

Bug: skia:8235
Change-Id: Iae993b7d9f45e1b375ed99f6cc86536091a92eba
Reviewed-on: https://skia-review.googlesource.com/c/190941
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-12 03:48:10 +00:00
Ben Wagner
454e5fb745 Fix cluster reporting from shaper.
Bug: skia:8420
Change-Id: I7eea8c6b3af2153a1ac1189782fc6cbaaf9ee5c6
Reviewed-on: https://skia-review.googlesource.com/c/190821
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-11 21:59:33 +00:00
Herb Derby
0404afd5d5 Common code calculates strike for mask case.
Instead of the Renderer and the GPU calculating the strike,
the common code now calculates the strike.

Bug: skia:7515

Change-Id: I4bc65f83347e57f5b242380b0cadb74c43b8a152
Reviewed-on: https://skia-review.googlesource.com/c/191382
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-11 21:45:14 +00:00
Herb Derby
49253648d4 Introduce SkScopedStrike
A SkScopedStrike allows drawGlyphRunAsBMPWithPathFallback
to control the scope of SkStrikeInterface objects generated
by both RemoteGlyphCache and SkStrikeCache.

* introduce onAboutToExitScope() into the SkStrikeInterface

Change-Id: I87a1e623ee9a8375f4e063290d74a466f96c9933
Reviewed-on: https://skia-review.googlesource.com/c/191293
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-11 21:14:07 +00:00
Robert Phillips
b6e9d3c788 Outline GrDrawAtlasOp and GrDrawVerticesOp
This makes it easier to switch all the ops over to using a GrRecordingContext (and better matches what we do with all the other ops)

Change-Id: Ie690975c31b8c9f4c7acebdc0185a145a0a263a5
Reviewed-on: https://skia-review.googlesource.com/c/191280
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-11 20:38:35 +00:00
Robert Phillips
a9162dfb9c Plumb abandonment throughout GrContext hierarchy
When the GrImageContext & GrRecordingContext are actually GrDirectContexts it is useful for them to report the abandonment state of the GrDirectContext.

When the GrImageContext & GrRecordingContext are actually GrImageCreationContext or GrDDLContexts then they will just never be abandoned.

This CL also strips the GrProxyProvider and GrDrawingManager of their tracking on abandonment and centralizes it in the GrImageContext.

ImageContext
  can't abandon
  can only check abandonment privately

RecordingContext
  can't abandon
  can only check abandonment privately

DirectContext (aka GrContext)
  can abandon publicly
  can check abandonment publicly

Note that abandoning the DirectContext won't alter the abandonment status of any of
the other contexts in its group (e.g., DDL contexts that may be being used to record).

Change-Id: Ib790f74d90ab18da58a127fed2aad20e2477bd21
Reviewed-on: https://skia-review.googlesource.com/c/190669
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-11 20:26:22 +00:00
Herb Derby
9685057889 Plumb strike through the common code.
Plump the strike calculated in the calling code through
drawGlyphRunAsBMPWithPathFallback. This is in anticipation
of calculating the cache in drawGlyphRunAsBMPWithPathFallback.

* Add getDescriptor to SkStrikeInterface.

Change-Id: I904cdb51f60443cabc9dc41ac246b1fe0c725c85
Reviewed-on: https://skia-review.googlesource.com/c/191285
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-11 19:01:54 +00:00
Mike Klein
740e5db7ab remove pointer tagging hack in SkRecord
This interferes with other uses of pointer tagging,
like ARM pointer authentication or HSWASAN.

Bug: b/124135723
Change-Id: I1a78dd4e1b9b18dd02738bb1dfbbb968f29675bc
Reviewed-on: https://skia-review.googlesource.com/c/191286
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-02-11 18:52:37 +00:00
Greg Kaiser
73bfb896a4 GrGLGpu: Avoid potential nullptr dereference
We were checking if 'mipMapsStatus' was nullptr, and if it was,
our 'else' clause would have us always dereference this nullptr.
We change the logic to avoid a dereference in this case.

Change-Id: I2bc091c4de0c9b62ae733026cea3be37442820eb
Reviewed-on: https://skia-review.googlesource.com/c/191323
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 18:47:36 +00:00
Nigel Tao
91f96f8005 Update Wuffs version
Bug: oss-fuzz:11823

This pulls in the Wuffs bug fix:
0842bc7115
"Make the GIF dirty_rect be in the frame_rect".

Change-Id: Ib4928eb3cbf4bc862c3ae709fdfe6f179412f95f
Reviewed-on: https://skia-review.googlesource.com/c/190940
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-11 18:39:32 +00:00
Greg Kaiser
27f830257b sksl: Use va_end() after va_copy()
We invoke va_end() as required when we're done with our va_copy().

Change-Id: Ibc55279c3bc01a63da2ef5f1942d46367eac8a67
Reviewed-on: https://skia-review.googlesource.com/c/191322
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 18:34:22 +00:00
Greg Kaiser
837178206e skc: Avoid undefined variable modification
Our code had two modifications of 'from' without a sequence point
between them.  This leaves the behavior undefined.  We change
the code to only modify 'from' once, and have this behavior
well defined.

Change-Id: Ifa4fb191ecc071fdb4793901eaef777294709467
Reviewed-on: https://skia-review.googlesource.com/c/191320
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 17:53:02 +00:00
Herb Derby
30595ea7c7 Use descriptor instead of cache for GrStrikeCache lookup
Change-Id: Ia8e82344d3d8b394a6d9cc14d56dcf0addeff96c
Reviewed-on: https://skia-review.googlesource.com/c/191220
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-11 17:06:19 +00:00
Michael Ludwig
b7d64b989e Implement drawImage in terms of drawImageRect
This will cause the raster backend to draw shadermask_image incorrectly since
drawImageRect implementation has the wrong semantics. bitmapshader's expected
behavior has changed: GPU will draw the new version correctly, but raster's
will not change from the old, incorrect behavior.

Bug: skia:8752
Change-Id: Iee89082e2fdf95c2ee42ca3b052e65556f327eff
Reviewed-on: https://skia-review.googlesource.com/c/190675
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-11 17:02:00 +00:00
Mike Klein
0e83da8646 turn on -Wextra-semi-stmt on Windows
Just a few strays.

Change-Id: Ib209bc8dd228850b837b850dce14967a2112593e
Reviewed-on: https://skia-review.googlesource.com/c/191161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-11 16:50:09 +00:00
Nico Weber
5257816bd3 Remove a few semicolons.
Bug: chromium:926235
Change-Id: I338323847c34dabdbd963efe631f7dc1351ed8cc
Reviewed-on: https://skia-review.googlesource.com/c/191143
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 14:40:37 +00:00
Greg Kaiser
d336ebdea8 SkDeque: Move asserts prior to pointer dereference
If we popped too far, we want the assert mechanism to catch this
bug prior to us dereferencing a nullptr.

Change-Id: I681e530e8bcc15897bc52b3688d83f85a59d7449
Reviewed-on: https://skia-review.googlesource.com/c/191065
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 10:01:27 +00:00
Greg Kaiser
9be246ed74 GrGLGpu: Remove unused 'return'
We remove the last 'return' statement, which is never reached.
This makes it more clear at a glance what value is being
returned from the function.

Change-Id: Iedeb3f6783a45cb60cd4d1413e294fa025fd9651
Reviewed-on: https://skia-review.googlesource.com/c/191063
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 09:55:27 +00:00
Greg Kaiser
b77b1ae65c SkPath: Cleanup code to make array size match
This has no functional change.

We change the declaration of our function argument to have an array
size which matches the incoming argument.  Since C++ treats this
argument as just a function pointer regardless of the declared size,
there's no functional change.  But it makes the code clearer and
prevents static analysis tools from flagging a possible out-of-bound
access.

Change-Id: I896a74d90e56d993887ef38e389b6e9535b47925
Reviewed-on: https://skia-review.googlesource.com/c/191062
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 09:48:27 +00:00
Greg Kaiser
9a2169e84f SkImage_GpuYUVA: Also sanity check height
We were sanity checking the width twice; we switch to checking
the width and height.

Change-Id: I0841eaeeb9c42af2e309e0dafa5ec0b1843a71a8
Reviewed-on: https://skia-review.googlesource.com/c/191061
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 09:35:22 +00:00
Greg Kaiser
fe046de36b SkPathOpsTSect: Avoid null dereference in asserts
We just move the asserts to after our null checks.

Change-Id: I96c02ff9cb60ca3a052198b30f205dc78899acc6
Reviewed-on: https://skia-review.googlesource.com/c/190564
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-09 12:39:57 +00:00
Greg Kaiser
0c85e78ddf SkLiteDL: Don't use move()d object
With 'image' being both a function parameter and a class member,
a reference to 'image' resolves to the function parameter.
However, we've already called std::move() on the function
parameter, so we want to use the class member here.  Thus, we
switch to 'this->image'.

Change-Id: Ie244b87b54b1c1ec3dc59bcd1f637ddd301c38a9
Reviewed-on: https://skia-review.googlesource.com/c/190562
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-09 12:24:17 +00:00
Herb Derby
706a7cd1e8 Clearify code around hasImage and hasPath
* hasImage is not needed. I determined that a nullptr is never possible.
* hasPath is renamed to decideShouldDrawFromPath. Comment the code to
  explain the symmetry of calls between Renderer and GPU.

Change-Id: I4bc74fa49cf388d43aeb3ff201053332145fee59
Reviewed-on: https://skia-review.googlesource.com/c/190678
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@google.com>
2019-02-08 23:56:02 +00:00
Brian Salomon
1f05d459e2 Add GrContext::resetGLTextureBindings().
This function binds texture ID 0 to any texture unit/target combo that
Skia has modified.

Bug: chromium:926017
Change-Id: I3ac8f8050c863232886102886e60d3b91a5380c9
Reviewed-on: https://skia-review.googlesource.com/c/190663
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-08 21:26:51 +00:00
Herb Derby
e59d40e0bc Simplify mask handling in SkRemoteGlyphCache
I'm only handling the processGlyphRunForMask in this CL, and I
am leaving processGlyphRunForPaths and maybeProcessGlyphRunForDFT
alone. I don't want to have to think about the Fallback code path
right now.

This should not be much of a problem because addGlyph exits early
if the glyph is already processed.

Change-Id: I78886ef87e2fbc3b9bfcb98101401138873bee37
Reviewed-on: https://skia-review.googlesource.com/c/190421
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-02-08 19:14:00 +00:00
Herb Derby
c6dde3bc69 Split getOrCreateCache into a SkFont and descriptor based calles
Change-Id: Ie4724137baf3d355b94bd9966cc381a688c465fb
Reviewed-on: https://skia-review.googlesource.com/c/190671
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-08 18:49:30 +00:00
Brian Osman
37064c1739 Remove support for GPU bone transformations
This code has been disabled - there were no reasonable scenarios where
it was faster than CPU transformation of the vertex data.

Bug: skia:
Change-Id: Ide2ba24ebbd4543393e4e8997f089a8ca788e787
Reviewed-on: https://skia-review.googlesource.com/c/190665
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-08 18:07:30 +00:00
Robert Phillips
d6841487eb Move auditTrail and opMemoryPool from GrContext to GrRecordingContext
Any context that records ops (i.e., direct and/or DDL) will need these two objects.

Change-Id: Ifd3527c23a4015f7d469ad2222563508cccbd339
Reviewed-on: https://skia-review.googlesource.com/c/190307
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-08 16:07:56 +00:00
Mike Klein
9707e907ae move some methods out of line
This started because I noticed some repeated symbols while disassembling
object files.  I decided to fix up one or two to kill time while waiting
for Blink layout tests, but then I got a little quixotic.  In the end, I
ran:

    ninja -C out && git add -u && nm -U -j out/obj/gm/gm.*.o | sort | uniq -c | sort -g | c++filt | less

And then outlined things that stuck out as funny, either because they
were big, because they were virtual, because there were many copies of
them, or some combination of those factors.

I'm on the fence about moving a few of SkRefCnt's virtuals out of line,
so I've left SkRefCnt.h unchanged for now.

I'm not sure that this is important.

Change-Id: I425d05aa4beabbae40dd8df465155bfb909ef43a
Reviewed-on: https://skia-review.googlesource.com/c/190422
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-08 15:41:36 +00:00
Herb Derby
f412d8bb94 Simplify typeface and effects handling
Through many changes, SkRemoteGlyphCache's handling of
typefaces became confused.

* The SkGlyphCacheState doesn't need the font, only
  the SkTypeface from that font.

* effects don't need to be recalculated all the time.

Change-Id: I0158d68501bf5b544d79111543fc6bff1173548c
Reviewed-on: https://skia-review.googlesource.com/c/190423
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-08 15:24:06 +00:00
Robert Phillips
a41c6858da Move proxyProvider and singleOwner to GrImageContext
This starts to beef up the capabilities of the GrImageContext in preparation for its future responsibilities (i.e., creating promise images w/o a recordingContext).

Note that the proxyProvider still has different behavior if it has a full context vs. a reduced context. I intend to just let this behavior remain as is.

Change-Id: Idb9d99a548ef928fc1b9dc1e5a34f74343bb0b4b
Reviewed-on: https://skia-review.googlesource.com/c/189490
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-08 15:20:06 +00:00
Kevin Lubick
6f509dbb60 Remove abandoned fSubdivisionsMax
Was removed in https://skia-review.googlesource.com/c/skia/+/187922
There's probably a better high level solution.

Bug: oss-fuzz:12991
Change-Id: Ie64e46f17b91a8b6aa9f0be1b7d060d4033aba6e
Reviewed-on: https://skia-review.googlesource.com/c/190439
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-08 14:56:36 +00:00
Eric Karl
a8878a1df9 Fix issue where command buffer was skipped if drawing a single drawable
When drawing a drawable in Vulkan, we didn't dirty the |fIsEmpty| flag
on the command buffer. This means that if the drawable was the only
output to the CB, it would not be submitted.

Change-Id: Id01a04d6423b64f1fe7a24065d5139184b132e77
Reviewed-on: https://skia-review.googlesource.com/c/190560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Eric Karl <ericrk@chromium.org>
2019-02-08 03:16:59 +00:00
Brian Salomon
d978b90d20 Track separate texure binding states for each OpenGL texture target.
This means tracking the binding for e.g. GL_TEXTURE_2D separately from
GL_TEXTURE_RECTANGLE.

This is to enable resetting any bindings Skia changes back to 0 at
client request (future work).

Bug: chromium:926017
Change-Id: Ic82796479fb0f7e18f5c32bb4230a1c71712d36d
Reviewed-on: https://skia-review.googlesource.com/c/190308
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-07 22:38:36 +00:00
Brian Osman
412674f8a8 Check for single owner and abandoned context in createMipMapProxyFromBitmap
Bug: skia:
Change-Id: I64d4844300be3e49673f919f4e85dbff7cd4bb92
Reviewed-on: https://skia-review.googlesource.com/c/190440
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-07 21:13:16 +00:00
Jim Van Verth
6bc650e9d7 Fix Metal bots.
Disables some invalid tests and re-enables others.
Fixes up a shader issue.

Bug: skia:8243
Change-Id: I03c3685c1f0bc55c435121d659e52115f114ca7f
Reviewed-on: https://skia-review.googlesource.com/c/190300
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-07 21:00:20 +00:00
Brian Salomon
601ac80b48 Cache CPU memory buffers used for client side arrays.
Use same cache for CPU-side copy of data when using GPU buffers.

Change-Id: I09f2837211a30aabc50e9897c090f5fbc6d90492
Reviewed-on: https://skia-review.googlesource.com/c/189484
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 20:25:55 +00:00
Derek Sollenberger
1be431f60f Remove colorspace restrictions for 565/FP16 configs in Android Codec.
Bug: b/123377741
Change-Id: I82ae1ba1eddade35fe2d7f8c2c160db1ae20ced6
Reviewed-on: https://skia-review.googlesource.com/c/188026
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-07 20:13:46 +00:00
Robert Phillips
fe0963c350 Move "matches" from GrContextThreadSafeProxy to GrContext_Base
This makes the "matches" functionality available to all the context flavors and uses it for SkImages

Change-Id: I1e3d55f19a7752a9da8789e93a848b7a7a64d180
Reviewed-on: https://skia-review.googlesource.com/c/190227
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-07 19:26:50 +00:00
Robert Phillips
e8345793c6 Make room for shifting GrContext to GrDirectContext
Change-Id: I6291b0c513c641c3bb49260031b501da42b11ede
Reviewed-on: https://skia-review.googlesource.com/c/190002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-07 19:24:07 +00:00
Brian Osman
0471a93057 Support building mips when creating cross context images
The API existed, but triggered asserts if you tried to use it
(because we weren't passing scaleAdjust). Also guard against
devices not supporting mips, and update the GM to test all of
these cases (including mipping a cross-context image that was
originally created without mips).

Bug: https://github.com/flutter/flutter/issues/24517
Change-Id: Ia180f4e6fd7f3790d0f7068f9f3aa39eb5657378
Reviewed-on: https://skia-review.googlesource.com/c/190224
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 19:17:55 +00:00
Brian Salomon
a29dd9d0cb Pin the quad index buffer in GrResourceProvider.
This can get purged under memory pressure, but it is highly unlikely that
it will not be quickly recreated. It is only 32K.

Change-Id: Ia1fd404d8a57968aa26ff24f5a407e79fb78cc74
Reviewed-on: https://skia-review.googlesource.com/c/190260
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-07 19:04:25 +00:00
Mike Reed
8619a34bb8 Revert "Hide setDrawLooper -- deprecate loopers"
This reverts commit c877ea2657.

Reason for revert: wow, this is going to be really hard to update callers

Original change's description:
> Hide setDrawLooper -- deprecate loopers
> 
> Guarded with SK_SUPPORT_LEGACY_DRAWLOOPER
> 
> Bug: skia:4783
> Change-Id: I4a47513624bc5c09816f44e107917dc8028adb94
> Reviewed-on: https://skia-review.googlesource.com/c/189871
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ia49f421c8a96a8091ab87533361fde4bf570d6e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4783
Reviewed-on: https://skia-review.googlesource.com/c/190303
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-07 19:00:36 +00:00
Brian Salomon
dbf7072a59 Use different classes for client side arrays and GPU buffer objects.
GrBuffer is a base class for GrGpuBuffer and GrCpuBuffer. GrGpuBuffer is a
GrGpuResource and the others are not. This allows GrCpuBuffers to exist
outside of the GrGpuResourceCache.

Also removes flags from GrResourceProvider buffer factory function. The
only flag still in use was kRequireGpuMemory. Now CPU buffers are made
without using GrResourceProvider.

Change-Id: I82670d1316e28fd6331ca36b26c8c4ead33846f9
Reviewed-on: https://skia-review.googlesource.com/c/188823
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 18:04:15 +00:00
Robert Phillips
c1bee13e13 Add support for Mtl backend to DeferredDisplayListTest
Change-Id: Ie576bc8442e5a646c33191100be1be5f89d72290
Reviewed-on: https://skia-review.googlesource.com/c/189483
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-07 16:34:50 +00:00
Jim Van Verth
3d482995e5 Set correct uniform size for Metal.
There are two fixes here. The first pads out the uniform buffer to
match the alignment of the largest element in the buffer, as required
by Metal. The second ensures that the RTHeight uniform is only added
to the shader if required by the program inputs, as otherwise it wasn't
being included in the uniform data.

Bug: skia:8737
Change-Id: Icbe57456f3ec79faada231278c58137ca9865dd2
Reviewed-on: https://skia-review.googlesource.com/c/189875
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-07 16:17:24 +00:00
Greg Daniel
173464da34 Add support for importing AHardwareBuffers into SkSurfaces.
Bug: skia:
Change-Id: I0a3b3d607e1b74787480b03520a07839c87486dc
Reviewed-on: https://skia-review.googlesource.com/c/189980
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-07 15:03:50 +00:00
Leon Scroggins III
699d41e4bd SkWuffsCodec: Initialize memory when incomplete
Bug: oss-fuzz:11800

We already had code that initialized the output memory, but it assumed
that we would later copy from wuffs' work buffer. If the dirty rect is
empty, we don't do that. Rearrange the wuffs decode so we can know that
the dirty rect is empty when we decide whether to initialize.

Change-Id: I45fdd4270906b4c240ec087d20c24fb107a1dc07
Reviewed-on: https://skia-review.googlesource.com/c/189866
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
2019-02-07 14:48:31 +00:00
Mike Reed
c877ea2657 Hide setDrawLooper -- deprecate loopers
Guarded with SK_SUPPORT_LEGACY_DRAWLOOPER

Bug: skia:4783
Change-Id: I4a47513624bc5c09816f44e107917dc8028adb94
Reviewed-on: https://skia-review.googlesource.com/c/189871
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-07 13:33:30 +00:00
Mike Reed
88f5671f71 move SkMetaData into src
Bug: skia:
Change-Id: I3ef8c3ec0d6f33bd9a167b99313d6d313a748494
Reviewed-on: https://skia-review.googlesource.com/c/189284
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-07 00:26:49 +00:00
Herb Derby
f7ea4f5d5d Remove the distinction between key and device descriptors
Change-Id: I12ac0f77124caae0be7b3a178683e5a3213f9beb
Reviewed-on: https://skia-review.googlesource.com/c/189869
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-02-06 21:50:19 +00:00
Hal Canary
6102192b96 SkLoadICU: simplify
Change-Id: I98cd1f36ca96a92b72974ae228465199638e4bea
Reviewed-on: https://skia-review.googlesource.com/c/189864
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-02-06 21:20:49 +00:00
Robert Phillips
dbaf317cd4 Move GrContextPriv methods to their own .cpp file
Centralize these for my sanity. Most will also be parceled out to other contexts.

Change-Id: If0e7e98bcf66c4d8a3391f9b04e643ccc91af4ad
Reviewed-on: https://skia-review.googlesource.com/c/189488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-06 21:15:58 +00:00
Herb Derby
f272b8ff23 Remove filterRec bypass on MakeRecAndEffects
Change-Id: I1845f2a06edcfee97b9ca7aa3205328c87c4b7ae
Reviewed-on: https://skia-review.googlesource.com/c/189900
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-06 19:20:22 +00:00
Herb Derby
62a9d31375 Reorganize MakeRecAndEffects and SkScalerContext ctor
* This will allow the key descriptor and the device descriptor
  to be the same in SkRemoteGlyphCache.

* Simplifying SkRemoteGlyphCache descriptors will allow the
  rendering code in SkRemoteGlyphCache and the code in the GPU to
  be the same.

Change-Id: I1225c7e9017c05518ccadee1522751b94b1d97af
Reviewed-on: https://skia-review.googlesource.com/c/189582
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-06 18:30:02 +00:00
Mike Reed
cc88f3a72d per-contour variant of SkPathMeasure
Bug: skia:8721
Change-Id: I1e79a49dee25ccc9138baf6fb2df3dc80d1ff66b
Reviewed-on: https://skia-review.googlesource.com/c/187922
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-02-06 18:21:22 +00:00