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

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

Issue 1406153015: Remove dependencies on Android's forked decoder libraries (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: It is 2015 Created 5 years, 1 month 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 | « platform_tools/android/gyp/dependencies.gypi ('k') | src/images/SkImageDecoder_libjpeg.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 "SkData.h" 10 #include "SkData.h"
11 #include "SkCodec_libgif.h" 11 #include "SkCodec_libgif.h"
12 #include "SkCodec_libico.h" 12 #include "SkCodec_libico.h"
13 #include "SkCodec_libpng.h" 13 #include "SkCodec_libpng.h"
14 #include "SkCodec_wbmp.h" 14 #include "SkCodec_wbmp.h"
15 #include "SkCodecPriv.h" 15 #include "SkCodecPriv.h"
16 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && !defined(GOOGLE3) 16 #if !defined(GOOGLE3)
17 #include "SkJpegCodec.h" 17 #include "SkJpegCodec.h"
18 #endif 18 #endif
19 #include "SkStream.h" 19 #include "SkStream.h"
20 #include "SkWebpCodec.h" 20 #include "SkWebpCodec.h"
21 21
22 struct DecoderProc { 22 struct DecoderProc {
23 bool (*IsFormat)(SkStream*); 23 bool (*IsFormat)(SkStream*);
24 SkCodec* (*NewFromStream)(SkStream*); 24 SkCodec* (*NewFromStream)(SkStream*);
25 }; 25 };
26 26
27 static const DecoderProc gDecoderProcs[] = { 27 static const DecoderProc gDecoderProcs[] = {
28 { SkPngCodec::IsPng, SkPngCodec::NewFromStream }, 28 { SkPngCodec::IsPng, SkPngCodec::NewFromStream },
29 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && !defined(GOOGLE3) 29 #if !defined(GOOGLE3)
30 { SkJpegCodec::IsJpeg, SkJpegCodec::NewFromStream }, 30 { SkJpegCodec::IsJpeg, SkJpegCodec::NewFromStream },
31 #endif 31 #endif
32 { SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream }, 32 { SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream },
33 { SkGifCodec::IsGif, SkGifCodec::NewFromStream }, 33 { SkGifCodec::IsGif, SkGifCodec::NewFromStream },
34 { SkIcoCodec::IsIco, SkIcoCodec::NewFromStream }, 34 { SkIcoCodec::IsIco, SkIcoCodec::NewFromStream },
35 { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream }, 35 { SkBmpCodec::IsBmp, SkBmpCodec::NewFromStream },
36 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream } 36 { SkWbmpCodec::IsWbmp, SkWbmpCodec::NewFromStream }
37 }; 37 };
38 38
39 SkCodec* SkCodec::NewFromStream(SkStream* stream) { 39 SkCodec* SkCodec::NewFromStream(SkStream* stream) {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 343 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
344 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); 344 const SkImageInfo fillInfo = info.makeWH(info.width(), 1);
345 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 345 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
346 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 346 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
347 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 347 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
348 } 348 }
349 break; 349 break;
350 } 350 }
351 } 351 }
352 } 352 }
OLDNEW
« no previous file with comments | « platform_tools/android/gyp/dependencies.gypi ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698