Commit Graph

22520 Commits

Author SHA1 Message Date
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
Ben Wagner
6c30e74dd0 Add DDL jobs for Intel
To work around skia:8709, I'm moving the DDL tests to IntelIris640. The
ASAN jobs still show memory leaks in the driver, but at least I can
identify which calls are leaking and suppress the LSAN warnings.

Adds an SK_ENABLE_SCOPED_LSAN_SUPPRESSIONS define that indicates that
the LSAN header files are available, which is set in recipes for the
Linux ASAN builds. Adds __lsan::ScopedDisabler in four locations for
two Vulkan API calls:
 - CreateGraphicsPipelines in GrVkPipeline::Create and
   GrVkCopyPipeline::Create
 - CreateDescriptorSetLayout in
   GrVkDescriptorSetManager::DescriptorPoolManager::DescriptorPoolManager
   constructor (2 calls)

Also adds a regular suppression for libxcb.so.

See bugs listed below for more details on the leaks.

Bug: skia:8710, skia:8712, skia:8713
Change-Id: I55c6e5d483b4aeed5cd44c64219539ca7214187f
Reviewed-on: https://skia-review.googlesource.com/c/184071
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
2019-02-06 15:53:32 +00:00
Ethan Nicholas
7193586dab fixed SRGB effect color accuracy
Bug: skia:
Change-Id: I8715357f053fbfab73e9cbe674dd082aabe77329
Reviewed-on: https://skia-review.googlesource.com/c/189841
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-06 15:32:52 +00:00
Brian Osman
e956049450 Fix makeColorSpace on YUV images
This is a second attempt at https://skia-review.googlesource.com/c/skia/+/182816
This version ensures that SkImage::colorSpace() returns the target after
makeColorSpace has been called (to match user expectations, and match
behavior with lazy images). Given that, the xform is baked into the FP
within the maker, rather than externally (again, this matches the lazy
image behavior).

Additionally, the target color space needs to be taken into account when
flattening into the RGB proxy, and some base-class methods need to use
this->colorSpace() rather than fColorSpace to tag the output.

Added a GM that tests quite a few different scenarios. All images have
makeColorSpace() applied:

- Raster image (for reference)
- yuvImage
- yuvImage->makeSubset()
- yuvImage->makeNonTextureImage()
- readPixels(yuvImage)

All images should look the same as the top row. Verified that they do
match, in both untagged (gl) and tagged (glsrgb) configs.

I think there may still be some cases where we transform too many or too
few times, or incorrectly tag the result of an image operation, but this
is much more correct than before, and should (I hope) address Chrome's
immediate needs.

Bug: skia:8740
Change-Id: I5d501879866861a5ba91240f688d3f95711f7595
Reviewed-on: https://skia-review.googlesource.com/c/189494
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-06 13:45:20 +00:00
Ethan Nicholas
e1f5502969 Reland "SkSL is now pickier about type conversions"
This is a reland of 91c1d08bc3

Original change's description:
> SkSL is now pickier about type conversions
> 
> Bug: skia:
> Change-Id: I4e8b8f229f4e4344f160b0dbb41832764d0b75bd
> Reviewed-on: https://skia-review.googlesource.com/c/188311
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:
Change-Id: I727cad061afc0a5ee6f4d2df789330d809dd110a
Reviewed-on: https://skia-review.googlesource.com/c/189643
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-06 02:40:59 +00:00
Herb Derby
0c12f92a4b Remove fPreBlendForFilter
Change-Id: Ibed3ba5fdc87ce5760099d78b9ff8b99128086bc
Reviewed-on: https://skia-review.googlesource.com/c/189440
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-05 22:36:59 +00:00
Ethan Nicholas
c83da98d50 Revert "SkSL is now pickier about type conversions"
This reverts commit 91c1d08bc3.

Reason for revert: breaking everything

Original change's description:
> SkSL is now pickier about type conversions
> 
> Bug: skia:
> Change-Id: I4e8b8f229f4e4344f160b0dbb41832764d0b75bd
> Reviewed-on: https://skia-review.googlesource.com/c/188311
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I670fa9215d3ca0ce738edc24e832b6d968599cb1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/189642
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-05 21:54:51 +00:00
Ethan Nicholas
91c1d08bc3 SkSL is now pickier about type conversions
Bug: skia:
Change-Id: I4e8b8f229f4e4344f160b0dbb41832764d0b75bd
Reviewed-on: https://skia-review.googlesource.com/c/188311
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-05 21:36:33 +00:00
Herb Derby
5e1819f912 Move luminace calculation to the SkScalerContext ctor.
N.B. The cananonical color calculation is still there to
avoid Chrome layout changes.

Change-Id: Ie7a48a48be7ab0a6cc90b2469e48d85990cf3c1d
Reviewed-on: https://skia-review.googlesource.com/c/187460
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-05 21:33:28 +00:00
Brian Salomon
95548f6625 Remove fIntendedType from GrMtlBuffer. Add accessor to base class
Fixes unused member warning-as-error.

Change-Id: I9468a1b1cb106eeb7818afe87f5cda7eb75910de
Reviewed-on: https://skia-review.googlesource.com/c/189497
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-05 21:31:29 +00:00
Greg Daniel
d742b6be45 Fill in missing GrMtlCaps functions and fix for 0 buffer alloc.
Bug: skia:
Change-Id: I4981e49dc45d607f3f6493da67844b6dfa74a551
Reviewed-on: https://skia-review.googlesource.com/c/189493
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-02-05 21:03:05 +00:00
Hal Canary
32498f0846 GN/ICU cleanup
For targets that depend on ICU, only define if `skia_use_icu` is set.

Move declare_args/skia_use_icu into skia.gni.  Other variables that need
to work like that can move there later.

icu/BUILD.gn defines SK_USING_THIRD_PARTY_ICU if needed.
SkShaper_harfbuzz.cpp SkPDFSubsetFont.cpp respects
SK_USING_THIRD_PARTY_ICU when calling SkLoadICU().

sfntly/BUILD.gn, harfbuzz/BUILD.gn, icu/icu.gni uses $_src variable to
reduce verbosity.   icu/icu.gni adds more headersto sources.

Change-Id: I9e000b9b19902d9f5c0c64e989bf42466aa8a299
Reviewed-on: https://skia-review.googlesource.com/c/189304
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-02-05 17:27:55 +00:00
Mike Klein
830ab79b26 disable DAA by default
This turns DAA off by default in Skia and in our tools,
while leaving it able to be turned back on if we want.

(There's at least one bot that does already.)

This setup keeps our default builds matching the behavior
of Chromium, Flutter, Android, Google3, and should prevent
anyone from accidentally falling into it.

Change-Id: Ia85f3dbe69c46cec0dac6b07fb5feb6e8b65d237
Reviewed-on: https://skia-review.googlesource.com/c/189580
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-05 17:15:14 +00:00
Greg Daniel
8ce7991242 Add release proc apis to SkSurface::MakeFromBackend* calls.
Bug: skia:
Change-Id: I0e6cd8895c328a89cd0fa50260fe4e8adbff5990
Reviewed-on: https://skia-review.googlesource.com/c/188634
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-05 15:36:14 +00:00
Brian Osman
09a66aca2e Fix RTCc issue (truncating 64 bit value) in GrVkRenderPass
Bug: skia:
Change-Id: I31b3024808c3d85f6daa07670b91b5f3bebdfd4b
Reviewed-on: https://skia-review.googlesource.com/c/189487
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-05 15:27:44 +00:00
Brian Salomon
ae64c194fe Convert GrBufferType to enum class, rename, and remove dead values
Renamed to GrGpuBufferType in anticipation of splitting GrBuffer
into GrGpuBuffer and GrCpuBuffer types.

There were two unused values in the enum that are removed, DrawIndirect
and Texel.

Change-Id: Icb6b3da689adbd8e10495c10fd0470a6ee0120b5
Reviewed-on: https://skia-review.googlesource.com/c/189280
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-05 15:04:48 +00:00
Greg Daniel
c91162d20b Have GrMtlTexture and GrMtlRenderTarget call parents onRelease/Abandon.
Bug: skia:
Change-Id: Ib7c19f4a1951f7463912b78c18ed7f2839833193
Reviewed-on: https://skia-review.googlesource.com/c/189485
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-05 15:01:14 +00:00
Robert Phillips
f7c6dfabef Fix generated files
https://skia-review.googlesource.com/c/skia/+/189164 (Rename GrContext::contextPriv to priv) altered a header
TBR=fmalita@chromium.org

Change-Id: I165ad7c06490789d9f4c605e17c36ab2fac7f9f4
Reviewed-on: https://skia-review.googlesource.com/c/189482
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-05 13:32:14 +00:00
Robert Phillips
bb60677d52 Move caps and FP factory cache to GrContext_Base
Both GrContext and GrContextThreadSafeProxy had their own copies. This centralizes ownership and standardizes how all the contexts get initialized.

Change-Id: Ib2e418fbb53fcd6b0054789ef30a5fc4a3d80b20
Reviewed-on: https://skia-review.googlesource.com/c/189305
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-05 01:31:05 +00:00
Greg Daniel
2d35a1c875 Move texture release proc to GrSurface so that render targets can also have releases.
Bug: skia:
Change-Id: I65e7872057110295376ad76e0656a47bca3f712d
Reviewed-on: https://skia-review.googlesource.com/c/188633
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-05 00:37:54 +00:00
Ben Wagner
79ac5081d5 Extend GetAlphaTextureBounds workaround.
On large glyphs GetAlphaTextureBounds returns empty bounds but no error
when the glyph does, in fact, have non empty bounds. An existing work
around exists to fall back to aliased bounds which are more likely to
give correct results. This workaround was added specifically for falling
back to aliased bounds in the case cleartype bounds were not available,
but this is now also possible with the new grayscale bounds. Extend the
workaround to grayscale bounds as well.

Bug: chromium:926885
Change-Id: Ib7b2028b48a3cb0268f2af8eebbe7b0889391dae
Reviewed-on: https://skia-review.googlesource.com/c/189300
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-04 23:23:54 +00:00
Ben Wagner
0b46a39820 Make HR* macros statements.
Currently HR* macros expand to block expressions which neither need nor
require a closing semicolon. Since at the use site these macros look
like statements which should use a closing semicolon, change the macro
definition to be a statement. This should also fix many warnings around
unneeded semicolons.

Change-Id: I288fdfefa083c6e04a1e7b0a055c8972b7e8b367
Reviewed-on: https://skia-review.googlesource.com/c/189301
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-04 22:51:04 +00:00
Robert Phillips
9da87e0e98 Rename GrContext::contextPriv to priv
Mechanical. This makes the priv() accessor the same for all the context types.

Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-04 22:13:14 +00:00
Brian Osman
50ea3c06b8 Add support for MSVC run-time checks (and control flow guard)
This enables four different options in the compiler, described
below. I also added enough masks to satisfy RTCc when running
all GMs in both 8888 and gl configs.

---

/RTCc - Detects when a value is assigned to a smaller data
type and results in data loss. This happens even when casting.
Masking is required to suppress this.

/RTCs - Various stack-related checks, including uninitialized
data (by initializing locals to a non-zero value), array bounds
checking, and stack pointer corruption that can occur with a
calling convention mismatch.

/RTCu - Reports when a variable is used without having been
initialized. Mostly redundant with compile-time checks.

/guard:cf - This is more of a security option, that computes
all possible targets for indirect calls at compile time, and
verifies that those are the only targets reached at compile
time. Also generates similar logic around switch statements
that turn into jump tables.

Bug: skia:
Change-Id: I7b527af8fd67dec0b6556f38bcd0efc3fd505856
Reviewed-on: https://skia-review.googlesource.com/c/188625
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-04 20:55:24 +00:00
Hal Canary
92170de803 SkPDF to use aliased em bounds.
This restores previous behavior and works around a chromium issue.
The underlying issue in DirectWrite will need to be worked around
as well.

Bug: chromium:926885

Change-Id: I6a6cbd04db66066ad258df62d3c9fc8056c33c7f
Reviewed-on: https://skia-review.googlesource.com/c/189167
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-02-04 18:47:22 +00:00
Greg Daniel
950dfd7cc2 Minor clean ups to vulkan hardware buffer test.
Bug: skia:
Change-Id: I280556d4691a762402d2a94959bd6fda614bc39c
Reviewed-on: https://skia-review.googlesource.com/c/189168
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-04 18:14:22 +00:00
Robert Phillips
c1541ae25f Move GrContextOptions to GrContext_Base and make GrContextThreadSafeProxy be derived from GrContext_Base
The main thrust of this CL is to bring the GrContextThreadSafeProxy into the fold.

Change-Id: I8f457d5b75c69f89beac3a0035b1c05ba5d3b931
Reviewed-on: https://skia-review.googlesource.com/c/188622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-04 18:08:57 +00:00
Mike Reed
69da42f188 remove metadata from canvas
Bug: skia:
Change-Id: Id8eefff4f65317d749f4b96620a5e469425b4c4a
Reviewed-on: https://skia-review.googlesource.com/c/189169
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-04 18:06:42 +00:00
Mike Reed
8c14038e56 hide getMetaData()
Bug: skia:
Change-Id: I2b513d4c5868bc0d4cdcdf0c95cc35e90c98f9a1
Reviewed-on: https://skia-review.googlesource.com/c/188824
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-04 14:21:02 +00:00
Robert Phillips
b45f47dc3e Add isTextureable parameter to GrContextThreadSafeProxy::createCharacterization (take 2)
TBR=bsalomon@google.com
Change-Id: Iee9d64dd39d5f3269428822582b754c4981812d7
Reviewed-on: https://skia-review.googlesource.com/c/188825
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-03 23:06:13 +00:00
Brian Salomon
9c7a006a8e Remove NoPendingIO flags from buffer creations.
Now that we're keeping refs on GrBuffers during flush, we shouldn't
need to specify this flag.

Change-Id: Idbe08e84d23690d6c9e94f23f2c4507a2e965aff
Reviewed-on: https://skia-review.googlesource.com/c/188635
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-03 16:59:43 +00:00
Mike Reed
0d84e805c3 move experimental header out of public includes
Bug: skia:
Change-Id: I81ea9e039f23e22b4955ad6088f5cb76ec2ba1a5
Reviewed-on: https://skia-review.googlesource.com/c/186864
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-02 18:18:21 +00:00
Robert Phillips
5b1813ab81 Revert "Add isTextureable parameter to GrContextThreadSafeProxy::createCharacterization"
This reverts commit 87685ba492.

Reason for revert: Macs

Original change's description:
> Add isTextureable parameter to GrContextThreadSafeProxy::createCharacterization
> 
> Change-Id: I08d263490982a7d5c1e48a5b31acca25405ab09a
> Reviewed-on: https://skia-review.googlesource.com/c/188628
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I6f912f587e823b44c3747937619251d05b610fea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/188860
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-01 23:12:12 +00:00
Michael Ludwig
8f5aeebdd8 Revert "Narrow clear-as-draw workaround on D3D11 ANGLE"
This reverts commit 3dc93896b3.

Reason for revert: Intel and ANGLE still don't play well together

Original change's description:
> Narrow clear-as-draw workaround on D3D11 ANGLE
> 
> Bug: skia:
> Change-Id: Ib2714b448b078a09d43a28fd5bd7329706b516b8
> Reviewed-on: https://skia-review.googlesource.com/c/188310
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,michaelludwig@google.com

Change-Id: I0ce3cecd97b0e696a3805166394ec7f55fbebe20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/188639
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-01 21:53:22 +00:00
Robert Phillips
87685ba492 Add isTextureable parameter to GrContextThreadSafeProxy::createCharacterization
Change-Id: I08d263490982a7d5c1e48a5b31acca25405ab09a
Reviewed-on: https://skia-review.googlesource.com/c/188628
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-01 21:42:11 +00:00
Brian Osman
a69c50127b Remove SkColorSpaceTransferFn
This has been replaced by skcms_TransferFunction

Bug: skia:
Change-Id: Ie9eb1eb0c6a301b1ed7807559c34a87d14b14f0a
Reviewed-on: https://skia-review.googlesource.com/c/188637
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-01 21:32:50 +00:00
Brian Osman
26ccfcc96f Remove SkICC::WriteToICC
All clients are using SkWriteICCProfile, which uses types that are more
consistent with the rest of Skia's colorspace API.

Bug: skia:
Change-Id: I1a416027839be95f51a8cabf5dd5d4395cbd2ec6
Reviewed-on: https://skia-review.googlesource.com/c/188636
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-01 21:00:10 +00:00
Brian Salomon
924a10e207 Make GrMesh hold regular ref on GrBuffers.
We don't use GrBuffers prior to flush time.

Currently at flush time we request buffers that have no pending reads. We
hold the pending reads until after flush finishes. This means once we
acquire a buffer from the cache it cannot be used again until the
next flush.

Using regular refs should be equivalanet.

Change-Id: Ic7653f0f0a66099c0ac77604f77ed0539c882160
Reviewed-on: https://skia-review.googlesource.com/c/188629
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-01 20:06:10 +00:00
Mike Reed
ec7278e703 remove unneeded friends/includes in SkPaint.h
Bug: skia:
Change-Id: Ica9f10cdb67322eb43ec38b6549146350fa5dcd9
Reviewed-on: https://skia-review.googlesource.com/c/188630
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-01 19:29:46 +00:00
Robert Phillips
fd0d97092b Rename GrContext::uniqueID to contextID and hide it
The GrContext's ID isn't really unique any more (since it can be shared among a family of contexts). Change its name to reflect the new reality.

Additionally, no client seems to be using it so make it private.


Change-Id: Ibb9004d699fe6ca7876b3be94142e612b5b9efbd
Reviewed-on: https://skia-review.googlesource.com/c/188308
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-01 16:18:23 +00:00
Mike Reed
fdb876d4ee remove breakText, and all utf cache accessors
Bug: skia:
Change-Id: Ib7219e0844a4401f12f89d91eab60dbb7dda0121
Reviewed-on: https://skia-review.googlesource.com/c/188580
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-01 15:20:23 +00:00
Robert Phillips
d0fe875455 Remove destination GrRenderTargetProxy from GrPipeline
Change-Id: Ie2ee3d51220163fde8a959255dd5f6cce4e27ad8
Reviewed-on: https://skia-review.googlesource.com/c/188038
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-01 13:36:53 +00:00
Michael Ludwig
3dc93896b3 Narrow clear-as-draw workaround on D3D11 ANGLE
Bug: skia:
Change-Id: Ib2714b448b078a09d43a28fd5bd7329706b516b8
Reviewed-on: https://skia-review.googlesource.com/c/188310
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-01 13:01:23 +00:00
Mike Reed
569dda7216 hide SkFont::containsText
Bug: skia:
Change-Id: I197addb0ea1da57083283b30e19e290cdaf8dac6
Reviewed-on: https://skia-review.googlesource.com/c/188581
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-01 10:54:53 +00:00
Mike Reed
88c6eb5c54 remove (dead) legacy measuretext
Bug: skia:
Change-Id: I3deed21a9e4a019f87557f751fafdcc36c95fa57
Reviewed-on: https://skia-review.googlesource.com/c/188312
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-31 22:18:12 +00:00
Mike Reed
1c2052363e fix tiler to handle large float rects
The issue is around needing to go from a float rect to a clipped (intersected
with the clip bounds) irect.

The old code promoted the clip bounds to rect,
intersected with the rect, and then rounded to ints. This is problematic
since convert float --> int can produce float values that are larger than
their int counter-parts. (e.g. int:67108863 becomes float:67108864).
This error goes on to confuse subsequent logic.

The fix is to round the rect to int first (knowing that very large floats
will saturate to maxint), and then intersect.

Bug: 927075
Change-Id: If6c7d72ff15184700b87532e1922e576d1348ee8
Reviewed-on: https://skia-review.googlesource.com/c/188307
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-31 19:34:42 +00:00
Mike Reed
5b257abb87 change measureText impl to first convert to glyphs
Bug: skia:
Change-Id: Icbc53688fb4e575695abf062dfe89e3b4b3bbb53
Reviewed-on: https://skia-review.googlesource.com/c/188021
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-31 18:11:52 +00:00
Brian Salomon
f55e8d5232 Add option to skip intermediate release/fulfill calls for promise images.
SkiaRenderer does not delete promise image textures when they are released
but not done. Refulfilling promise image textures takes a significant amount
of CPU time. This allows us to fulfill each promise image once.

Bug: skia:8736
Change-Id: I7ad7fa9678ed0ec4bb714b71fbf920ab4a845409
Reviewed-on: https://skia-review.googlesource.com/c/188039
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-31 16:24:52 +00:00
Leon Scroggins III
95d0c8d21c Fix bug in sampling rotated decodes
Bug: b/122338652
Bug: b/77339676

getSampledDimensions is supposed to report dimensions that
SkAndroidCodec can decode to. But if SkAndroidCodec is respecting an
orientation that requires swapping the width and the height,
getSampledDimensions needs to do so, too.

Change-Id: I0cacefc2b02eb9832b8c029c88bcaaedcb2ba82b
Reviewed-on: https://skia-review.googlesource.com/c/188035
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-01-30 21:10:28 +00:00
Mike Klein
541cbd4672 remove shadeSpan4f()
This shouldn't cause any diffs, provided I've implemented the no-stages
shadeSpan() fallback correctly.  (I'm not sure which shaders don't have
stages at this point.)

Bug: skia:8730
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ia0d777b526e05b7262ff77daec5ef4d8b0afdb9b
Reviewed-on: https://skia-review.googlesource.com/c/188031
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-30 19:14:51 +00:00
Mike Klein
ac262a0368 remove Sk4x4f.h -- dead code
Change-Id: I03d15a563eeb7ea187c7d48deffe00357dc55177
Reviewed-on: https://skia-review.googlesource.com/c/188032
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-01-30 19:00:21 +00:00
Robert Phillips
4217ea7ee5 Add outline of new GrContext hierarchy
This begins the process of splitting GrContext into:

GrContext_Base, GrImageContext, GrRecordingContext and GrDirectContext.

Change-Id: I3c43045f2a5549b049e95791d65f74d4e16de36f
Reviewed-on: https://skia-review.googlesource.com/c/186878
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-30 18:36:11 +00:00
Mike Klein
85b856f865 remove burst mode in SkRPBlitter
This shader burst mode is only implemented by linear gradient,
and it doesn't seem to handle color management the way we expect.

This CL should be enough alone to fix the attached bug.  As a follow up
we can now remove shadeSpan4f(), which has one or two more incidental
call sites.

Bug: skia:8730
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I8fe5fab5e003702106846dcad92505bf1c70fba3
Reviewed-on: https://skia-review.googlesource.com/c/188030
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-30 18:22:51 +00:00
Brian Salomon
59ef8c36c1 Remove legacy texture-backed promise image interface.
No longer used by Chrome.

Change-Id: I842482490f132bb3aa3e85f847d8d4167f5595df
Reviewed-on: https://skia-review.googlesource.com/c/188029
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-30 18:09:21 +00:00
Mike Reed
673a048b20 hide deprecated breaktext
Bug: skia:
Change-Id: I5a2f4d96f8e0ad299cf1b4f6e87f0e0d98afde5a
Reviewed-on: https://skia-review.googlesource.com/c/188020
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-30 13:58:41 +00:00
Mike Reed
d76a0f49c2 remove unused paintpriv methods
Bug: skia:
Change-Id: I7f8a8c86ac3af2edf66f1693439bd43b53c2dafb
Reviewed-on: https://skia-review.googlesource.com/c/187930
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-30 02:31:40 +00:00
Brian Salomon
12d2264c26 Convert GrBuffer owners to sk_sp
Change-Id: Id49d775c30f01f4de05f385227c5ed5d90d6839e
Reviewed-on: https://skia-review.googlesource.com/c/187920
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-01-29 21:11:27 +00:00
Brian Salomon
8bbdfda4f5 Limit PowerVR Rougue clear texture support disable to x86
Change-Id: I13405e9ce13e052804c5c0c1d8cf7cbd652f5c40
Reviewed-on: https://skia-review.googlesource.com/c/187785
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-29 20:07:17 +00:00
Robert Phillips
a0bc39dce3 Split GrContextThreadSafeProxy into its own files (take 2)
This just shuffles stuff around.

Change-Id: I90e24a73bf44dd3e88fc121a0528bf94e4fdead4
Reviewed-on: https://skia-review.googlesource.com/c/187786
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 19:26:47 +00:00
Mike Reed
d3bde0b798 remove legacy SkPaint getTextBlobIntercepts
Bug: skia:
Change-Id: I59407c5ae9cdbfa6e674ec92f35b0ca7d6a8425f
Reviewed-on: https://skia-review.googlesource.com/c/187787
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-29 19:24:48 +00:00
Brian Salomon
a66be38441 Limit Analytic Clip FP workaround to powervr rogue on x86
Bug: b/123092993
Change-Id: I0be3559c0e90cf16d736f03c7c0a3044cb9d4b70
Reviewed-on: https://skia-review.googlesource.com/c/187784
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-29 15:29:57 +00:00
Robert Phillips
ea8b4fc950 Revert "Split GrContextThreadSafeProxy into its own files"
This reverts commit f8397f2b3f.

Reason for revert: Breaking Flutter build!

Original change's description:
> Split GrContextThreadSafeProxy into its own files
> 
> This just shuffles stuff around.
> 
> Change-Id: Ieab35f50945efe87512d7077cb994132f0e0b6ef
> Reviewed-on: https://skia-review.googlesource.com/c/186874
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I236add95d8a0066037854b5532a7db131d93d603
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/187783
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 14:39:19 +00:00
Robert Phillips
f8397f2b3f Split GrContextThreadSafeProxy into its own files
This just shuffles stuff around.

Change-Id: Ieab35f50945efe87512d7077cb994132f0e0b6ef
Reviewed-on: https://skia-review.googlesource.com/c/186874
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 14:03:47 +00:00
Brian Osman
d8a90f9be1 Converting more debug code to SkJSONWriter
All of SkDrawCommand / SkDebugCanvas now uses SkJSONWriter.
Also removed the bespoke json generator and pretty-printer
in GrAuditTrail. This was the largest volume of code still
using JsonCPP. (There are other stragglers).

Bug: skia:
Change-Id: I3aee554764689ce50c8e707caf26c76093b9bb8f
Reviewed-on: https://skia-review.googlesource.com/c/187040
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-28 19:06:06 +00:00
Greg Daniel
41f0e28fd5 Add MaxAPIVersion to GrVkBackendContext.
This moves us to the correct way of handling the correct version of
Vulkan that the client wants us to use.

Bug: skia:
Change-Id: I6c7962b5d2d48ae142c6a701c30f5af3801ac99b
Reviewed-on: https://skia-review.googlesource.com/c/187382
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-28 19:01:46 +00:00
Mike Reed
5f528e5fd8 Revert "Reland "Revert "remove legacy code for text attributes on paint"""
This reverts commit 3c03c851ad.

Modification was to copy/assign fBitfieldsUInt rather than fBitfields,
since fBitfields might be smaller, and therefore ignore some bits that
we do use in hashing, etc.

Bug: skia:
Change-Id: I5965d5d64bd22bd60f0da797fdfeeffb730588ea
Reviewed-on: https://skia-review.googlesource.com/c/187307
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 18:27:26 +00:00
Brian Salomon
eceb19f37e Remove GrBuffer::mapPtr()
Only used in an assert.

Change-Id: Iecfd853a71d7dd1c22096886465843c7a0122c74
Reviewed-on: https://skia-review.googlesource.com/c/187380
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-01-28 17:41:56 +00:00
Brian Salomon
ede88ab2b4 Remove some unused GrGLGpu member fields and functions.
-Members related to already removed stencil clear program.
-hasExtension() inline memeber function
-declaration for unimplemented setTextureSwizze() member function.

Change-Id: Ibe6054fcb7f7c8c69cfcbbbb12df95f9dcebf9fe
Reviewed-on: https://skia-review.googlesource.com/c/187305
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-01-28 15:29:56 +00:00
Brian Salomon
805cc7a2f8 Avoid setting the GL color mask and clear color redundantly before glClear.
Change-Id: I0830e62fc65fd4a85c27db01aab8e16697c840f7
Reviewed-on: https://skia-review.googlesource.com/c/187304
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-28 15:18:26 +00:00
Mike Reed
3c03c851ad Reland "Revert "remove legacy code for text attributes on paint""
This reverts commit fd0bba81c0.

Reason for revert: PaintTest.cpp:150 failing

Original change's description:
> Revert "Revert "remove legacy code for text attributes on paint""
> 
> This reverts commit fb0e2aa8fd.
> 
> Bug: skia:
> Change-Id: I16bf3c999233f7498a4d76dfbcfb26be725e88f5
> Reviewed-on: https://skia-review.googlesource.com/c/187261
> 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: Ic52282f36841b7402a3a5466b93ef56ecdb6f51b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/187306
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 15:02:08 +00:00
Nigel Tao
22e862430e Let SkWuffsCodec allow workbuf_len == 0
Some Wuffs actions don't require extra 'scratch space'.

Bug: skia:8235
Change-Id: Idcd2e1a8676b3b9f98dcff94ad1450d1e18a0401
Reviewed-on: https://skia-review.googlesource.com/c/187160
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-01-28 14:49:43 +00:00
Brian Salomon
31a60dbd7b Remove GrGLGpu member vars related to already removed clear-as-draw program.
Change-Id: Id193e4ccee77323dd172b83e7d90f94a2691466f
Reviewed-on: https://skia-review.googlesource.com/c/187301
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-01-28 14:46:53 +00:00
Brian Salomon
8bc352c305 Revert "Revert "Avoid checking extension string in GrGLGpu::onResetContext.""
This reverts commit 04c1cccaa4.

Reland that preserves GL_NV_shader_framebuffer_fetch support.

Change-Id: I8d51321a552d0abfd0a8fa36c4d00b9b0e0d8663
Reviewed-on: https://skia-review.googlesource.com/c/187300
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-28 14:39:43 +00:00
Mike Reed
fd0bba81c0 Revert "Revert "remove legacy code for text attributes on paint""
This reverts commit fb0e2aa8fd.

Bug: skia:
Change-Id: I16bf3c999233f7498a4d76dfbcfb26be725e88f5
Reviewed-on: https://skia-review.googlesource.com/c/187261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-28 13:56:24 +00:00
Kevin Lubick
04c1cccaa4 Revert "Avoid checking extension string in GrGLGpu::onResetContext."
This reverts commit a5bc81285a.

Reason for revert: Potentially breaking some Android bots

Original change's description:
> Avoid checking extension string in GrGLGpu::onResetContext.
> 
> Also, remove support for NV_shader_framebuffer_fetch (no longer listed in
> extension registry).
> 
> Change-Id: Icad4ecf057a7e598ce41dd6ee4029cfe0d9488f8
> Reviewed-on: https://skia-review.googlesource.com/c/186873
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I18a744d62af2edce1bdfdc09e68a86535f62b093
Reviewed-on: https://skia-review.googlesource.com/c/187263
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-01-28 13:03:23 +00:00
Mike Reed
fb0e2aa8fd Revert "remove legacy code for text attributes on paint"
This reverts commit 80f4adf98f.

Reason for revert: breaking PaintTest

Original change's description:
> remove legacy code for text attributes on paint
> 
> Bug: skia:2664
> Change-Id: I09f9d1401410d7ca338d7acde5a9660921c74da9
> Reviewed-on: https://skia-review.googlesource.com/c/185460
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=bungeman@google.com,rmistry@google.com,herb@google.com,fmalita@chromium.org,reed@google.com

Change-Id: If9bbb92d6eb064aba30cfa9069051ff60585a269
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2664
Reviewed-on: https://skia-review.googlesource.com/c/187260
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 00:18:09 +00:00
Mike Reed
80f4adf98f remove legacy code for text attributes on paint
Bug: skia:2664
Change-Id: I09f9d1401410d7ca338d7acde5a9660921c74da9
Reviewed-on: https://skia-review.googlesource.com/c/185460
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-27 23:54:45 +00:00
Mike Reed
f6a2348535 remove tricky asint
Bug: skia:
Change-Id: I8d5f9b29b48273a3648dfe925ff3e9e8d0ee71f3
Reviewed-on: https://skia-review.googlesource.com/c/187060
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-25 22:32:45 +00:00
Brian Salomon
a5bc81285a Avoid checking extension string in GrGLGpu::onResetContext.
Also, remove support for NV_shader_framebuffer_fetch (no longer listed in
extension registry).

Change-Id: Icad4ecf057a7e598ce41dd6ee4029cfe0d9488f8
Reviewed-on: https://skia-review.googlesource.com/c/186873
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-01-25 20:15:54 +00:00
Ethan Nicholas
842d31b141 fixed Metal matrix constructors
Bug: skia:8544
Change-Id: Ie1e96ab1ef6e8c032fa510be36c035f91a1f6851
Reviewed-on: https://skia-review.googlesource.com/c/185687
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-01-25 18:37:34 +00:00
Brian Salomon
0d60676556 Actually reuse GrTexture if SkPromiseImageTexture used with multiple
images.

Change-Id: Id68d2f2a4c0012b2219a505f1259a9c9bd014c65
Reviewed-on: https://skia-review.googlesource.com/c/186700
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-25 16:04:49 +00:00
Brian Salomon
35ba614dc5 Remove GrGpuResource::abandon from the public API.
Bug: skia:7966
Change-Id: I222db4f4bc765fad3e5f1461f3a8f3c663bb9429
Reviewed-on: https://skia-review.googlesource.com/c/186545
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-25 15:37:20 +00:00
Brian Salomon
9bc76d96f9 Change the meaning of GrBudgetedType::kUnbudgetedUncacheable.
kUnbudgetedCacheable now means that the resource is never purged
until its unique key is removed.

This fixes an issue where a cached texture for a promise image
might get purged by cache pressure. This in turn could cause
Skia to call the promise image's Fulfill proc multiple times with
no intervening Release calls. The balancing Release calls would
occur, but the policy is that each Fulfill should be balanced by
Release *before* another Fulfill.

Update/add unit tests.

Bug: chromium:922851
Change-Id: I6411e413b3104721ca4bb6e7f07b3b73d14cbcf9
Reviewed-on: https://skia-review.googlesource.com/c/186361
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-25 14:13:00 +00:00
Brian Salomon
aa6ca0a8bf Require explicit GrWrapCacheable specification in more places.
Make all wrapped resources be kUnbudgetedUncacheable except those
created by AHardwareBuffer image generators and as backings for promise
images.

Make all non-wrapped unbudgeted resources be kUnbudgetedUncacheable.

Update unit tests to mostly use GrWrapCacheable::kNo except where they
are testing the distinction.

Update unit tests for new expectations.
Bug: chromium:922851
Change-Id: I4d3bdaa161ffc76390f26334bcb7e2b47dd9319d
Reviewed-on: https://skia-review.googlesource.com/c/185004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-25 00:29:27 +00:00
Eric Karl
c0b2ba2235 Invalidate Vulkan CB state after vending it out via drawable
When we vend out a Vulkan Secondary Command Buffer via GpuDrawHandler,
we need to invalidate our local Skia state for this Command Buffer, as
the external code is free to make changes to the state.

Bug: 900965
Change-Id: Iddeebff4b93c10b78bd45191fd16acde0567bc68
Reviewed-on: https://skia-review.googlesource.com/c/186000
Auto-Submit: Eric Karl <ericrk@chromium.org>
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-01-24 23:13:48 +00:00
Brian Salomon
fa2ebeaf33 Replace bool purgeImmediately with enum GrWrapCacheable.
Store budgeted status as a tri-state enum on GrGpuResource:
kBudgeted
kUnbudgetedCacheable
kUnbudgetedUncacheable

Uncacheable vs. Cacheable captures the current distinction between
wrapped resources created with purgeImmediately or !purgeImmediately.

Non-wrapped and unbudgeted resources are all kUnbudgetedCacheable to
match current behavior.

This change just introduces the new types. No behavior is changed.

Bug: chromium:922851

Change-Id: Ic2387bf321cf9b56b4c9ffd9dbef8ade60f9cb98
Reviewed-on: https://skia-review.googlesource.com/c/185003
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-24 21:26:24 +00:00
Brian Osman
5deadca8fe Remove nearly all use of SkColorSpaceTransferFn
Most interfaces had migrated to skcms_TransferFunction. Having both was
awkward in several places, so this (almost) finishes the migration. Some
clients are calling SkICC::WriteToICC, so that's left intact. After this
CL, those clients can switch to using SkWriteICCProfile directly, and
WriteToICC can be deleted.

Bug: skia:
Change-Id: I46ebaeb1f5b20bf0c620e8a620e73ee323a1de31
Reviewed-on: https://skia-review.googlesource.com/c/186541
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-24 17:45:19 +00:00
Derek Sollenberger
08c06297bf Revert "Implement XP factory dumping"
This reverts commit 8d8224fcc1.

Reason for revert: Adds public API without documentation breaking bookmaker bot

Original change's description:
> Implement XP factory dumping
> 
> Bug: skia:
> Change-Id: If2e6a20b072d895ca9770268db5006a9400f2e70
> Reviewed-on: https://skia-review.googlesource.com/c/186180
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I66e8508d8760b5a95e7f98597b4907d134122013
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/186542
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2019-01-24 16:30:44 +00:00
Chris Dalton
8d8224fcc1 Implement XP factory dumping
Bug: skia:
Change-Id: If2e6a20b072d895ca9770268db5006a9400f2e70
Reviewed-on: https://skia-review.googlesource.com/c/186180
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-01-23 22:19:11 +00:00
Michael Ludwig
94633de528 Increase tolerance in rectilinear quad detection
Bug: chromium:923946
Change-Id: Idabe4dde28aa37e42e573c36fba9cdb8c0135689
Reviewed-on: https://skia-review.googlesource.com/c/185685
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-01-23 18:57:42 +00:00
Herb Derby
087fad7900 Add getTypefaceOrDefault and refTypefaceOrDefault
* Remove GetTypefaceOrDefault from SkPaint and SkFont
* Remove RefTypefaceOrDefault from SkPaint and SkFont

Change-Id: I04ae777142c2bdec849508b611b844418bbaedff
Reviewed-on: https://skia-review.googlesource.com/c/185781
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-01-23 18:52:09 +00:00
Chris Dalton
945ee652d7 Enforce non-overlap constraint from GrRenderTargetOpList
Enforces this constraint from one central location, rather than
relying on each Op to remember to check if overlap is allowed from its
onCombineIfPossible method.

Fixes an issue where we need to check the total bounds of both chains
for overlap (not the bounds of individual Ops).

Bug: skia:8671
Change-Id: I163651c868847884459acfc00d13ffdfca3a27c3
Reviewed-on: https://skia-review.googlesource.com/c/185815
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-23 16:48:15 +00:00
Michael Ludwig
7545190e32 Add new experimental API for rectangles with per-edge AA control
Also updates GM_draw_quad_set to use this API instead of the
bulk API on GrRenderTargetContext.

Bug: skia:8506
Change-Id: Ia342d83c509f9db69f06f01599c7041c98aabdb6
Reviewed-on: https://skia-review.googlesource.com/c/184488
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-23 16:45:01 +00:00
Chris Dalton
302d5be746 Rename GrCaps::canUseAdvancedBlendEquation
Looks like it's had a misleading name for almost 4 years now.

Bug: skia:
Change-Id: Ifb6dece8910c8d93de2a8ff5cadab1845b4ce4e6
Reviewed-on: https://skia-review.googlesource.com/c/186060
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-01-23 16:13:31 +00:00
Mike Reed
4f81bb7331 remove all support for drawText
Bug: skia:2664
Change-Id: Iee5fee505b5be50b22ddcbdb17abf7e66b7b4d6f
Reviewed-on: https://skia-review.googlesource.com/c/185001
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-01-23 14:50:35 +00:00
Chris Dalton
ee21e6b745 Move Op chain bounds calculations into tryConcat
Bug: skia:8671
Change-Id: I253a753db1aa225bd4e0a7e9bd869dbd52f2f063
Reviewed-on: https://skia-review.googlesource.com/c/185811
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-01-22 23:30:38 +00:00
Mike Reed
77f94ea72b Move more utils into SkFontPriv, IWYU
Fissioned from https://skia-review.googlesource.com/c/skia/+/185460

Bug: skia:
Change-Id: Iaf980e931c17196f917602fc58fc39ab51e3d248
Reviewed-on: https://skia-review.googlesource.com/c/185840
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-22 22:24:03 +00:00
Ethan Nicholas
6ac8d36116 Revert "Reland "fixed VK geometry shaders""
This reverts commit 347d36586c.

Reason for revert: ok, it wasn't a fluke

Original change's description:
> Reland "fixed VK geometry shaders"
> 
> This is a reland of eef1ed0b1f
> 
> Original change's description:
> > fixed VK geometry shaders
> > 
> > Bug: skia:
> > Change-Id: Ia26a99a6b85dba97e259525c4af0f4bdc464d804
> > Reviewed-on: https://skia-review.googlesource.com/c/184561
> > Reviewed-by: Chris Dalton <csmartdalton@google.com>
> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 
> Bug: skia:
> Change-Id: I611e624c6ee58648d75a832fd065a636eb0de413
> Reviewed-on: https://skia-review.googlesource.com/c/185699
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

Change-Id: Id8ce7bc536621b4d92da7d0cb47ecbdfdb798151
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/185883
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-01-22 21:44:01 +00:00
Ethan Nicholas
347d36586c Reland "fixed VK geometry shaders"
This is a reland of eef1ed0b1f

Original change's description:
> fixed VK geometry shaders
> 
> Bug: skia:
> Change-Id: Ia26a99a6b85dba97e259525c4af0f4bdc464d804
> Reviewed-on: https://skia-review.googlesource.com/c/184561
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

Bug: skia:
Change-Id: I611e624c6ee58648d75a832fd065a636eb0de413
Reviewed-on: https://skia-review.googlesource.com/c/185699
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-01-22 20:53:20 +00:00
Brian Osman
02518801df Remove SkGammaNamed / gammaNamed() from SkColorSpace
Note: This removes from the public API. The two most commonly
checked values from gammaNamed can still be tested with
gammaCloseToSRGB and gammaIsLinear.

Others can be tested for (exact or approximate) equality by
calling isNumericalTransferFn, and testing the resulting
skcms_TransferFunction in any method the client wants.

Bug: skia:
Change-Id: I9b63ffea81bba461795cad946050c7083b02eec8
Reviewed-on: https://skia-review.googlesource.com/c/185684
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-22 20:52:35 +00:00