diff options
Diffstat (limited to 'samplecode/SampleCowboy.cpp')
-rw-r--r-- | samplecode/SampleCowboy.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/samplecode/SampleCowboy.cpp b/samplecode/SampleCowboy.cpp index bd8f7c909b..b1eec87e50 100644 --- a/samplecode/SampleCowboy.cpp +++ b/samplecode/SampleCowboy.cpp @@ -37,13 +37,12 @@ protected: }; void onOnceBeforeDraw() override { - constexpr char path[] = "Cowboy.svg"; - auto data = GetResourceAsData(path); - if (!data) { - SkDebugf("file not found: \"%s\"\n", path); + fPath = GetResourcePath("Cowboy.svg"); + SkFILEStream svgStream(fPath.c_str()); + if (!svgStream.isValid()) { + SkDebugf("file not found: \"path\"\n", fPath.c_str()); return; } - SkMemoryStream svgStream(std::move(data)); SkDOM xmlDom; if (!xmlDom.build(svgStream)) { |