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

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

Issue 583773004: Revert of introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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);
44 CGImageSourceRef imageSrc = CGImageSourceCreateWithDataProvider(data, 0); 43 CGImageSourceRef imageSrc = CGImageSourceCreateWithDataProvider(data, 0);
45 CGDataProviderRelease(data); 44 CGDataProviderRelease(data);
46 return imageSrc; 45 return imageSrc;
47 } 46 }
48 47
49 class SkImageDecoder_CG : public SkImageDecoder { 48 class SkImageDecoder_CG : public SkImageDecoder {
50 protected: 49 protected:
51 virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode); 50 virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode);
52 }; 51 };
53 52
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 345
347 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); 346 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
348 const CFStringRef name = CGImageSourceGetType(imageSrc); 347 const CFStringRef name = CGImageSourceGetType(imageSrc);
349 if (NULL == name) { 348 if (NULL == name) {
350 return SkImageDecoder::kUnknown_Format; 349 return SkImageDecoder::kUnknown_Format;
351 } 350 }
352 return UTType_to_Format(name); 351 return UTType_to_Format(name);
353 } 352 }
354 353
355 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); 354 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