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

Side by Side Diff: include/codec/SkCodec.h

Issue 1017293002: guarded change to SkImageGenerator to make getInfo() const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | include/core/SkImageGenerator.h » ('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 #ifndef SkCodec_DEFINED 8 #ifndef SkCodec_DEFINED
9 #define SkCodec_DEFINED 9 #define SkCodec_DEFINED
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 protected: 53 protected:
54 SkCodec(const SkImageInfo&, SkStream*); 54 SkCodec(const SkImageInfo&, SkStream*);
55 55
56 /** 56 /**
57 * The SkAlphaType is a conservative answer. i.e. it is possible that it 57 * The SkAlphaType is a conservative answer. i.e. it is possible that it
58 * initially returns a non-opaque answer, but completing the decode 58 * initially returns a non-opaque answer, but completing the decode
59 * reveals that the image is actually opaque. 59 * reveals that the image is actually opaque.
60 */ 60 */
61 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO
61 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { 62 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE {
62 *info = fInfo; 63 *info = fInfo;
63 return true; 64 return true;
64 } 65 }
66 #endif
65 67
66 // Helper for subclasses. 68 // Helper for subclasses.
67 const SkImageInfo& getOriginalInfo() { return fInfo; } 69 const SkImageInfo& getOriginalInfo() { return fInfo; }
68 70
69 virtual SkISize onGetScaledDimensions(float /* desiredScale */) const { 71 virtual SkISize onGetScaledDimensions(float /* desiredScale */) const {
70 // By default, scaling is not supported. 72 // By default, scaling is not supported.
71 return fInfo.dimensions(); 73 return fInfo.dimensions();
72 } 74 }
73 75
74 /** 76 /**
(...skipping 17 matching lines...) Expand all
92 * 94 *
93 */ 95 */
94 SkStream* stream() { 96 SkStream* stream() {
95 return fStream.get(); 97 return fStream.get();
96 } 98 }
97 99
98 private: 100 private:
99 const SkImageInfo fInfo; 101 const SkImageInfo fInfo;
100 SkAutoTDelete<SkStream> fStream; 102 SkAutoTDelete<SkStream> fStream;
101 bool fNeedsRewind; 103 bool fNeedsRewind;
104
105 typedef SkImageGenerator INHERITED;
102 }; 106 };
103 #endif // SkCodec_DEFINED 107 #endif // SkCodec_DEFINED
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | include/core/SkImageGenerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698