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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
-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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>