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

Side by Side Diff: src/images/SkImageDecoder_FactoryRegistrar.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 2013 The Android Open Source Project 2 * Copyright 2013 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 "SkErrorInternals.h" 8 #include "SkErrorInternals.h"
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 27 matching lines...) Expand all
38 if (codec) { 38 if (codec) {
39 return codec; 39 return codec;
40 } 40 }
41 curr = curr->next(); 41 curr = curr->next();
42 } 42 }
43 return NULL; 43 return NULL;
44 } 44 }
45 45
46 template SkImageDecoder_FormatReg* SkImageDecoder_FormatReg::gHead; 46 template SkImageDecoder_FormatReg* SkImageDecoder_FormatReg::gHead;
47 47
48 SkImageDecoder::Format SkImageDecoder::GetStreamFormat(SkStreamRewindable* strea m) { 48 SkEncodedFormat SkImageDecoder::GetStreamFormat(SkStreamRewindable* stream) {
49 const SkImageDecoder_FormatReg* curr = SkImageDecoder_FormatReg::Head(); 49 const SkImageDecoder_FormatReg* curr = SkImageDecoder_FormatReg::Head();
50 while (curr != NULL) { 50 while (curr != NULL) {
51 Format format = curr->factory()(stream); 51 SkEncodedFormat format = curr->factory()(stream);
52 if (!stream->rewind()) { 52 if (!stream->rewind()) {
53 SkErrorInternals::SetError(kInvalidOperation_SkError, 53 SkErrorInternals::SetError(kInvalidOperation_SkError,
54 "Unable to rewind the image stream\n"); 54 "Unable to rewind the image stream\n");
55 return kUnknown_Format; 55 return kUnknown_SkEncodedFormat;
56 } 56 }
57 if (format != kUnknown_Format) { 57 if (format != kUnknown_SkEncodedFormat) {
58 return format; 58 return format;
59 } 59 }
60 curr = curr->next(); 60 curr = curr->next();
61 } 61 }
62 return kUnknown_Format; 62 return kUnknown_SkEncodedFormat;
63 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698