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

Unified Diff: src/codec/SkJpegAutoClean.cpp

Issue 1076923002: SkJpegCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@gif-real
Patch Set: JpegAutoClean is easier to use, Scaling is tested Created 5 years, 8 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: src/codec/SkJpegAutoClean.cpp
diff --git a/src/codec/SkJpegAutoClean.cpp b/src/codec/SkJpegAutoClean.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f2bc9f3df93d3db4c6f51b78911fe35801f1c411
--- /dev/null
+++ b/src/codec/SkJpegAutoClean.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkJpegAutoClean.h"
+#include "SkJpegUtility.h"
+
+JpegAutoClean::JpegAutoClean(jpeg_decompress_struct* dinfo,
+ skjpeg_source_mgr* srcMgr,
+ skjpeg_error_mgr* errorMgr)
+ : fDInfo(dinfo)
+ , fSrcMgr(srcMgr)
+ , fErrorMgr(errorMgr)
+{}
+
+JpegAutoClean::~JpegAutoClean() {
+ if (NULL != fDInfo) {
+ jpeg_destroy_decompress(fDInfo);
+ }
+}
+
+jpeg_decompress_struct* JpegAutoClean::dinfo() {
+ return fDInfo;
+}

Powered by Google App Engine
This is Rietveld 408576698