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

Unified Diff: ui/gfx/codec/skia_image_encoder_adapter.cc

Issue 2865363002: Compile Skia image encoders (Closed)
Patch Set: Fix ios and win Created 3 years, 7 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 | « ui/gfx/codec/skia_image_encoder_adapter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/codec/skia_image_encoder_adapter.cc
diff --git a/ui/gfx/codec/skia_image_encoder_adapter.cc b/ui/gfx/codec/skia_image_encoder_adapter.cc
deleted file mode 100644
index 6dbb457a598b5b20a5d1a723d2b178aa80cedaeb..0000000000000000000000000000000000000000
--- a/ui/gfx/codec/skia_image_encoder_adapter.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gfx/codec/skia_image_encoder_adapter.h"
-
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkStream.h"
-#include "ui/gfx/codec/jpeg_codec.h"
-#include "ui/gfx/codec/png_codec.h"
-#include "ui/gfx/geometry/size.h"
-
-bool gfx::EncodeSkiaImage(SkWStream* dst,
- const SkPixmap& pixmap,
- SkEncodedImageFormat format,
- int quality) {
- if (kN32_SkColorType != pixmap.colorType() ||
- (kPremul_SkAlphaType != pixmap.alphaType() &&
- kOpaque_SkAlphaType != pixmap.alphaType())) {
- return false;
- }
- std::vector<unsigned char> buffer;
- switch (format) {
- case SkEncodedImageFormat::kPNG:
- return gfx::PNGCodec::Encode(
- reinterpret_cast<const unsigned char*>(pixmap.addr()),
- gfx::PNGCodec::FORMAT_SkBitmap,
- gfx::Size(pixmap.width(), pixmap.height()),
- static_cast<int>(pixmap.rowBytes()), false,
- std::vector<gfx::PNGCodec::Comment>(), &buffer) &&
- dst->write(buffer.data(), buffer.size());
- case SkEncodedImageFormat::kJPEG:
- return gfx::JPEGCodec::Encode(
- reinterpret_cast<const unsigned char*>(pixmap.addr()),
- gfx::JPEGCodec::FORMAT_SkBitmap, pixmap.width(),
- pixmap.height(), static_cast<int>(pixmap.rowBytes()), quality,
- &buffer) &&
- dst->write(buffer.data(), buffer.size());
- default:
- return false;
- }
-}
« no previous file with comments | « ui/gfx/codec/skia_image_encoder_adapter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698