Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
Revert "custom typeface"
Browse files Browse the repository at this point in the history
This reverts commit 3a79f33.

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>
  • Loading branch information
reed-at-google committed May 7, 2020
1 parent 3a79f33 commit 0066ade
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 488 deletions.
82 changes: 0 additions & 82 deletions gm/userfont.cpp

This file was deleted.

1 change: 0 additions & 1 deletion gn/gm.gni
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ gm_sources = [
"$_gm/trickycubicstrokes.cpp",
"$_gm/typeface.cpp",
"$_gm/unpremul.cpp",
"$_gm/userfont.cpp",
"$_gm/variedtext.cpp",
"$_gm/verifiers/gmverifier.cpp",
"$_gm/vertices.cpp",
Expand Down
2 changes: 0 additions & 2 deletions gn/utils.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ skia_utils_public = [
"$_include/utils/SkBase64.h",
"$_include/utils/SkCamera.h",
"$_include/utils/SkCanvasStateUtils.h",
"$_include/utils/SkCustomTypeface.h",
"$_include/utils/SkEventTracer.h",
"$_include/utils/SkInterpolator.h",
"$_include/utils/SkNWayCanvas.h",
Expand Down Expand Up @@ -41,7 +40,6 @@ skia_utils_sources = [
"$_src/utils/SkCharToGlyphCache.h",
"$_src/utils/SkClipStackUtils.cpp",
"$_src/utils/SkClipStackUtils.h",
"$_src/utils/SkCustomTypeface.cpp",
"$_src/utils/SkDashPath.cpp",
"$_src/utils/SkDashPathPriv.h",
"$_src/utils/SkEventTracer.cpp",
Expand Down
42 changes: 0 additions & 42 deletions include/utils/SkCustomTypeface.h

This file was deleted.

1 change: 0 additions & 1 deletion src/core/SkGlyph.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ class SkGlyph {
friend class SkStrikeServer;
friend class SkTestScalerContext;
friend class SkTestSVGScalerContext;
friend class SkUserScalerContext;
friend class TestSVGTypeface;
friend class TestTypeface;

Expand Down
7 changes: 0 additions & 7 deletions src/core/SkTypeface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "include/core/SkTypeface.h"
#include "include/private/SkMutex.h"
#include "include/private/SkOnce.h"
#include "include/utils/SkCustomTypeface.h"
#include "src/core/SkAdvancedTypefaceMetrics.h"
#include "src/core/SkEndian.h"
#include "src/core/SkFontDescriptor.h"
Expand Down Expand Up @@ -162,12 +161,6 @@ sk_sp<SkTypeface> SkTypeface::MakeFromData(sk_sp<SkData> data, int index) {
}

sk_sp<SkTypeface> SkTypeface::MakeFromFontData(std::unique_ptr<SkFontData> data) {
if (data->hasStream()) {
if (auto tf = SkCustomTypefaceBuilder::Deserialize(data->getStream())) {
return tf;
}
}

return SkFontMgr::RefDefault()->makeFromFontData(std::move(data));
}

Expand Down
Loading

0 comments on commit 0066ade

Please sign in to comment.