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

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

Issue 340783013: Switch SkPDFStream's internal storage from SkStream to SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 5 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 | « src/core/SkStreamPriv.h ('k') | src/images/SkImageDecoder_libbmp.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 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 "SkPixelRef.h" 10 #include "SkPixelRef.h"
11 #include "SkScaledBitmapSampler.h" 11 #include "SkScaledBitmapSampler.h"
12 #include "SkStream.h" 12 #include "SkStream.h"
13 #include "SkStreamHelpers.h" 13 #include "SkStreamPriv.h"
14 #include "SkTypes.h" 14 #include "SkTypes.h"
15 15
16 #include "ktx.h" 16 #include "ktx.h"
17 #include "etc1.h" 17 #include "etc1.h"
18 18
19 //////////////////////////////////////////////////////////////////////////////// ///////// 19 //////////////////////////////////////////////////////////////////////////////// /////////
20 20
21 21
22 //////////////////////////////////////////////////////////////////////////////// ///////// 22 //////////////////////////////////////////////////////////////////////////////// /////////
23 23
(...skipping 18 matching lines...) Expand all
42 42
43 protected: 43 protected:
44 virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; 44 virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE;
45 45
46 private: 46 private:
47 typedef SkImageDecoder INHERITED; 47 typedef SkImageDecoder INHERITED;
48 }; 48 };
49 49
50 bool SkKTXImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { 50 bool SkKTXImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
51 // TODO: Implement SkStream::copyToData() that's cheap for memory and file s treams 51 // TODO: Implement SkStream::copyToData() that's cheap for memory and file s treams
52 SkAutoDataUnref data(CopyStreamToData(stream)); 52 SkAutoDataUnref data(SkCopyStreamToData(stream));
53 if (NULL == data) { 53 if (NULL == data) {
54 return false; 54 return false;
55 } 55 }
56 56
57 SkKTXFile ktxFile(data); 57 SkKTXFile ktxFile(data);
58 if (!ktxFile.valid()) { 58 if (!ktxFile.valid()) {
59 return false; 59 return false;
60 } 60 }
61 61
62 const unsigned short width = ktxFile.width(); 62 const unsigned short width = ktxFile.width();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return SkImageDecoder::kUnknown_Format; 268 return SkImageDecoder::kUnknown_Format;
269 } 269 }
270 270
271 SkImageEncoder* sk_libktx_efactory(SkImageEncoder::Type t) { 271 SkImageEncoder* sk_libktx_efactory(SkImageEncoder::Type t) {
272 return (SkImageEncoder::kKTX_Type == t) ? SkNEW(SkKTXImageEncoder) : NULL; 272 return (SkImageEncoder::kKTX_Type == t) ? SkNEW(SkKTXImageEncoder) : NULL;
273 } 273 }
274 274
275 static SkImageDecoder_DecodeReg gReg(sk_libktx_dfactory); 275 static SkImageDecoder_DecodeReg gReg(sk_libktx_dfactory);
276 static SkImageDecoder_FormatReg gFormatReg(get_format_ktx); 276 static SkImageDecoder_FormatReg gFormatReg(get_format_ktx);
277 static SkImageEncoder_EncodeReg gEReg(sk_libktx_efactory); 277 static SkImageEncoder_EncodeReg gEReg(sk_libktx_efactory);
OLDNEW
« no previous file with comments | « src/core/SkStreamPriv.h ('k') | src/images/SkImageDecoder_libbmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698