diff options
author | Mike Reed <reed@google.com> | 2017-12-08 21:09:12 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-08 21:09:19 +0000 |
commit | cca230055921d2df8708ed6f9abcc2d43468dc7f (patch) | |
tree | de54889d81021104dc9394680903db87994ebfe5 /dm | |
parent | 27372888a5c7698f51069bd5b5beea3e85b66668 (diff) |
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>
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 8 | ||||
-rw-r--r-- | dm/DMSrcSink.cpp | 3 |
2 files changed, 8 insertions, 3 deletions
@@ -1357,8 +1357,12 @@ int main(int argc, char** argv) { SkTaskGroup::Enabler enabled(FLAGS_threads); gCreateTypefaceDelegate = &create_from_name; - if (nullptr == GetResourceAsData("images/color_wheel.png")) { - info("Some resources are missing. Do you need to set --resourcePath?\n"); + { + SkString testResourcePath = GetResourcePath("images/color_wheel.png"); + SkFILEStream testResource(testResourcePath.c_str()); + if (!testResource.isValid()) { + info("Some resources are missing. Do you need to set --resourcePath?\n"); + } } gather_gold(); gather_uninteresting_hashes(); diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 96817e0749..89a4b531e2 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -1066,7 +1066,8 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const { } // Load the dst ICC profile. This particular dst is fairly similar to Adobe RGB. - sk_sp<SkData> dstData = GetResourceAsData("icc_profiles/HP_ZR30w.icc"); + sk_sp<SkData> dstData = SkData::MakeFromFileName( + GetResourcePath("icc_profiles/HP_ZR30w.icc").c_str()); if (!dstData) { return "Cannot read monitor profile. Is the resource path set correctly?"; } |