diff options
author | Mike Reed <reed@google.com> | 2017-12-09 01:27:41 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-09 01:27:50 +0000 |
commit | 0933bc9b679457ef9333988fe3a1faae6a0b4126 (patch) | |
tree | 0e55ae3a74ec688c3dca189dfe909b026b77985f /tests/SerializationTest.cpp | |
parent | 1a24cd9f6f7d617d9cfb86bf06bdc06b903ac197 (diff) |
Revert "Revert "resources: remove most uses of GetResourcePath()""
This reverts commit cca230055921d2df8708ed6f9abcc2d43468dc7f.
Reason for revert: think I guessed wrong about g32 -- unreverting
Original change's description:
> Revert "resources: remove most uses of GetResourcePath()"
>
> This reverts commit 5093a539def3ae09df324018f2343827009b2e05.
>
> Reason for revert: google3 seems broken
>
> Original change's description:
> > resources: remove most uses of GetResourcePath()
> >
> > Going forward, we will standardize on GetResourceAsData(), which will
> > make it easier to run tests in environments without access to the
> > filesystem.
> >
> > Also: GetResourceAsData() complains when a resource is missing.
> > This is usually an error.
> >
> > Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
> > Reviewed-on: https://skia-review.googlesource.com/82642
> > Reviewed-by: Hal Canary <halcanary@google.com>
> > Commit-Queue: Hal Canary <halcanary@google.com>
>
> TBR=halcanary@google.com,scroggo@google.com
>
> Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/83001
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=halcanary@google.com,scroggo@google.com,reed@google.com
Change-Id: I5a46e4de61186a8a5eb9cacd3275e24e311d5a07
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/82942
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/SerializationTest.cpp')
-rw-r--r-- | tests/SerializationTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp index 4cf605a2fc..2543870667 100644 --- a/tests/SerializationTest.cpp +++ b/tests/SerializationTest.cpp @@ -358,8 +358,8 @@ static void serialize_and_compare_typeface(sk_sp<SkTypeface> typeface, const cha static void TestPictureTypefaceSerialization(skiatest::Reporter* reporter) { { // Load typeface from file to test CreateFromFile with index. - SkString filename = GetResourcePath("/fonts/test.ttc"); - sk_sp<SkTypeface> typeface(SkTypeface::MakeFromFile(filename.c_str(), 1)); + auto data = GetResourceAsData("fonts/test.ttc"); + auto typeface = SkTypeface::MakeFromStream(new SkMemoryStream(std::move(data)), 1); if (!typeface) { INFOF(reporter, "Could not run fontstream test because test.ttc not found."); } else { @@ -369,7 +369,7 @@ static void TestPictureTypefaceSerialization(skiatest::Reporter* reporter) { { // Load typeface as stream to create with axis settings. - std::unique_ptr<SkStreamAsset> distortable(GetResourceAsStream("/fonts/Distortable.ttf")); + std::unique_ptr<SkStreamAsset> distortable(GetResourceAsStream("fonts/Distortable.ttf")); if (!distortable) { INFOF(reporter, "Could not run fontstream test because Distortable.ttf not found."); } else { |