| Index: ui/gfx/codec/jpeg_codec.cc
|
| diff --git a/ui/gfx/codec/jpeg_codec.cc b/ui/gfx/codec/jpeg_codec.cc
|
| index e4ce6857fce0d1aceb29895b302c25465d666522..3aa02785a051da299fbbe07b66b9d1b51013b3ff 100644
|
| --- a/ui/gfx/codec/jpeg_codec.cc
|
| +++ b/ui/gfx/codec/jpeg_codec.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "ui/gfx/codec/jpeg_codec.h"
|
| +#include "ui/gfx/codec/vector_wstream.h"
|
|
|
| #include <setjmp.h>
|
|
|
| @@ -11,7 +12,6 @@
|
| #include "base/logging.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "third_party/skia/include/core/SkColorPriv.h"
|
| -#include "third_party/skia/include/core/SkStream.h"
|
| #include "third_party/skia/include/encode/SkJpegEncoder.h"
|
|
|
| extern "C" {
|
| @@ -47,29 +47,6 @@ void ErrorExit(jpeg_common_struct* cinfo) {
|
|
|
| // Encoder ---------------------------------------------------------------------
|
|
|
| -namespace {
|
| -
|
| -class VectorWStream : public SkWStream {
|
| - public:
|
| - VectorWStream(std::vector<unsigned char>* dst) : dst_(dst) {
|
| - DCHECK(dst_);
|
| - DCHECK_EQ(0UL, dst_->size());
|
| - }
|
| -
|
| - bool write(const void* buffer, size_t size) override {
|
| - const unsigned char* ptr = reinterpret_cast<const unsigned char*>(buffer);
|
| - dst_->insert(dst_->end(), ptr, ptr + size);
|
| - return true;
|
| - }
|
| -
|
| - size_t bytesWritten() const override { return dst_->size(); }
|
| -
|
| - private:
|
| - // Does not have ownership.
|
| - std::vector<unsigned char>* dst_;
|
| -};
|
| -};
|
| -
|
| bool JPEGCodec::Encode(const SkPixmap& src,
|
| int quality,
|
| std::vector<unsigned char>* output) {
|
|
|