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>
diff --git a/samplecode/SampleIdentityScale.cpp b/samplecode/SampleIdentityScale.cpp
index 2ec9112..ad23541 100644
--- a/samplecode/SampleIdentityScale.cpp
+++ b/samplecode/SampleIdentityScale.cpp
@@ -25,11 +25,10 @@
class IdentityScaleView : public SampleView {
public:
IdentityScaleView(const char imageFilename[]) {
- SkString resourcePath = GetResourcePath(imageFilename);
- if (!decode_file(resourcePath.c_str(), &fBM)) {
- fBM.allocN32Pixels(1, 1);
- *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
- }
+ if (!DecodeDataToBitmap(GetResourceAsData(imageFilename), &fBM)) {
+ fBM.allocN32Pixels(1, 1);
+ *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
+ }
}
protected: