| Index: samplecode/SampleUnpremul.cpp
|
| diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp
|
| index 4e3e1fae97b0967d547b81e9decadcb54a9d7dec..fb9735c017cd771a63762725ab299ad91bf21908 100644
|
| --- a/samplecode/SampleUnpremul.cpp
|
| +++ b/samplecode/SampleUnpremul.cpp
|
| @@ -8,14 +8,13 @@
|
| #include "gm.h"
|
|
|
| #include "sk_tool_utils.h"
|
| +#include "DecodeFile.h"
|
| #include "Resources.h"
|
| #include "SampleCode.h"
|
| #include "SkBlurMask.h"
|
| #include "SkBlurDrawLooper.h"
|
| #include "SkCanvas.h"
|
| #include "SkColorPriv.h"
|
| -#include "SkForceLinking.h"
|
| -#include "SkImageDecoder.h"
|
| #include "SkOSFile.h"
|
| #include "SkStream.h"
|
| #include "SkString.h"
|
| @@ -24,8 +23,6 @@
|
| #include "SkUtils.h"
|
| #include "SkView.h"
|
|
|
| -__SK_FORCE_IMAGE_DECODER_LINKING;
|
| -
|
| /**
|
| * Interprets c as an unpremultiplied color, and returns the
|
| * premultiplied equivalent.
|
| @@ -167,17 +164,7 @@ private:
|
| fDecodeSucceeded = false;
|
| return;
|
| }
|
| - SkFILEStream stream(fCurrFile.c_str());
|
| - SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream));
|
| - if (nullptr == decoder.get()) {
|
| - fDecodeSucceeded = false;
|
| - return;
|
| - }
|
| - if (!fPremul) {
|
| - decoder->setRequireUnpremultipliedColors(true);
|
| - }
|
| - fDecodeSucceeded = decoder->decode(&stream, &fBitmap, kN32_SkColorType,
|
| - SkImageDecoder::kDecodePixels_Mode) != SkImageDecoder::kFailure;
|
| + fDecodeSucceeded = decode_file(fCurrFile.c_str(), &fBitmap, kN32_SkColorType, !fPremul);
|
| this->inval(nullptr);
|
| }
|
|
|
|
|