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

Side by Side Diff: src/ports/SkImageDecoder_CG.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 years, 3 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/pdf/SkPDFDevice.cpp ('k') | src/utils/SkDeferredCanvas.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 2008 The Android Open Source Project 2 * Copyright 2008 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 "SkCGUtils.h" 8 #include "SkCGUtils.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 22 matching lines...) Expand all
33 // TODO: use callbacks, so we don't have to load all the data into RAM 33 // TODO: use callbacks, so we don't have to load all the data into RAM
34 SkAutoMalloc storage; 34 SkAutoMalloc storage;
35 const size_t len = SkCopyStreamToStorage(&storage, stream); 35 const size_t len = SkCopyStreamToStorage(&storage, stream);
36 void* data = storage.detach(); 36 void* data = storage.detach();
37 37
38 return CGDataProviderCreateWithData(data, data, len, malloc_release_proc); 38 return CGDataProviderCreateWithData(data, data, len, malloc_release_proc);
39 } 39 }
40 40
41 static CGImageSourceRef SkStreamToCGImageSource(SkStream* stream) { 41 static CGImageSourceRef SkStreamToCGImageSource(SkStream* stream) {
42 CGDataProviderRef data = SkStreamToDataProvider(stream); 42 CGDataProviderRef data = SkStreamToDataProvider(stream);
43 SkASSERT(data);
43 CGImageSourceRef imageSrc = CGImageSourceCreateWithDataProvider(data, 0); 44 CGImageSourceRef imageSrc = CGImageSourceCreateWithDataProvider(data, 0);
44 CGDataProviderRelease(data); 45 CGDataProviderRelease(data);
45 return imageSrc; 46 return imageSrc;
46 } 47 }
47 48
48 class SkImageDecoder_CG : public SkImageDecoder { 49 class SkImageDecoder_CG : public SkImageDecoder {
49 protected: 50 protected:
50 virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode); 51 virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode);
51 }; 52 };
52 53
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 346
346 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); 347 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
347 const CFStringRef name = CGImageSourceGetType(imageSrc); 348 const CFStringRef name = CGImageSourceGetType(imageSrc);
348 if (NULL == name) { 349 if (NULL == name) {
349 return SkImageDecoder::kUnknown_Format; 350 return SkImageDecoder::kUnknown_Format;
350 } 351 }
351 return UTType_to_Format(name); 352 return UTType_to_Format(name);
352 } 353 }
353 354
354 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); 355 static SkImageDecoder_FormatReg gFormatReg(get_format_cg);
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698