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

Side by Side Diff: src/codec/SkJpegCodec.cpp

Issue 1836493002: Rename encoders to Sk*ImageEncoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « public.bzl ('k') | src/codec/SkJpegDecoderMgr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkMSAN.h" 9 #include "SkMSAN.h"
10 #include "SkJpegCodec.h" 10 #include "SkJpegCodec.h"
11 #include "SkJpegDecoderMgr.h" 11 #include "SkJpegDecoderMgr.h"
12 #include "SkJpegUtility_codec.h"
13 #include "SkCodecPriv.h" 12 #include "SkCodecPriv.h"
14 #include "SkColorPriv.h" 13 #include "SkColorPriv.h"
15 #include "SkStream.h" 14 #include "SkStream.h"
16 #include "SkTemplates.h" 15 #include "SkTemplates.h"
17 #include "SkTypes.h" 16 #include "SkTypes.h"
18 17
19 // stdio is needed for libjpeg-turbo 18 // stdio is needed for libjpeg-turbo
20 #include <stdio.h> 19 #include <stdio.h>
20 #include "SkJpegUtility.h"
21 21
22 extern "C" { 22 extern "C" {
23 #include "jerror.h" 23 #include "jerror.h"
24 #include "jpeglib.h" 24 #include "jpeglib.h"
25 } 25 }
26 26
27 bool SkJpegCodec::IsJpeg(const void* buffer, size_t bytesRead) { 27 bool SkJpegCodec::IsJpeg(const void* buffer, size_t bytesRead) {
28 static const uint8_t jpegSig[] = { 0xFF, 0xD8, 0xFF }; 28 static const uint8_t jpegSig[] = { 0xFF, 0xD8, 0xFF };
29 return bytesRead >= 3 && !memcmp(buffer, jpegSig, sizeof(jpegSig)); 29 return bytesRead >= 3 && !memcmp(buffer, jpegSig, sizeof(jpegSig));
30 } 30 }
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
890 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 890 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
891 if (linesRead < remainingRows) { 891 if (linesRead < remainingRows) {
892 // FIXME: Handle incomplete YUV decodes without signalling an error. 892 // FIXME: Handle incomplete YUV decodes without signalling an error.
893 return kInvalidInput; 893 return kInvalidInput;
894 } 894 }
895 } 895 }
896 896
897 return kSuccess; 897 return kSuccess;
898 } 898 }
OLDNEW
« no previous file with comments | « public.bzl ('k') | src/codec/SkJpegDecoderMgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698