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

Side by Side Diff: src/images/SkImageDecoder_pkm.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 2014 Google Inc. 2 * Copyright 2014 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 "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkScaledBitmapSampler.h" 10 #include "SkScaledBitmapSampler.h"
11 #include "SkStream.h" 11 #include "SkStream.h"
12 #include "SkStreamPriv.h" 12 #include "SkStreamPriv.h"
13 #include "SkTextureCompressor.h" 13 #include "SkTextureCompressor.h"
14 #include "SkTypes.h" 14 #include "SkTypes.h"
15 15
16 #include "etc1.h" 16 #include "etc1.h"
17 17
18 class SkPKMImageDecoder : public SkImageDecoder { 18 class SkPKMImageDecoder : public SkImageDecoder {
19 public: 19 public:
20 SkPKMImageDecoder() { } 20 SkPKMImageDecoder() { }
21 21
22 Format getFormat() const SK_OVERRIDE { 22 SkEncodedFormat getFormat() const SK_OVERRIDE {
23 return kPKM_Format; 23 return kPKM_SkEncodedFormat;
24 } 24 }
25 25
26 protected: 26 protected:
27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; 27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE;
28 28
29 private: 29 private:
30 typedef SkImageDecoder INHERITED; 30 typedef SkImageDecoder INHERITED;
31 }; 31 };
32 32
33 //////////////////////////////////////////////////////////////////////////////// ///////// 33 //////////////////////////////////////////////////////////////////////////////// /////////
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 static SkImageDecoder* sk_libpkm_dfactory(SkStreamRewindable* stream) { 112 static SkImageDecoder* sk_libpkm_dfactory(SkStreamRewindable* stream) {
113 if (is_pkm(stream)) { 113 if (is_pkm(stream)) {
114 return SkNEW(SkPKMImageDecoder); 114 return SkNEW(SkPKMImageDecoder);
115 } 115 }
116 return NULL; 116 return NULL;
117 } 117 }
118 118
119 static SkImageDecoder_DecodeReg gReg(sk_libpkm_dfactory); 119 static SkImageDecoder_DecodeReg gReg(sk_libpkm_dfactory);
120 120
121 static SkImageDecoder::Format get_format_pkm(SkStreamRewindable* stream) { 121 static SkEncodedFormat get_format_pkm(SkStreamRewindable* stream) {
122 if (is_pkm(stream)) { 122 if (is_pkm(stream)) {
123 return SkImageDecoder::kPKM_Format; 123 return kPKM_SkEncodedFormat;
124 } 124 }
125 return SkImageDecoder::kUnknown_Format; 125 return kUnknown_SkEncodedFormat;
126 } 126 }
127 127
128 static SkImageDecoder_FormatReg gFormatReg(get_format_pkm); 128 static SkImageDecoder_FormatReg gFormatReg(get_format_pkm);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698