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

Unified Diff: gm/encode.cpp

Issue 2246203002: Revert of Fix WIC encoder to support kJPEG_Type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | src/images/SkForceLinking.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/encode.cpp
diff --git a/gm/encode.cpp b/gm/encode.cpp
deleted file mode 100644
index 3b6d43debaa77476648914ebf13d3df4a61c1133..0000000000000000000000000000000000000000
--- a/gm/encode.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2011 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 "SkCanvas.h"
-#include "SkData.h"
-#include "SkImageEncoder.h"
-#include "Resources.h"
-
-namespace skiagm {
-
-class EncodeGM : public GM {
-public:
- EncodeGM() {}
-
-protected:
- SkString onShortName() override {
- return SkString("encode");
- }
-
- SkISize onISize() override {
- return SkISize::Make(1024, 600);
- }
-
- void onDraw(SkCanvas* canvas) override {
- SkBitmap orig;
- GetResourceAsBitmap("mandrill_512_q075.jpg", &orig);
- sk_sp<SkData> pngData(SkImageEncoder::EncodeData(orig, SkImageEncoder::kPNG_Type, 100));
- sk_sp<SkData> jpegData(SkImageEncoder::EncodeData(orig, SkImageEncoder::kJPEG_Type, 100));
-
- sk_sp<SkImage> pngImage = SkImage::MakeFromEncoded(pngData);
- sk_sp<SkImage> jpegImage = SkImage::MakeFromEncoded(jpegData);
- canvas->drawImage(pngImage.get(), 0.0f, 0.0f);
- canvas->drawImage(jpegImage.get(), 512.0f, 0.0f);
-
- SkPaint paint;
- sk_tool_utils::set_portable_typeface(&paint);
- const char text[] = "Images should look more-or-less the same.";
- canvas->drawText(text, sizeof(text) - 1, 450.0f, 550.0f, paint);
- }
-
-private:
- typedef GM INHERITED;
-};
-
-DEF_GM( return new EncodeGM; )
-}
« no previous file with comments | « no previous file | src/images/SkForceLinking.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698