Index: gm/filterindiabox.cpp |
diff --git a/gm/filterindiabox.cpp b/gm/filterindiabox.cpp |
index c5d716642301ccf70c22994db3bc0f6db3af9947..569a694968fee4a9e692978adc2dbeab15ba82ff 100644 |
--- a/gm/filterindiabox.cpp |
+++ b/gm/filterindiabox.cpp |
@@ -11,7 +11,6 @@ |
#include "SkBitmapProcState.h" |
#include "SkBitmapScaler.h" |
#include "SkGradientShader.h" |
-#include "SkImageDecoder.h" |
#include "SkImageEncoder.h" |
#include "SkStream.h" |
#include "SkTypeface.h" |
@@ -99,21 +98,11 @@ protected: |
} |
void makeBitmap() { |
- SkImageDecoder* codec = nullptr; |
- SkString resourcePath = GetResourcePath(fFilename.c_str()); |
- SkFILEStream stream(resourcePath.c_str()); |
- if (stream.isValid()) { |
- codec = SkImageDecoder::Factory(&stream); |
- } |
- if (codec) { |
- stream.rewind(); |
- codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode); |
- delete codec; |
- } else { |
- fBM.allocN32Pixels(1, 1); |
- *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad |
- } |
- fSize = fBM.height(); |
+ if (!GetResourceAsBitmap(fFilename.c_str(), &fBM)) { |
+ fBM.allocN32Pixels(1, 1); |
+ fBM.eraseARGB(255, 255, 0 , 0); // red == bad |
+ } |
+ fSize = fBM.height(); |
} |
private: |
typedef skiagm::GM INHERITED; |