Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: gm/avoidxfermode.cpp

Issue 1791583002: Remove uses of SkImageDecoder from gms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/astcbitmap.cpp ('k') | gm/cmykjpeg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/avoidxfermode.cpp
diff --git a/gm/avoidxfermode.cpp b/gm/avoidxfermode.cpp
index a015b6bbe7085e8c01fcf3719ce06523dfe29bb2..d224b4e2d05d56808b76e9e2d2e700e970215fea 100644
--- a/gm/avoidxfermode.cpp
+++ b/gm/avoidxfermode.cpp
@@ -8,7 +8,6 @@
#include "gm.h"
#include "Resources.h"
-#include "SkImageDecoder.h"
#include "SkAvoidXfermode.h"
#include "SkStream.h"
@@ -24,17 +23,7 @@ protected:
SkISize onISize() override { return SkISize::Make(128, 128); }
void onOnceBeforeDraw() override {
- SkImageDecoder* codec = nullptr;
- SkString resourcePath = GetResourcePath("color_wheel.png");
- 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 {
+ if (!GetResourceAsBitmap("color_wheel.png", &fBM)) {
fBM.allocN32Pixels(1, 1);
fBM.eraseARGB(255, 255, 0 , 0); // red == bad
}
« no previous file with comments | « gm/astcbitmap.cpp ('k') | gm/cmykjpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698