aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleSubpixelTranslate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleSubpixelTranslate.cpp')
-rw-r--r--samplecode/SampleSubpixelTranslate.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/samplecode/SampleSubpixelTranslate.cpp b/samplecode/SampleSubpixelTranslate.cpp
index 51b5ef6631..7ce1885892 100644
--- a/samplecode/SampleSubpixelTranslate.cpp
+++ b/samplecode/SampleSubpixelTranslate.cpp
@@ -24,15 +24,15 @@ public:
SubpixelTranslateView(const char imageFilename[],
float horizontalVelocity,
float verticalVelocity)
- : fHorizontalVelocity(horizontalVelocity),
- fVerticalVelocity(verticalVelocity) {
- SkString resourcePath = GetResourcePath(imageFilename);
- if (!decode_file(resourcePath.c_str(), &fBM)) {
- fBM.allocN32Pixels(1, 1);
- *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
- }
- fCurPos = SkPoint::Make(0,0);
- fSize = 200;
+ : fHorizontalVelocity(horizontalVelocity)
+ , fVerticalVelocity(verticalVelocity)
+ {
+ if (!DecodeDataToBitmap(GetResourceAsData(imageFilename), &fBM)) {
+ fBM.allocN32Pixels(1, 1);
+ *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
+ }
+ fCurPos = SkPoint::Make(0,0);
+ fSize = 200;
}
protected: