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

Unified Diff: gm/cmykjpeg.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/avoidxfermode.cpp ('k') | gm/copyTo4444.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/cmykjpeg.cpp
diff --git a/gm/cmykjpeg.cpp b/gm/cmykjpeg.cpp
deleted file mode 100644
index d4fb2faa1c23fec509b6ed412c416cf9d147656e..0000000000000000000000000000000000000000
--- a/gm/cmykjpeg.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "gm.h"
-
-#include "Resources.h"
-#include "SkCanvas.h"
-#include "SkImageDecoder.h"
-#include "SkStream.h"
-
-namespace skiagm {
-
-/** Draw a CMYK encoded jpeg - libjpeg doesn't support CMYK->RGB
- conversion so this tests Skia's internal processing
-*/
-class CMYKJpegGM : public GM {
-public:
- CMYKJpegGM() {}
-
-protected:
- void onOnceBeforeDraw() override {
- // parameters to the "decode" call
- bool dither = false;
-
- SkString jpgFilename = GetResourcePath("CMYK.jpg");
- SkFILEStream stream(jpgFilename.c_str());
- if (!stream.isValid()) {
- SkDebugf("Could not find CMYK.jpg, please set --resourcePath correctly.\n");
- return;
- }
-
- SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
- if (codec) {
- stream.rewind();
- codec->setDitherImage(dither);
- codec->decode(&stream, &fBitmap, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
- delete codec;
- }
- }
-
- virtual SkString onShortName() override {
- return SkString("cmykjpeg");
- }
-
- virtual SkISize onISize() override {
- return SkISize::Make(640, 480);
- }
-
- virtual void onDraw(SkCanvas* canvas) override {
-
- canvas->translate(20*SK_Scalar1, 20*SK_Scalar1);
- canvas->drawBitmap(fBitmap, 0, 0);
- }
-
-private:
- SkBitmap fBitmap;
-
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new CMYKJpegGM; }
-static GMRegistry reg(MyFactory);
-
-}
« no previous file with comments | « gm/avoidxfermode.cpp ('k') | gm/copyTo4444.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698