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

Side by Side Diff: src/images/SkImageDecoder_libgif.cpp

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkColor.h" 8 #include "SkColor.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkColorTable.h" 10 #include "SkColorTable.h"
11 #include "SkImageDecoder.h" 11 #include "SkImageDecoder.h"
12 #include "SkRTConf.h" 12 #include "SkRTConf.h"
13 #include "SkScaledBitmapSampler.h" 13 #include "SkScaledBitmapSampler.h"
14 #include "SkStream.h" 14 #include "SkStream.h"
15 #include "SkTemplates.h" 15 #include "SkTemplates.h"
16 #include "SkUtils.h" 16 #include "SkUtils.h"
17 17
18 #include "gif_lib.h" 18 #include "gif_lib.h"
19 19
20 class SkGIFImageDecoder : public SkImageDecoder { 20 class SkGIFImageDecoder : public SkImageDecoder {
21 public: 21 public:
22 Format getFormat() const SK_OVERRIDE { 22 SkEncodedFormat getFormat() const SK_OVERRIDE {
23 return kGIF_Format; 23 return kGIF_SkEncodedFormat;
24 } 24 }
25 25
26 protected: 26 protected:
27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE; 27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE;
28 28
29 private: 29 private:
30 typedef SkImageDecoder INHERITED; 30 typedef SkImageDecoder INHERITED;
31 }; 31 };
32 32
33 static const uint8_t gStartingIterlaceYValue[] = { 33 static const uint8_t gStartingIterlaceYValue[] = {
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 static SkImageDecoder* sk_libgif_dfactory(SkStreamRewindable* stream) { 525 static SkImageDecoder* sk_libgif_dfactory(SkStreamRewindable* stream) {
526 if (is_gif(stream)) { 526 if (is_gif(stream)) {
527 return SkNEW(SkGIFImageDecoder); 527 return SkNEW(SkGIFImageDecoder);
528 } 528 }
529 return NULL; 529 return NULL;
530 } 530 }
531 531
532 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory); 532 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory);
533 533
534 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) { 534 static SkEncodedFormat get_format_gif(SkStreamRewindable* stream) {
535 if (is_gif(stream)) { 535 if (is_gif(stream)) {
536 return SkImageDecoder::kGIF_Format; 536 return kGIF_SkEncodedFormat;
537 } 537 }
538 return SkImageDecoder::kUnknown_Format; 538 return kUnknown_SkEncodedFormat;
539 } 539 }
540 540
541 static SkImageDecoder_FormatReg gFormatReg(get_format_gif); 541 static SkImageDecoder_FormatReg gFormatReg(get_format_gif);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698