Commit Graph

25 Commits

Author SHA1 Message Date
Brian Osman
a5842bc903 Move SkSpan to include/, for use in public API
Change-Id: I674f038600afd6d49316c1ece515941ee5579068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406939
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-12 13:19:32 +00:00
Brian Osman
ae87bf1e49 Remove SkSpan class template deduction guides
This effectively reverts a80ce1a36d,
and goes back to using SkMakeSpan (which works in C++14).

Change-Id: Iaa63c86b5acaadbdd60588b0a5c703820e810770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406938
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-11 20:06:29 +00:00
Herb Derby
a80ce1a36d remove SkMakeSpan use ctor parameter deduction
Change-Id: I3a1b12f7eb906fe105eb7e9f6bc10e3745f61528
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320264
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-02 01:41:03 +00:00
John Stiles
df07800f95 Include the SkTSort header only where it is used.
Change-Id: If51be35205b40c4a22979a4b49b031126af1dde7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302500
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-14 14:19:06 +00:00
John Stiles
6e9ead9166 Revert "Remove custom SkSort algorithms."
This reverts commit 70474c1cb0.

Reason for revert: bot build failure

Original change's description:
> Remove custom SkSort algorithms.
> 
> SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
> The difference is small on randomized inputs, but quite significant for
> semi-ordered inputs (forward/backward/repeated). There doesn't seem to
> to be any compelling advantage to SkTQSort.
> 
> Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u
> 
> (These performance numbers are from an optimized build my local machine;
> it's possible that we might see different results on the test bots.)
> 
> Change-Id: Iaf19563041547eae7de2953be249129108f093b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I1126dd4cda95716dac225ad32d5b0e5cf3f09421
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302447
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-14 00:25:05 +00:00
John Stiles
70474c1cb0 Remove custom SkSort algorithms.
SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
The difference is small on randomized inputs, but quite significant for
semi-ordered inputs (forward/backward/repeated). There doesn't seem to
to be any compelling advantage to SkTQSort.

Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u

(These performance numbers are from an optimized build my local machine;
it's possible that we might see different results on the test bots.)

Change-Id: Iaf19563041547eae7de2953be249129108f093b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-13 23:35:20 +00:00
Chris Dalton
de5003768b Remove SkPath::RawIter from tests/tools/samplecode
Change-Id: I66c1b4aee9b07a4db294ed0cd82d01f3097c6acb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287857
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-06 16:31:53 +00:00
Brian Salomon
74c19de3be Add SkUNREACHABLE to definition of SK_ABORT.
Remove return statements immediately following SK_ABORTs.

Change-Id: I6446b6ba3a6fb272d84ea27f38cf366095cf801d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233565
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-09 20:43:39 +00:00
Herb Derby
9ee1edda15 Add SkMakeSpan and helpful conversion
SkMakeSpan uses function type inference to remove boilerplate
code. The converting casts simplifies dealing with T* to const T*
uses.

Change-Id: I1851e144c4e530c275710514ce30ad75a7eb94c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225192
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-07-02 21:49:09 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Klein
0cffcbf97b de-Sk tools/font, and git clang-format
Change-Id: I0326eb9cc1e1e38b0fdc417567987a595f9021d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202310
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:36:52 +00:00
Mike Reed
94cca60bfa start to use font for measure, not paint
-- lots more where this came from

Bug: skia:2664
Change-Id: I8bb47f02c156b0b88fbb92fec73af0eb6641b1bf
Reviewed-on: https://skia-review.googlesource.com/c/173769
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-12-02 21:31:36 +00:00
Mike Reed
b5784ace85 use SkFontMetrics so we can deprecated the typedef
Bug: skia:
Change-Id: Icd40c042b0a8251bbd0b39dd3ee1a4634fff379f
Reviewed-on: https://skia-review.googlesource.com/c/170344
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-12 15:03:03 +00:00
Mike Reed
6e24cd3e28 Reland "hide setTextAlign"
This reverts commit f10ea21088.

Reason for revert: flag added for google3

Original change's description:
> Revert "hide setTextAlign"
> 
> This reverts commit 43c718302e.
> 
> Reason for revert: Google 3 roll.
> 
> Original change's description:
> > hide setTextAlign
> > 
> > Bug: skia:8493
> > Change-Id: Ib3347f600300e90d5bcc47910fd75244039a016c
> > Reviewed-on: https://skia-review.googlesource.com/c/164697
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> 
> TBR=djsollen@google.com,bungeman@google.com,herb@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: I877bf993e71a6e81f1322c799c533bfea6c5813f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8493
> Reviewed-on: https://skia-review.googlesource.com/c/165660
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I0f224cd560cea12ddac3cd48d244f85ccd943086
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8493
Reviewed-on: https://skia-review.googlesource.com/c/165681
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-27 14:39:05 +00:00
Brian Osman
f10ea21088 Revert "hide setTextAlign"
This reverts commit 43c718302e.

Reason for revert: Google 3 roll.

Original change's description:
> hide setTextAlign
> 
> Bug: skia:8493
> Change-Id: Ib3347f600300e90d5bcc47910fd75244039a016c
> Reviewed-on: https://skia-review.googlesource.com/c/164697
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: I877bf993e71a6e81f1322c799c533bfea6c5813f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8493
Reviewed-on: https://skia-review.googlesource.com/c/165660
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-27 12:59:53 +00:00
Mike Reed
43c718302e hide setTextAlign
Bug: skia:8493
Change-Id: Ib3347f600300e90d5bcc47910fd75244039a016c
Reviewed-on: https://skia-review.googlesource.com/c/164697
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-27 00:37:29 +00:00
Hal Canary
8a00144035 test,tools: whitespace changes for clang-format
Change-Id: I67529f6c0ac26da603f60af22c620f8f603d8a19
Reviewed-on: https://skia-review.googlesource.com/155564
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 17:50:51 +00:00
Mike Klein
d9187c085b Revert "SkMath takes some functions from from SkTypes"
This reverts commit 3b347232bc.

Reason for revert: tree done gone red.

Original change's description:
> SkMath takes some functions from from SkTypes
> 
> Moved to include/core/SkMath.h: Sk{Is|}Align{2|4|8|Ptr}, SkLeftShift,
> SkAbs{32|}, SkM{ax|in}32 SkTM{in|ax}, SkTClamp, SkFastMin32, SkTPin.
> 
> Change-Id: Ibcc07be0fc3677731048e7cc86006e7aa493cb92
> Reviewed-on: https://skia-review.googlesource.com/133381
> Auto-Submit: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=mtklein@google.com,halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: I44073cf397e2a3a6a941a90f0aa63c6396d4c742
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/152587
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-07 17:32:54 +00:00
Hal Canary
3b347232bc SkMath takes some functions from from SkTypes
Moved to include/core/SkMath.h: Sk{Is|}Align{2|4|8|Ptr}, SkLeftShift,
SkAbs{32|}, SkM{ax|in}32 SkTM{in|ax}, SkTClamp, SkFastMin32, SkTPin.

Change-Id: Ibcc07be0fc3677731048e7cc86006e7aa493cb92
Reviewed-on: https://skia-review.googlesource.com/133381
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-07 17:18:46 +00:00
Ben Wagner
fd7957c8f6 Make create_test_font less global-ish.
The data flow of create_test_font.cpp is difficult to follow due to use
of mutablility and globals. This removes all of the non-local mutability
and globals.

In addition this updates a few of the types for additional clarity and
fewer casts and make SkSpan all constexpr.

Change-Id: If09d48d210fdd36cd8c8d713a60672b6e12bd838
Reviewed-on: https://skia-review.googlesource.com/148560
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-08-23 21:23:29 +00:00
Hal Canary
ea60b951d7 IWYU: SkUtils.h
Change-Id: Ieac05047826b1fb80950d65573d38494a1a5c5e7
Reviewed-on: https://skia-review.googlesource.com/148383
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-21 16:05:44 +00:00
Hal Canary
f107a2fd01 SkUTF
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.

SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.

Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.

Also added more unit testing and cleaned up old tests.

Removed functions that were unused outside of tests or used only once.

Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-31 20:11:19 +00:00
Hal Canary
4014ba6ec7 SkUtils: remove some versions of UTF routines.
Change-Id: Ib1f776ae472117c23d2145253adf25fceb412b32
Reviewed-on: https://skia-review.googlesource.com/143111
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-25 17:21:56 +00:00
Ben Wagner
83c6b96bcd Improve SkTestFontMgr.
This moves the portable typefaces into the portable font manager.

Change-Id: Id25e8f0b90f99c82d09cfb3ef136bda8c7728ee9
Reviewed-on: https://skia-review.googlesource.com/140351
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-13 15:01:04 +00:00
Ben Wagner
483c772cfd Add nativeFonts flag to Viewer.
This moves DMFontMgr and several related files which are tightly related
to fonts into tools/fonts, moves some flags around to prevent
duplication, and adds the nativeFonts handling to Viewer.

Change-Id: Id1bdad708a6b74319ac5ac9adfe21025db4ca0b2
Reviewed-on: https://skia-review.googlesource.com/108904
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-02-21 03:31:14 +00:00