Commit Graph

215 Commits

Author SHA1 Message Date
John Stiles
738c271b4a Update DataEntry struct to properly support move semantics.
Previously, DataEntry supported only move-construction but not move-
assignment.

Change-Id: I1dc1b2bc90a3dfe4cd74d4a6c2986b7d777f84d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306156
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-27 23:27:31 +00:00
Ben Wagner
3d00fc9924 Make SkFontMgr::onMakeFromStreamArgs pure virtual.
Ensure that it always exists and that implementers don't forget about it
and wind up with an incorrect default.

Change-Id: I383cb1eb8e15de49fbbb007d719837804aca33af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299456
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-28 01:16:34 +00:00
Ben Wagner
0ef90dd5e9 Split out coretext fontmgr factory.
There can be only one SkFontMgr::Factory, so each should go in its own
translation unit. In addition, the name SkFontHost_mac is now rather out
of date and should now be SkFontMgr_mac_ct. Since the additional burden
of additional build changes after the first is minimal, also split out
SkTypeface_mac_ct and SkScalerContext_mac_ct. The original
SkFontHost_mac.cpp is kept as a shell which #includes the cpp files
which are replacing it. Once references to it are removed from all
builds it can be removed.

This is intended to be a reorganization without much code change. Most
changes are simple renaming of functions which are now shared between
translation units. However, there are a few behavior changes here.
  * Drop SkTypefaceCache global for SkTypeface_Mac 'local' global.
  * SkCTFontCTWidthForCSSWidth returns CGFloat instead of 'int'.
  * SkFontMgr_New_CoreText takes a CTFontCollectionRef.

Change-Id: Iac548f9fd920c426ea5c6dcdefe8da0a9b89ec90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294456
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294704
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294714
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-06-06 04:06:32 +00:00
Mike Klein
bb5b2a17c2 Revert "Split out coretext fontmgr factory."
This reverts commit 2c628340f4.

Reason for revert: ios-simulator chrome bot:

FAILED: obj/skia/x64/skia_unittests 
TOOL_VERSION=1591394828 ../../build/toolchain/mac/linker_driver.py -Wcrl,strippath,/opt/s/w/ir/cache/xcode_ios_11e146.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip ../../third_party/llvm-build/Release+Asserts/bin/clang++ -B /opt/s/w/ir/cache/xcode_ios_11e146.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/  -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker obj/skia/skia_unittests.xcent -Wl,-fatal_warnings -arch x86_64 -Werror -nostdlib++ -isysroot sdk/xcode_links/iPhoneSimulator13.4.sdk -mios-simulator-version-min=12.0 -Wl,-ObjC -o "obj/skia/x64/skia_unittests" -Wl,-filelist,"obj/skia/x64/skia_unittests.rsp" -framework UIKit  -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework UIKit -framework Security
Undefined symbols for architecture x86_64:
  "SkCTFontGetSmoothBehavior()", referenced from:
      SkTypeface_Mac::onFilterRec(SkScalerContextRec*) const in libskia.a(SkFontHost_mac.o)
      SkScalerContext_Mac::generateImage(SkGlyph const&) in libskia.a(SkFontHost_mac.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Original change's description:
> Split out coretext fontmgr factory.
> 
> There can be only one SkFontMgr::Factory, so each should go in its own
> translation unit. In addition, the name SkFontHost_mac is now rather out
> of date and should now be SkFontMgr_mac_ct. Since the additional burden
> of additional build changes after the first is minimal, also split out
> SkTypeface_mac_ct and SkScalerContext_mac_ct. The original
> SkFontHost_mac.cpp is kept as a shell which #includes the cpp files
> which are replacing it. Once references to it are removed from all
> builds it can be removed.
> 
> This is intended to be a reorganization without much code change. Most
> changes are simple renaming of functions which are now shared between
> translation units. However, there are a few behavior changes here.
>   * Drop SkTypefaceCache global for SkTypeface_Mac 'local' global.
>   * SkCTFontCTWidthForCSSWidth returns CGFloat instead of 'int'.
>   * SkFontMgr_New_CoreText takes a CTFontCollectionRef.
> 
> Change-Id: I897f69f2f5ea06819f5daa964c09cdd36490af85
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294456
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294704

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

Change-Id: I5abeb7598c7f533477b4a4af5b568f7cbe6e8644
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294734
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-05 23:16:49 +00:00
Ben Wagner
2c628340f4 Split out coretext fontmgr factory.
There can be only one SkFontMgr::Factory, so each should go in its own
translation unit. In addition, the name SkFontHost_mac is now rather out
of date and should now be SkFontMgr_mac_ct. Since the additional burden
of additional build changes after the first is minimal, also split out
SkTypeface_mac_ct and SkScalerContext_mac_ct. The original
SkFontHost_mac.cpp is kept as a shell which #includes the cpp files
which are replacing it. Once references to it are removed from all
builds it can be removed.

This is intended to be a reorganization without much code change. Most
changes are simple renaming of functions which are now shared between
translation units. However, there are a few behavior changes here.
  * Drop SkTypefaceCache global for SkTypeface_Mac 'local' global.
  * SkCTFontCTWidthForCSSWidth returns CGFloat instead of 'int'.
  * SkFontMgr_New_CoreText takes a CTFontCollectionRef.

Change-Id: I897f69f2f5ea06819f5daa964c09cdd36490af85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294456
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294704
2020-06-05 21:40:46 +00:00
Ben Wagner
aa10dfeec9 Revert "Split out coretext fontmgr factory."
This reverts commit 5c14d63297.

Reason for revert: chromium 'analyze' doesn't do a good job

Original change's description:
> Split out coretext fontmgr factory.
> 
> There can be only one SkFontMgr::Factory, so each should go in its own
> translation unit. In addition, the name SkFontHost_mac is now rather out
> of date and should now be SkFontMgr_mac_ct. Since the additional burden
> of additional build changes after the first is minimal, also split out
> SkTypeface_mac_ct and SkScalerContext_mac_ct. The original
> SkFontHost_mac.cpp is kept as a shell which #includes the cpp files
> which are replacing it. Once references to it are removed from all
> builds it can be removed.
> 
> This is intended to be a reorganization without much code change. Most
> changes are simple renaming of functions which are now shared between
> translation units. However, there are a few behavior changes here.
>   * Drop SkTypefaceCache global for SkTypeface_Mac 'local' global.
>   * SkCTFontCTWidthForCSSWidth returns CGFloat instead of 'int'.
>   * SkFontMgr_New_CoreText takes a CTFontCollectionRef.
> 
> Change-Id: Iaf58a0371667f266ada20c918941fab6bc27d9df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294456
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

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

Change-Id: I469084efbfc71bba60e5fbfb4eb7152d57324d0c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294703
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-06-05 20:32:52 +00:00
Ben Wagner
5c14d63297 Split out coretext fontmgr factory.
There can be only one SkFontMgr::Factory, so each should go in its own
translation unit. In addition, the name SkFontHost_mac is now rather out
of date and should now be SkFontMgr_mac_ct. Since the additional burden
of additional build changes after the first is minimal, also split out
SkTypeface_mac_ct and SkScalerContext_mac_ct. The original
SkFontHost_mac.cpp is kept as a shell which #includes the cpp files
which are replacing it. Once references to it are removed from all
builds it can be removed.

This is intended to be a reorganization without much code change. Most
changes are simple renaming of functions which are now shared between
translation units. However, there are a few behavior changes here.
  * Drop SkTypefaceCache global for SkTypeface_Mac 'local' global.
  * SkCTFontCTWidthForCSSWidth returns CGFloat instead of 'int'.
  * SkFontMgr_New_CoreText takes a CTFontCollectionRef.

Change-Id: Iaf58a0371667f266ada20c918941fab6bc27d9df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294456
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-05 19:22:38 +00:00
Dominik Röttsches
c9b06ca708 Remove CGFontRef parameter from SkMakeTypefaceFromCTFont
Since the Blink side CTFontRefs are no longer created from CGFontRefs
after [1], we do not need to pass CGFontRefs to Skia any longer for
keeping them alive. Clean up related plumbing which previously passed
through the CGFontRef to the SkTypefaceMac constructor.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1964073

Bug: chromium:1033478
Change-Id: Ic85cae6289fa9b4886201c92defb54fcc5622720
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266816
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-01-31 18:35:10 +00:00
Mike Reed
a2a0c8a2c4 extract font from run
Change-Id: Ice98eeb1f815cf07f842b22ddc26e32e849a1218
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-29 15:28:06 +00:00
Jim Van Verth
8429422986 Change GrCFResource to sk_cf_obj and move to include/ports.
This makes GrCFResource a template class with similar semantics to sk_sp.

Change-Id: I9ae9988dac6b39477b16d65591ef6fff44903c36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218376
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-06-10 18:44:28 +00:00
Ben Wagner
ab6eefe60e Move SkLeanWindows.h to src.
This file pulls in Windows headers in a custom way, which is somewhat
awkward for a library header. The only use in include/ has been replaced
with a single forward declaration.

Change-Id: Ibef4cf7a2d1c9957a6a5b145b95aca1a6868cb5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214689
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-21 13:48:00 +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
Sergey Ulanov
f3babcd0af Reland "Add SkFontMgr implementation for Fuchsia"
This is a reland of 309f1deddf

PS2 excludes the new file from Google3 build.

Original change's description:
> Add SkFontMgr implementation for Fuchsia
>
> The new SkFontMgr implementation will be used by Flutter and Chromium on
> Fuchsia.
>
> Change-Id: Ibd60a622282556e8557058e92fe865857f7024f9
> Reviewed-on: https://skia-review.googlesource.com/c/173800
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: I1ea948b644dee4414b7a12a4b354f0a61a5e47ea
Reviewed-on: https://skia-review.googlesource.com/c/175431
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-12-07 01:47:05 +00:00
Mike Reed
e6b5b710fc Revert "Add SkFontMgr implementation for Fuchsia"
This reverts commit 309f1deddf.

Reason for revert: breaks compile in google3

In file included from third_party/skia/HEAD/src/ports/SkFontMgr_fuchsia.cpp:8:
third_party/skia/HEAD/include/ports/SkFontMgr_fuchsia.h:11:10: fatal error: 'fuchsia/fonts/cpp/fidl.h' file not found
#include <fuchsia/fonts/cpp/fidl.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~

Original change's description:
> Add SkFontMgr implementation for Fuchsia
> 
> The new SkFontMgr implementation will be used by Flutter and Chromium on
> Fuchsia.
> 
> Change-Id: Ibd60a622282556e8557058e92fe865857f7024f9
> Reviewed-on: https://skia-review.googlesource.com/c/173800
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,bungeman@google.com,reed@google.com,sergeyu@chromium.org

Change-Id: Ieae0ba4b07677bee0481c3183c3835091831c477
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/175430
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-12-07 00:29:22 +00:00
Sergey Ulanov
309f1deddf Add SkFontMgr implementation for Fuchsia
The new SkFontMgr implementation will be used by Flutter and Chromium on
Fuchsia.

Change-Id: Ibd60a622282556e8557058e92fe865857f7024f9
Reviewed-on: https://skia-review.googlesource.com/c/173800
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-12-06 23:32:42 +00:00
Ben Wagner
d89e811684 SkImageGeneratorCG.h to only expose factory method.
Instead of requiring the implementation details of the SkImageGenerator
which backs the CG image generator to be present in the header, move the
class into the implementation and only expose the factory method.

Change-Id: I728276ffcfb6bb4e7302280459a79210e8d67475
Reviewed-on: https://skia-review.googlesource.com/155611
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-09-19 21:20:35 +00:00
Hal Canary
912cd3d2e4 SkImageGeneratorWIC: make the header compile without src/.
SkTScopedComPtr.h is located in src/utils/win/.

Change-Id: If2f3a28d7427e9a2e196272ce07f303de4d613ca
Reviewed-on: https://skia-review.googlesource.com/155562
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 20:31:47 +00:00
Mike Reed
41b67730a1 Use the unique_ptr variant of MakeFromStream (the other is deprecated)
This reverts commit 0b80e62a14.

Bug: skia:
Change-Id: I2c8d68e06b7c7f4f2fb1f3f6aa1eed0e12dc8455
Reviewed-on: https://skia-review.googlesource.com/152582
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 15:40:19 +00:00
Jim Van Verth
0b80e62a14 Reland "Revert "update to new MakeFromStream signature""
This reverts commit 8695539654.

Reason for revert: Breaking the Housekeeper bot.

Original change's description:
> Revert "Revert "update to new MakeFromStream signature""
> 
> This reverts commit 71f8475a0d.
> 
> Modified to still expose old signature (until we update google3 and flutter)
> 
> Bug: skia:
> Change-Id: Ie51e6227d5c6961d90006a015a5292cebd49e2a2
> Reviewed-on: https://skia-review.googlesource.com/152560
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I731108dac57aac090420594dc19e42c217f51b06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/152600
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-09-07 12:44:47 +00:00
Mike Reed
8695539654 Revert "Revert "update to new MakeFromStream signature""
This reverts commit 71f8475a0d.

Modified to still expose old signature (until we update google3 and flutter)

Bug: skia:
Change-Id: Ie51e6227d5c6961d90006a015a5292cebd49e2a2
Reviewed-on: https://skia-review.googlesource.com/152560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 11:46:55 +00:00
Mike Klein
71f8475a0d Revert "update to new MakeFromStream signature"
This reverts commit edc6ea7a9e.

Reason for revert: need to update Flutter, Google3.

Original change's description:
> update to new MakeFromStream signature
> 
> Bug: skia:
> Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52
> Reviewed-on: https://skia-review.googlesource.com/151880
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

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

Change-Id: I22daf2cdb86f9e5ca3b78db45f8e15efe4b21005
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/152120
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-06 11:37:06 +00:00
Mike Reed
edc6ea7a9e update to new MakeFromStream signature
Bug: skia:
Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52
Reviewed-on: https://skia-review.googlesource.com/151880
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-09-06 00:43:20 +00:00
Leon Scroggins III
a57488a1f5 Expose public factories for platform decoders
Bug: skia:8076

Move SkImageGeneratorCG and SkImageGeneratorWIC to include/ports/,
and make them SK_API.

Remove SkImageGeneratorCG::NewFromEncodedCG. No known clients are using
it, and it was a private API in src/. There is already a
MakeFromEncodedCG to replace it.

Similarly, switch WIC from New to Make.

Add a compile test for using them with
SetImageGeneratorFromEncodedDataFactory.

Change-Id: I897eb7a887b3736a6c614a68e38f38b6a1942cf1
Reviewed-on: https://skia-review.googlesource.com/137387
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-06-26 17:30:52 +00:00
Ben Wagner
4496248117 Remove include/ports/SkFontMgr.h
The SkFontMgr.h header has been moved to core/SkFontMgr.h and the
ports/SkFontMgr.h header is simply a forwarding header. Remove the
forwarding header now that users have been updated.

Change-Id: Icecef2ecb3ac20fc2c885429b06cdb306524303d
Reviewed-on: https://skia-review.googlesource.com/137130
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-22 15:43:17 +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
Ben Wagner
ecd35c16ef Remove non-smart SkFontConfigInterface::SetGlobal.
This method is no longer used and is superseded by the 'smart' version.

Change-Id: Ic27545a2ec2666d77966727630ba7e960eac5506
Reviewed-on: https://skia-review.googlesource.com/128316
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-15 19:42:13 +00:00
Ben Wagner
a20681c2ac Move SkFontConfigInterface to smart pointers.
This old interface may be easier to move away from if it isn't so
difficult to understand.

Change-Id: Ib04b00e55fd5c11aca8cc70bc6c7b0b5ba98dcae
Reviewed-on: https://skia-review.googlesource.com/127969
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-14 19:25:10 +00:00
Mike Reed
4815db5938 removed dead code behind legacy fontmgr api flag
Bug: skia:
Change-Id: I7766b10947df384b0e94a32642d5b4321f2e53bd
Reviewed-on: https://skia-review.googlesource.com/58241
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-11 15:18:57 +00:00
Mike Reed
592273965a Revert "Revert "migrate to sk_sp for SkFontMgr API""
This reverts commit f40ae1a4b5.

Bug: skia:
Change-Id: I752606de92ea405d6e50219c98030409b00a2841
Reviewed-on: https://skia-review.googlesource.com/51160
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-26 14:05:18 +00:00
Mike Reed
f40ae1a4b5 Revert "migrate to sk_sp for SkFontMgr API"
This reverts commit 4bf296be28.

Reason for revert: need guard for flutter

Original change's description:
> migrate to sk_sp for SkFontMgr API
> 
> Bug: skia:
> Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
> Reviewed-on: https://skia-review.googlesource.com/48740
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ib0b2d00fcbcdb6131444f94d1046df6dae24f551
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/50940
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-25 20:00:41 +00:00
Mike Reed
4bf296be28 migrate to sk_sp for SkFontMgr API
Bug: skia:
Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
Reviewed-on: https://skia-review.googlesource.com/48740
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-09-25 19:45:09 +00:00
Ben Wagner
a93a14a998 Convert NULL and 0 to nullptr.
This was created by looking at warnings produced by clang's
-Wzero-as-null-pointer-constant. This updates most issues in
Skia code. However, there are places where GL and Vulkan want
pointer values which are explicitly 0, external headers which
use NULL directly, and possibly more uses in un-compiled
sources (for other platforms).

Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345
Reviewed-on: https://skia-review.googlesource.com/39521
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-08-28 17:48:57 +00:00
Mike Reed
65a9344120 remove unneeded include
Bug: skia:
Change-Id: If8c689c008438efed398d018782021195f6d0274
Reviewed-on: https://skia-review.googlesource.com/19261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-09 12:44:54 +00:00
bungeman
7575bb1c38 SkFontMgr::matchFamily should not crash on nullptr.
While all systems can resolve a font from just a style request
(without a name) almost no systems specify a default font family.

BUG=skia:6574

Change-Id: If7c81808b62cd5d8212bce2eb4d9c476c45af80a
Reviewed-on: https://skia-review.googlesource.com/14902
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-01 18:13:02 +00:00
Ben Wagner
fc497343cb Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space.

Change-Id: Id7cae439e795b8c9586394f11359fb7fe55e1c0b
Reviewed-on: https://skia-review.googlesource.com/8861
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-24 16:59:05 +00:00
Ben Wagner
97043299cb Revert "Add SkTypeface::getVariationDesignPosition."
This reverts commit 0f3d0c37db.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add SkTypeface::getVariationDesignPosition.
> 
> Allow users to query a typeface's position in variation design space.
> 
> Change-Id: I173ee9eefdddee6b2613435ebcc6b08c25b382ed
> Reviewed-on: https://skia-review.googlesource.com/8684
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=bungeman@google.com,reed@google.com,reviews@skia.org,drott@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I484fe52c1f89e7b6d0024dcabf7c59d0e8b5b5e7
Reviewed-on: https://skia-review.googlesource.com/8929
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-23 20:48:53 +00:00
bungeman
0f3d0c37db Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space.

Change-Id: I173ee9eefdddee6b2613435ebcc6b08c25b382ed
Reviewed-on: https://skia-review.googlesource.com/8684
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-23 18:41:57 +00:00
Ben Wagner
7d07d46638 Revert "Add SkTypeface::getVariationDesignPosition."
This reverts commit 87e7f820f7.

Reason for revert: Failed a test on Mac

Original change's description:
> Add SkTypeface::getVariationDesignPosition.
> 
> Allow users to query a typeface's position in variation design space.
> 
> Change-Id: I5d80c8ff658708a5d1aa386ec5b7396dcb621198
> Reviewed-on: https://skia-review.googlesource.com/7130
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=bungeman@google.com,reed@google.com,reviews@skia.org,drott@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ia65792083642dbe9333a62eb75d162931b57cffd
Reviewed-on: https://skia-review.googlesource.com/8670
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-17 18:39:09 +00:00
Ben Wagner
87e7f820f7 Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space.

Change-Id: I5d80c8ff658708a5d1aa386ec5b7396dcb621198
Reviewed-on: https://skia-review.googlesource.com/7130
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-17 18:05:47 +00:00
Hal Canary
6b20a55996 Make header files self-sufficient
Change-Id: Ice7d761b1023da77e50e5d6aa597964f7d9aa1d8
Reviewed-on: https://skia-review.googlesource.com/8302
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-10 01:19:52 +00:00
Ben Wagner
8ab590f17f Split custom font managers.
Some users would like to use the empty font manager, but the directory
gont manager brings in extra dependencies to work which would otherwise
be unneeded. Allow these users to build just the bits of code they
actually need.

Change-Id: Ib029ef2682883509bad5a2aa39f1ef55631f4d8a
Reviewed-on: https://skia-review.googlesource.com/8200
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-02-09 14:50:05 +00:00
Herb Derby
9adfef8680 Remove public APIs that use SkDataTable.
Change-Id: Ibb8f987efc585713a6f8061c72fb416d07be13b1
Reviewed-on: https://skia-review.googlesource.com/7352
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-23 17:09:37 +00:00
Ben Wagner
20d031a6ad Remove SK_LEGACY_FONTMGR_FACTORY.
SkFontMgr factories now return sk_sp and the legacy factories are no
longer used and can be removed.

BUG=skia:5077

Change-Id: Ieaff8555b297d1db157f8b78cdd6e7d07a3b5490
Reviewed-on: https://skia-review.googlesource.com/6894
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-11 19:50:14 +00:00
Ben Wagner
0ab977f231 Remove SkUseTestFontConfigFile.
This method and its associated globals are no longer used by any user
and can now be removed.

BUG=skia:2817

Change-Id: Ia627e2494f568a733999b980aec9284467d2640d
Reviewed-on: https://skia-review.googlesource.com/6821
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-10 16:20:05 +00:00
Ben Wagner
3546ff10c2 Stage SkFontMgr factories to return smart pointers.
All the SkFontMgr factories currently return bare pointers and sometimes
even document the ownership rules. Since such factories can be
implemented by external ports, the ownership rules should be explicit in
order to prevent simple reference counting issues.

Change-Id: I25b598ce0954cd473a3fb1f8adc0cb86331583ca
Reviewed-on: https://skia-review.googlesource.com/6533
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-04 14:51:09 +00:00
bungeman
6bd5284415 Remove SkAutoTUnref and SkAutoTDelete from public includes.
This also makes the required changed to src, tests, and tools. The few
public APIs modified by this change appear to be unused outside of Skia.

Removing these from the public API makes it easier to ensure users are
no longer using them.

This also updates GrGpu::wrapBackendXXX and the
::onWrapBackendXXX methods to clarify ownership.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002

Review-Url: https://codereview.chromium.org/2448593002
2016-10-27 09:30:08 -07:00
bungeman
1ae0e01acc Split SkFontConfigInterface globals and factory.
Chromium needs to be able to set up their build such that the globals
continue existing but the SkFontMgr::Factory can be defined separately.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2346333002
CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2346333002
2016-09-19 12:13:16 -07:00
bungeman
67ac33e1f1 Remove SK_DECLARE_LEGACY_CREATE_FROM_FONTDATA.
This is no longer defined by any users, so remove it.

TBR=reed
This just removes no longer used API.

Review-Url: https://codereview.chromium.org/2345353002
2016-09-16 14:54:16 -07:00
bungeman
f93d71122e SkFontData to use smart pointers.
The SkFontData type is not exposed externally, so any method which uses
it can be updated to use smart pointers without affecting external
users. Updating this first will make updating the public API much
easier.

This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
appears that no one outside Skia is currently using SkStream::NewfromFile
so this is a good time to update it as well.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002

Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c
Review-Url: https://codereview.chromium.org/2339273002
2016-09-16 06:24:20 -07:00
bungeman
606add3dfb Revert of SkFontData to use smart pointers. (patchset #3 id:40001 of https://codereview.chromium.org/2339273002/ )
Reason for revert:
Killing Mac

Original issue's description:
> SkFontData to use smart pointers.
>
> The SkFontData type is not exposed externally, so any method which uses
> it can be updated to use smart pointers without affecting external
> users. Updating this first will make updating the public API much
> easier.
>
> This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
> std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
> appears that no one outside Skia is currently using SkStream::NewfromFile
> so this is a good time to update it as well.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002
>
> Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c

TBR=mtklein@chromium.org,halcanary@google.com,mtklein@google.com,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2343933002
2016-09-15 10:57:39 -07:00