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

Unified Diff: src/images/SkJpegUtility.cpp

Issue 1836493002: Rename encoders to Sk*ImageEncoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « src/images/SkJpegUtility.h ('k') | src/images/SkKTXImageEncoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkJpegUtility.cpp
diff --git a/src/images/SkJpegUtility.cpp b/src/images/SkJpegUtility.cpp
deleted file mode 100644
index ab8486bcf6261fc40476ec23714bfd6e6f939089..0000000000000000000000000000000000000000
--- a/src/images/SkJpegUtility.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2010 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#include "SkJpegUtility.h"
-
-///////////////////////////////////////////////////////////////////////////////
-
-static void sk_init_destination(j_compress_ptr cinfo) {
- skjpeg_destination_mgr* dest = (skjpeg_destination_mgr*)cinfo->dest;
-
- dest->next_output_byte = dest->fBuffer;
- dest->free_in_buffer = skjpeg_destination_mgr::kBufferSize;
-}
-
-static boolean sk_empty_output_buffer(j_compress_ptr cinfo) {
- skjpeg_destination_mgr* dest = (skjpeg_destination_mgr*)cinfo->dest;
-
-// if (!dest->fStream->write(dest->fBuffer, skjpeg_destination_mgr::kBufferSize - dest->free_in_buffer))
- if (!dest->fStream->write(dest->fBuffer,
- skjpeg_destination_mgr::kBufferSize)) {
- ERREXIT(cinfo, JERR_FILE_WRITE);
- return false;
- }
-
- dest->next_output_byte = dest->fBuffer;
- dest->free_in_buffer = skjpeg_destination_mgr::kBufferSize;
- return TRUE;
-}
-
-static void sk_term_destination (j_compress_ptr cinfo) {
- skjpeg_destination_mgr* dest = (skjpeg_destination_mgr*)cinfo->dest;
-
- size_t size = skjpeg_destination_mgr::kBufferSize - dest->free_in_buffer;
- if (size > 0) {
- if (!dest->fStream->write(dest->fBuffer, size)) {
- ERREXIT(cinfo, JERR_FILE_WRITE);
- return;
- }
- }
- dest->fStream->flush();
-}
-
-skjpeg_destination_mgr::skjpeg_destination_mgr(SkWStream* stream)
- : fStream(stream) {
- this->init_destination = sk_init_destination;
- this->empty_output_buffer = sk_empty_output_buffer;
- this->term_destination = sk_term_destination;
-}
-
-void skjpeg_error_exit(j_common_ptr cinfo) {
- skjpeg_error_mgr* error = (skjpeg_error_mgr*)cinfo->err;
-
- (*error->output_message) (cinfo);
-
- /* Let the memory manager delete any temp files before we die */
- jpeg_destroy(cinfo);
-
- longjmp(error->fJmpBuf, -1);
-}
« no previous file with comments | « src/images/SkJpegUtility.h ('k') | src/images/SkKTXImageEncoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698