Commit Graph

4925 Commits

Author SHA1 Message Date
Cary Clark
785586af7d remove unused serialization in textblob
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>
2018-07-19 14:32:45 +00:00
Heather Miller
81bb123957 Update Skia milestone to 70
TBR:reed

Bug: skia:
Change-Id: Ic85fa9f11d5c635ab7b9c71d31227f29d856473a
Reviewed-on: https://skia-review.googlesource.com/142326
Reviewed-by: Heather Miller <hcm@google.com>
2018-07-19 13:44:30 +00:00
Hal Canary
2b0e6cd4d9 Reland "SkDEBUGF: use __VA_ARGS__"
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>
2018-07-18 15:37:41 +00:00
Herb Derby
4b3a5152a3 MakeAsDrawText for SkTextBlob
Change-Id: I04ebca6b318e0654cc1e598aa323cfb9a21e5a5e
Reviewed-on: https://skia-review.googlesource.com/141960
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-17 22:16:41 +00:00
Ben Wagner
d5148e3314 Move SkNoncopyable to include/private.
Change-Id: I62f60ea52faeebddecacf03d9429ac3f7c516b8e
Reviewed-on: https://skia-review.googlesource.com/141823
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-07-17 21:39:51 +00:00
Robert Phillips
a8cdbd7431 Restore SkLightingShader and associated classes
This reverts https://skia-review.googlesource.com/c/skia/+/31140 (Remove SkLightingShader and associated classes) and updates the classes to ToT

Change-Id: I3b1df1704cca8907aa00f081a7e93339b65ad4fa
Reviewed-on: https://skia-review.googlesource.com/141545
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-07-17 17:24:50 +00:00
Cary Clark
53c8769002 remove unused untested parts of text blob
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.org
TBR=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>
2018-07-17 17:01:20 +00:00
Brian Osman
f6db495d2d Remove SkTransferFunctionBehavior
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>
2018-07-17 14:18:20 +00:00
Cary Clark
7651c1611e refresh generated includes
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>
2018-07-13 14:23:24 +00:00
Herb Derby
8a6348e6d2 Introduce text blob processing but don't wire it up
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>
2018-07-13 03:21:54 +00:00
Ben Wagner
0277440d22 Remove SkRefCnt_SafeAssign.
Change-Id: I590e74c2de8e0c2b8d407bd869c97a4d3bd98fed
Reviewed-on: https://skia-review.googlesource.com/141041
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-07-12 23:42:44 +00:00
Ben Wagner
9ec70c6bd3 Remove SkSafeSetNull.
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>
2018-07-12 20:59:20 +00:00
Brian Osman
b62f50cf76 Replace nearly all kRespect with kIgnore
- 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>
2018-07-12 20:54:14 +00:00
Ben Wagner
e346b1eea4 Add SkTypeface::getVariationDesignParameters
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>
2018-07-12 17:30:20 +00:00
Mike Reed
77c138f2cd remove unneeded scale from procs
Bug: skia:
Change-Id: I85adbbaf0e9d7d23c3f07490a1d323c87e8aa4da
Reviewed-on: https://skia-review.googlesource.com/140980
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-07-12 14:33:20 +00:00
Ben Wagner
2c312c4f58 Remove SkDrawFilter.
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>
2018-07-12 02:36:44 +00:00
Robert Phillips
e923cccb25 Revert "SkDEBUGF: use __VA_ARGS__"
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>
2018-07-11 16:45:18 +00:00
Hal Canary
2267a09235 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>
2018-07-11 15:40:18 +00:00
Brian Osman
c87cfb674b Remove old lazy image decoding heuristic logic
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>
2018-07-11 14:07:08 +00:00
Ruiqi Mao
9a6e42ff18 added caching of SkVertices
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>
2018-07-09 20:31:28 +00:00
Yong-Hwan Baek
688a8e5331 More workarounds on Windows Debug DLL crash.
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>
2018-07-09 17:20:17 +00:00
Brian Osman
a50205fca5 Add color type to the image filter DAG's OutputProperties
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>
2018-07-06 18:34:58 +00:00
Ruiqi Mao
c05aa7d163 Revert "added skeletal animation support to GPU backend"
This reverts commit b6307340e8.

Reason for revert: patch/atlas failing in gold

Original change's description:
> added skeletal animation support to GPU backend
> 
> 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>

TBR=robertphillips@google.com,brianosman@google.com,reed@google.com,ruiqimao@google.com

Change-Id: Idfaf016a7ff4cdd8af2543d510706f489d04417a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/139281
Reviewed-by: Ruiqi Mao <ruiqimao@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
2018-07-03 21:18:18 +00:00
Ruiqi Mao
b6307340e8 added skeletal animation support to GPU backend
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>
2018-07-03 16:07:44 +00:00
Ruiqi Mao
94d57c477f updated SkCanvas documentation for animation overloads of drawVertices
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>
2018-07-03 13:33:43 +00:00
Ruiqi Mao
f510149da8 skeletal animation support added to API and software backend
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>
2018-06-29 19:34:28 +00:00
Robert Phillips
385804514e Revert "Remove drawTextBlob from device use drawGlyphRunList"
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>
2018-06-28 12:00:47 +00:00
Herb Derby
e2e52e46ca 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>
2018-06-28 03:36:16 +00:00
Cary Clark
224c700a1f sync docs up with tip of tree
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.com
R=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>
2018-06-27 15:47:45 +00:00
Mike Klein
3785471ff6 basic first pass at RGBA F32 support
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>
2018-06-26 19:02:52 +00:00
Ben Wagner
6a284b7716 Clean up includes in SkMallocPixelRef
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>
2018-06-26 16:47:39 +00:00
Ben Wagner
900b5364d1 Fix SkPaint::getTypeface() documentation.
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>
2018-06-25 11:32:25 +00:00
Ben Wagner
cd224b17e8 Revert "SkRefCnt, SkTypes: fix includes for clients"
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>
2018-06-21 20:06:19 +00:00
Cary Clark
472ab81032 abort really big path fuzzing
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>
2018-06-21 16:42:37 +00:00
Hal Canary
51382998dc Mark all deleted methods private
Change-Id: I33f51efeaeabcdd7add2a88d89ecc9c1e8c054d7
Reviewed-on: https://skia-review.googlesource.com/135380
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-06-21 16:37:32 +00:00
Hal Canary
61582510ee 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>
2018-06-21 14:42:31 +00:00
Ben Wagner
c2a29fcc78 Remove utility include from SkTypes.h
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>
2018-06-20 21:44:57 +00:00
Hal Canary
224796587a SkRefCnt.h no longer uses SkTLogic.h
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>
2018-06-20 21:22:57 +00:00
Ben Wagner
b70e3b4831 Remove SkTSwap.
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>
2018-06-20 18:19:17 +00:00
Hal Canary
c36f7e735f SkTypes.h: general cleanup
- SkToBool now inline function.
 - SK_Invalid{Gen|Unique}ID, SK_MSecMax now constexpr.
 - SkNoncopyable deleted methods marked private.
 - Consistant comment style.

Change-Id: I1af6889fdf4274d6d698e8f11b29075dbe39ba12
Reviewed-on: https://skia-review.googlesource.com/135446
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-20 15:20:11 +00:00
Hal Canary
e2098c4936 SkFontMgr.h is a core header.
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>
2018-06-20 14:46:28 +00:00
Mike Reed
0917fad2c6 move imagefilters into separate dir and flag for build.gn
Requires https://chromium-review.googlesource.com/c/chromium/src/+/1105062

Bug: skia:
Change-Id: I948056234efa57c0f727a61d5fb3258034de5199
Reviewed-on: https://skia-review.googlesource.com/135566
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-06-19 20:16:38 +00:00
Ben Wagner
f08d1d0ce1 Stop using SkTSwap.
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>
2018-06-19 02:06:31 +00:00
Mike Klein
e72e773ad0 remove SkTCast
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>
2018-06-18 17:22:18 +00:00
Ben Wagner
29f2eaf6e5 Remove string.h from SkTypes.h
Change-Id: I2be84f37ea11a386206a96d2fef6e0fc9464e21b
Reviewed-on: https://skia-review.googlesource.com/135264
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-15 20:32:05 +00:00
Ben Wagner
b0897650f1 Reland "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
This reverts commit ab17347df3.

Reason for revert: Chromium should now be ok.

Original change's description:
> Revert "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
>
> This reverts commit e1bc7de7c0.
>
> Reason for revert: chrome used it
>
> Original change's description:
> > Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
> >
> > sed 's/SK_MaxSizeT/SIZE_MAX/g'
> > sed 's/SK_MaxU32/UINT32_MAX/g'
> > sed 's/SK_MaxU16/UINT16_MAX/g'
> >
> > SK_MinU32 and SK_MinU16 were unused
> >
> > Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
> > Reviewed-on: https://skia-review.googlesource.com/134607
> > Commit-Queue: Hal Canary <halcanary@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=halcanary@google.com,bungeman@google.com,reed@google.com
>
> Change-Id: I1e2c440dcf9f59bf87c1fea113248cd5136f7519
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/134921
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-ozone-rel
TBR=halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: I7709f9715bea0463b85b5b0a89712ac1020fcddb
Reviewed-on: https://skia-review.googlesource.com/135180
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-15 16:26:05 +00:00
Cary Clark
b7a72a5017 fix bookmaker
make deleted constructors private
fix indexing bug that finds private methods

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

Bug: skia:6898
Change-Id: I86c0bafbb7c56131c503054e021ec844731c900d
Reviewed-on: https://skia-review.googlesource.com/135058
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-06-15 09:42:24 +00:00
Hal Canary
14f739043b SkCanvas, SkImageGenerator, SkStream: remove SkNoncopyable
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>
2018-06-14 19:33:04 +00:00
Hal Canary
e08ce40f4a SkRefCnt no longer a SkNoncopyable
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>
2018-06-14 19:14:04 +00:00
Hal Canary
33f920e3f1 SkImageInfo: make use of SkISize
Change-Id: Id3c427cae2988dcc2dfcf4dc713921142469e3f6
Reviewed-on: https://skia-review.googlesource.com/134840
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 18:04:17 +00:00