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

Unified Diff: ui/gfx/codec/codec_priv.h

Issue 2944633002: Use SkPngEncoder in gfx jpeg_codec (Closed)
Patch Set: Created 3 years, 6 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
Index: ui/gfx/codec/codec_priv.h
diff --git a/ui/gfx/codec/codec_priv.h b/ui/gfx/codec/codec_priv.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3275a3ee5a4c9e77a104f7eb83f6a09a5e1caef
--- /dev/null
+++ b/ui/gfx/codec/codec_priv.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2017 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.
+
+#ifndef UI_GFX_CODEC_PRIV_CODEC_H_
+#define UI_GFX_CODEC_PRIV_CODEC_H_
+
+#include <stddef.h>
+
+#include <vector>
+
+#include "base/logging.h"
+#include "third_party/skia/include/core/SkStream.h"
+
+namespace gfx {
+
+class VectorWStream : public SkWStream {
scroggo_chromium 2017/06/16 18:56:51 Are you planning to put more stuff in here? Maybe
liyuqian 2017/06/23 13:54:25 Done.
+ public:
+ VectorWStream(std::vector<unsigned char>* dst) : dst_(dst) {
scroggo_chromium 2017/06/16 18:56:51 Maybe comment here that it does not take ownership
liyuqian 2017/06/23 13:54:25 Done.
+ DCHECK(dst_);
+ DCHECK_EQ(0UL, dst_->size());
+ }
+
+ bool write(const void* buffer, size_t size) override;
+
+ size_t bytesWritten() const override;
+
+ private:
+ // Does not have ownership.
+ std::vector<unsigned char>* dst_;
+};
+}
Elliot Glaysher 2017/06/16 19:08:11 newline before '}', and also, add " // namespace
liyuqian 2017/06/23 13:54:25 Done.
+
+#endif
Elliot Glaysher 2017/06/16 19:08:11 Header guard comment. // UI_GFX_CODEC_PRIV_CODEC_H
liyuqian 2017/06/23 13:54:25 Done.
« no previous file with comments | « ui/gfx/codec/BUILD.gn ('k') | ui/gfx/codec/codec_priv.cc » ('j') | ui/gfx/codec/codec_priv.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698