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); |
-} |