Commit Graph

14 Commits

Author SHA1 Message Date
Kevin Lubick
efce17de5d Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This is a reland of commit f60584eb0f

Client changes:
 - https://chromium-review.googlesource.com/c/chromium/src/+/3508565
 - http://cl/433225409
 - http://cl/433450799

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Ic61e4ac2878e7a51f389312a3a434856e2e32be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518277
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-10 04:47:51 +00:00
Kevin Lubick
a573cbab1a Revert "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This reverts commit f60584eb0f.

Reason for revert: Chrome and G3 issues

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Canary-Android-Topic: image-encoder-2
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Idc906ff54d8baf49989d3ee24e045d7b0ca710df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517676
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2022-03-08 13:09:49 +00:00
Kevin Lubick
f60584eb0f [includes] Remove link between SkImage.h and SkImageEncoder.h
According to go/chrome-includes [1], this will save about
210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000

Canary-Android-Topic: image-encoder-2
Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 21:32:13 +00:00
Ben Wagner
81eabce6a3 SkCustomTypefaceBuilder to set SkFontStyle
Allow the user of SkCustomTypefaceBuilder to set the SkFontStyle of the
resulting SkTypeface. This allows users to build font families.

Fix the Font_flatten test to actually work (instead of relying on the
magic behavior of nullptr for SkTypeface), add a test with the custom
typeface, and reduce the number of times the inner loop runs from
302,400 times to 4,032 times so that the test finishes in a reasonable
amount of time.

Bug: skia:10630
Change-Id: I0b5e939552ee4a9a1249eefbb7a7279a59b38e5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311596
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Xiao Yu <xster@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-19 00:09:55 +00:00
Mike Reed
d240d76b34 extract original paths at big size to improve precision
As part of this, start introducing more consistent factories (matching classes like SkM44)

Change-Id: I453f1856c0427b008faaed9dbba5263e53a48ce4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290766
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 17:27:22 +00:00
Mike Reed
98bc22c689 add fontmetrics to custom typeface
Change-Id: Ib6f468f6fd35b73e590d22a33d1322d3de48edb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290645
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 00:38:29 +00:00
Mike Reed
2ddf7f39de extend custom typeface gm
Change-Id: I472e009ed78e4652a56a3987af0c488a238908b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290638
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-18 18:45:38 +00:00
Florin Malita
839e70f17e Identity unichar <-> glyph_id mapping for SkCustomTypeface
Would be neat to support explicit mappings, but this is sufficient for
what I'm looking at now (allows passing custom tf + "strings" through
the existing shaping pipeline).

Change-Id: I62a8a0c90cc9f6bf3ede82932a8b6a2a933521c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290197
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-05-15 21:10:54 +00:00
Florin Malita
340cd9c99e SkCustomTypeface tweaks
- don't require prior glyph count knowledge - grow dynamically

  - no need to store the glyph count explicitly, it's reflected in
    path/advance vector sizes

Change-Id: I3650ba9312db02c99b72bcf7fd3215697ec00b08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289893
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-05-14 21:44:24 +00:00
Mike Reed
b0210d208c Revert "Revert "custom typeface""
Fix: const auto [...] --> auto [...]

This reverts commit 0066adefa9.

Change-Id: I5d2df8bcc2bc681259a55b2b851d53fb18599287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288550
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-07 22:52:56 +00:00
Brian Osman
c66cd987f7 Reland "Revert "custom typeface""
This reverts commit 61642b3366.

Reason for revert: ../../src/utils/SkCustomTypeface.cpp(179,20): error: cannot decompose this type; 'std::tuple_size<const SkPoint>::value' is not a valid integral constant expression

Original change's description:
> Revert "Revert "custom typeface""
> 
> Fix: implement onComputeBounds() and generateFontMetrics()
> 
> This reverts commit 0066adefa9.
> 
> Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I6845bb96a00a0c9ee54704a4c299556cc32e6438
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288557
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-05-07 18:46:16 +00:00
Mike Reed
61642b3366 Revert "Revert "custom typeface""
Fix: implement onComputeBounds() and generateFontMetrics()

This reverts commit 0066adefa9.

Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-05-07 18:21:30 +00:00
Mike Reed
0066adefa9 Revert "custom typeface"
This reverts commit 3a79f33eca.

Reason for revert: MSAN issues

   Uninitialized value was stored to memory at
     #0 0x2cd74de in SkFontPriv::GetFontBounds(SkFont const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkFont.cpp:400:34
     #1 0x31115ad in SkTextBlobBuilder::ConservativeRunBounds(SkTextBlob::RunRecord const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:307:31
     #2 0x31104d2 in SkTextBlobBuilder::updateDeferredBounds() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:374:47
     #3 0x31104d2 in SkTextBlobBuilder::make() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:605:11
     #4 0x31175c1 in SkTextBlob::MakeFromText(void const*, unsigned long, SkFont const&, SkTextEncoding) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:782:20
     #5 0x1920415 in UserFontGM::onOnceBeforeDraw() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/gm/userfont.cpp:65:17


Original change's description:
> custom typeface
> 
> - only paths implemented at the moment
> 
> Seems if we want to serialize/deserialize these, we will need to
> register a factory with skia, so it can sniff the beginning of the
> font "file", to know how to recreate it.
> 
> Lots of follow-on things to explore:
> - do we need to even store/know advance widths?
> - should we also (optionally) support a CMAP? names? others?
> 
> Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Iee93db8d0f94d706f0b97566d2d15e2ad2407601
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288463
Reviewed-by: Mike Reed <reed@google.com>
2020-05-07 16:51:09 +00:00
Mike Reed
3a79f33eca custom typeface
- only paths implemented at the moment

Seems if we want to serialize/deserialize these, we will need to
register a factory with skia, so it can sniff the beginning of the
font "file", to know how to recreate it.

Lots of follow-on things to explore:
- do we need to even store/know advance widths?
- should we also (optionally) support a CMAP? names? others?

Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-07 15:50:16 +00:00