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

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

Issue 1687863003: Make SkJpegCodec compatible with libjpeg (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix gyp Created 4 years, 10 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/SkJpegCodec.cpp » ('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 "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCodecPriv.h" 10 #include "SkCodecPriv.h"
11 #include "SkData.h" 11 #include "SkData.h"
12 #include "SkGifCodec.h" 12 #include "SkGifCodec.h"
13 #include "SkIcoCodec.h" 13 #include "SkIcoCodec.h"
14 #if !defined(GOOGLE3)
15 #include "SkJpegCodec.h" 14 #include "SkJpegCodec.h"
16 #endif
17 #include "SkPngCodec.h" 15 #include "SkPngCodec.h"
18 #ifdef SK_CODEC_DECODES_RAW 16 #ifdef SK_CODEC_DECODES_RAW
19 #include "SkRawCodec.h" 17 #include "SkRawCodec.h"
20 #endif 18 #endif
21 #include "SkStream.h" 19 #include "SkStream.h"
22 #include "SkWbmpCodec.h" 20 #include "SkWbmpCodec.h"
23 #include "SkWebpCodec.h" 21 #include "SkWebpCodec.h"
24 22
25 struct DecoderProc { 23 struct DecoderProc {
26 bool (*IsFormat)(const void*, size_t); 24 bool (*IsFormat)(const void*, size_t);
27 SkCodec* (*NewFromStream)(SkStream*); 25 SkCodec* (*NewFromStream)(SkStream*);
28 }; 26 };
29 27
30 static const DecoderProc gDecoderProcs[] = { 28 static const DecoderProc gDecoderProcs[] = {
31 #if !defined(GOOGLE3)
32 { SkJpegCodec::IsJpeg, SkJpegCodec::NewFromStream }, 29 { SkJpegCodec::IsJpeg, SkJpegCodec::NewFromStream },
33 #endif
34 { SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream }, 30 { SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream },
35 { SkGifCodec::IsGif, SkGifCodec::NewFromStream }, 31 { SkGifCodec::IsGif, SkGifCodec::NewFromStream },
36 { SkIcoCodec::IsIco, SkIcoCodec::NewFromStream }, 32 { SkIcoCodec::IsIco, SkIcoCodec::NewFromStream },
37 { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream }, 33 { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream },
38 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream } 34 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream }
39 }; 35 };
40 36
41 size_t SkCodec::MinBufferedBytesNeeded() { 37 size_t SkCodec::MinBufferedBytesNeeded() {
42 return WEBP_VP8_HEADER_SIZE; 38 return WEBP_VP8_HEADER_SIZE;
43 } 39 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 370 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
375 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); 371 const SkImageInfo fillInfo = info.makeWH(info.width(), 1);
376 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 372 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
377 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 373 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
378 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 374 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
379 } 375 }
380 break; 376 break;
381 } 377 }
382 } 378 }
383 } 379 }
OLDNEW
« no previous file with comments | « public.bzl ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698