The SKTextBlob serialization code that is tested by Skia is
unused by Chrome. The serialization code that is
used by Chrome is untested by Skia.
Remove the unused code; test the used code.
The code path introduced nearly a year ago,
likely for slimming paint, attempts to make
text blobs smarter by allowing the reuse of typefaces.
Maybe there needs to be a Chrome bug / feature
request to use this?
If if turns out there is no interest to do so,
This CL aligns used interfaces with tests.
R=reed@google.com,fmalita@google.com,bungeman@google.com
Bug: skia:6818
Change-Id: I9b3ec0c326495322986ba26f20f901bcb208be73
Reviewed-on: https://skia-review.googlesource.com/141542
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
This is a reland of 2267a09235
Original change's description:
> SkDEBUGF: use __VA_ARGS__
>
> Change-Id: I42a47e821ff7a7f6cec65b38a8216cabbf0acfce
> Reviewed-on: https://skia-review.googlesource.com/139860
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
Change-Id: Ia06567e441a414f4dcdbe5663160082f889f9fef
Reviewed-on: https://skia-review.googlesource.com/141762
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
SkTextBlob has a number of untested entry points
to serialize and deserialize. Privitize ones only used
by Skia, and remove ones suspected to be unused
and untested.
R=fmalita@chromium.orgTBR=reed@google.com,bsalomon@google.com
Bug: skia:6818
Change-Id: I6a9982a26a883982af3592f3302029a1bcdf5aa3
Reviewed-on: https://skia-review.googlesource.com/141820
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Bug: skia:
Change-Id: Iccbe609b2a8d4c9098ef36aa6530dbc3771e0c11
Reviewed-on: https://skia-review.googlesource.com/141055
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
the newest ones (SkBlendMode.h, SkPicture.h, SkRRect.h)
need additional editing; enough has changed that it is
time to refresh anyway.
TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=141043
Bug: skia:6818
Change-Id: Ic123b02f57005a087f8655cafa1a2537529beca5
Reviewed-on: https://skia-review.googlesource.com/141043
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Have all the old code paths start using lists in preparation
for introducing text blobs.
Change-Id: I65cc02ee3da63bc3c9492db78a08b0eee3b1f931
Reviewed-on: https://skia-review.googlesource.com/141081
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Update all users to sk_sp.
Change-Id: I6453b9456b9a8f9e2b756381797f1382ef9e6561
Reviewed-on: https://skia-review.googlesource.com/141052
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
- Encoders and decoders always assume kIgnore.
- They are less opinionated about F16 and color space,
we just trust the color space that's passed in, and
put that directly in the image (no sRGB encoding).
- SkBitmap and SkPixmap read/write pixels functions were
defaulting to kResepct, those are now always kIgnore.
- Many other bits of plumbing are simplified, and I
added a default of kIgnore to SkImage::makeColorSpace,
so we can phase out that argument entirely.
- Still need to add defaults to other public APIs that
take SkTransferFunctionBehavior.
- This makes gold think that we've dramatically changed
the contents of all F16 images, but that's because
it doesn't understand the (now linear) color space
that's embedded. Once we triage them all once, they
will work fine (and they'll look perfect in the browser).
Bug: skia:
Change-Id: I62fa090f96cae1b67d181ce14bd91f34ff2ed747
Reviewed-on: https://skia-review.googlesource.com/140570
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This adds a way for users to query the axis parameters for a typeface.
Change-Id: Idc2ac0d84bc7ae2ca484ae410cba5b01883418e5
Reviewed-on: https://skia-review.googlesource.com/137706
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I0204a9522e828c87bb7c6c20ae34ce51161442af
Reviewed-on: https://skia-review.googlesource.com/137895
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 2267a09235.
Reason for revert: It looks like Google 3 is failing to compile w/ this CL
Original change's description:
> SkDEBUGF: use __VA_ARGS__
>
> Change-Id: I42a47e821ff7a7f6cec65b38a8216cabbf0acfce
> Reviewed-on: https://skia-review.googlesource.com/139860
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
TBR=mtklein@google.com,halcanary@google.com,reed@google.com
Change-Id: I3aab490f3d2fea103fc915ca01cb0e294df86739
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/140660
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I42a47e821ff7a7f6cec65b38a8216cabbf0acfce
Reviewed-on: https://skia-review.googlesource.com/139860
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This led to removing a lot of transfer function behavior code. There is
more that could be done, and we need to add in decoding to dst color
space, but this CL is almost entirely mechanical.
Change-Id: I91b2169f95aadcfaacdd2b9821bb1a01ce53f9a6
Reviewed-on: https://skia-review.googlesource.com/140349
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkVertices can now be "volatile", meaning they should not be cached.
SkVertices is volatile by default if the argument is not given.
Pulled from reverted CL: https://skia-review.googlesource.com/c/skia/+/138596
Docs-Preview: https://skia.org/?cl=139545
Bug: skia:
Change-Id: I92cf832efe1c0aaa8f432eedde2678582dd2454e
Reviewed-on: https://skia-review.googlesource.com/139545
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
SkData and SkTextBlob overwrites delete operator in header file.
Which causes crash on Windows Debug DLL Builds.
Sample Solution can be found in https://github.com/DevHwan/SkiaDLLTest
Bug: skia:
Change-Id: I36bc9445f5cd17afdf852009a0695036ee18ecf0
Reviewed-on: https://skia-review.googlesource.com/139680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Don't try to guess the pixel config to use for intermediates. Instead,
just make the intermediates in the same color type (and space) as the
final destination. This removes some no-longer-correct logic that was
using sRGB configs, resulting in linear blending and precision loss.
Change-Id: I627c47193a9f2889c3dc121170ff3e7d5d315fa0
Reviewed-on: https://skia-review.googlesource.com/139547
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
added caching of SkVertices
Docs-Preview: https://skia.org/?cl=138596
Bug: skia:
Change-Id: Ia750f55f5f6d0de250d9e9c5619f4d1ac856f9f5
Reviewed-on: https://skia-review.googlesource.com/138596
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
changed bookmaker ParserCommon::writeBlockTrim limit to 20000
disabled broken SkPaint::containsText example
Docs-Preview: https://skia.org/?cl=138862
Bug: skia:8123
Change-Id: Ib4003bf7b9603bf652f86cd56e0975cd09bcbf71
Reviewed-on: https://skia-review.googlesource.com/138862
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkCanvas::drawVertices now supports overloads that take an array of bone deformation matrices.
SkVertices::MakeCopy and SkVertices::Builder now support two additional optional attributes, boneIndices and boneWeights.
Bug: skia:
Change-Id: I30a3b11691e7cdb13924907cc1401ff86d127aea
Reviewed-on: https://skia-review.googlesource.com/137221
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
This reverts commit e2e52e46ca.
Reason for revert: See if this is blocking the Chrome roll
Original change's description:
> Remove drawTextBlob from device use drawGlyphRunList
>
> Convert all backends to use GlyphRunList instead of
> text blobs. If the device did not originally implement
> drawTextBlob it will be simulated by drawPosText on the
> device.
>
> Other changes:
> Change to using an origin from absolulte positioning. The GPU
> code uses origin change to update blobs under translation.
>
> Change cluster to use const uint32_t instead of just
> uint32_t.
>
> Add SkPaint to runs.
>
> The draw filter is hosted up to the canavas level and applied there.
>
> Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2
> Reviewed-on: https://skia-review.googlesource.com/137224
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Hal Canary <halcanary@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com,reed@google.com,khushalsagar@chromium.org,khushalsagar@google.com
Change-Id: I4d93a534990c89deee7d3aaa00ec40d47e0d2ece
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/138120
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Convert all backends to use GlyphRunList instead of
text blobs. If the device did not originally implement
drawTextBlob it will be simulated by drawPosText on the
device.
Other changes:
Change to using an origin from absolulte positioning. The GPU
code uses origin change to update blobs under translation.
Change cluster to use const uint32_t instead of just
uint32_t.
Add SkPaint to runs.
The draw filter is hosted up to the canavas level and applied there.
Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2
Reviewed-on: https://skia-review.googlesource.com/137224
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Also check in work in progress for blend modes,
round rects, and a placeholder for pictures.
One minor include change to add a parameter name
for SkBlendMode function.
TBR=reed@google.comR=caryclark@google.com
Docs-Preview: https://skia.org/?cl=134200
Bug: skia:6898
Change-Id: I5d2a9221d61edb32d9c7edbb3193401605b2b513
Reviewed-on: https://skia-review.googlesource.com/134200
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Draws basically the same as f16.
The existing load_f32, load_f32_dst, and store_f32 stages all had the
same bug that we'd never noticed because dy was always 0 until now.
Change-Id: Ibbd393fa1acc5df414be4cdef0f5a9d11dcccdb3
Reviewed-on: https://skia-review.googlesource.com/137585
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Came across this unnecessary includes while experimenting with WASM
Change-Id: I68061c7bbd18ed5695b94b3b8de6dbb63407b8ee
Reviewed-on: https://skia-review.googlesource.com/137582
Reviewed-by: Mike Klein <mtklein@google.com>
SkPaint::getTypeface() allows the caller to borrow a pointer to its
SkTypeface, it does not affect ownership. The existing documentation would
lead a user to beleive that getTypeface() increments the reference count,
but it does not.
TBR=reed@google.com
Change-Id: Ic1a660b026e3c4295f9f0de28abfde29c3f05524
Reviewed-on: https://skia-review.googlesource.com/137183
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
This reverts commit 61582510ee.
Reason for revert: Chromium should now be fixed.
Original change's description:
> SkRefCnt, SkTypes: fix includes for clients
>
> Change-Id: I1cfdc03963eaab9687608974958d20411806cfeb
> Reviewed-on: https://skia-review.googlesource.com/136592
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Hal Canary <halcanary@google.com>
TBR=halcanary@google.com
Change-Id: I1a3588ed9e19ee5884f8a907abcfc2aa00cfe5e9
Reviewed-on: https://skia-review.googlesource.com/136700
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This adds a couple of special cases
to stop the fuzzer from timing out.
The first occurs when the fuzzer generates
a very large path with very large quads.
Count the subdivisions and stop after a while.
The second occurs with a normal path and
1D path effect with a very small advance.
Count the points and stop after a while.
R=reed@google.com,bsalomon@google.com,kjlubick@google.com
Bug: oss-fuzz:8349,oss-fuzz:8805
Change-Id: I86130e3f512f48e5a39335412435eabc245ed193
Reviewed-on: https://skia-review.googlesource.com/135709
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
No longer needed by SkTypes.
Change-Id: I7af305cea2d2a5989992b5ffe76dabae85b18fe9
Reviewed-on: https://skia-review.googlesource.com/136246
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: Iaeb886c1c80ea1603dc86ed40c8cfffec333b456
Reviewed-on: https://skia-review.googlesource.com/136244
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
No longer used. Use swappable instead.
Change-Id: I76935f33ac084dbe067c34de7fb332e51a063cb6
Reviewed-on: https://skia-review.googlesource.com/136221
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: Idad3c8b6961bb617afedb8e353060b9044edaee3
Reviewed-on: https://skia-review.googlesource.com/136066
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Use std::swap instead. It does not appear that any external user
specializes SkTSwap, but some may still use it. This removes all use in
Skia so that SkTSwap can later be removed in a smaller CL. After that
the <utility> include can be removed from SkTypes.h.
Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753
Reviewed-on: https://skia-review.googlesource.com/135578
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
SkTCast is functionally equivalent to reinterpret_cast.
The comment about SkTCast helping to avoid strict alising issues is not
true. Dereferencing a pointer cast to a pointer of an unrelated type is
always undefined, even if smuggled through a union like in SkTCast.
To really avoid aliasing issues, you need to make a union[1] of the two
value types, or better, memcpy between values. I've had to fix
MatrixText.cpp where switching to reinterpret_cast actually let Clang
notice and warn that we're exploiting undefined behavior, and
GrSwizzle.h and SkCamera.cpp caught by GCC.
I've switched SkTLList over to use SkAlignedSTStorage, which seems
to help convince some GCC versions that fObj is used in a sound way.
[1] The union punning trick is non-standard in C++, but GCC and MSVC
both explicitly support it. I believe Clang does not officially
explicitly support it, but probably does quietly for GCC compatibility.
Change-Id: I71822e82c962f9aaac8be24d3c0f39f4f8b05026
Reviewed-on: https://skia-review.googlesource.com/134947
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: If2b27f62c3d825b388239ef6ee35722d46eed664
Reviewed-on: https://skia-review.googlesource.com/134949
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Change-Id: I345c83783c578f5ce25b4fc46c971c055e113cd0
Reviewed-on: https://skia-review.googlesource.com/134945
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>