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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 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 | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkRemotableFontMgr_win_dw.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 2016 Google Inc. 2 * Copyright 2016 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 "SkImageGeneratorCG.h" 8 #include "SkImageGeneratorCG.h"
9 9
10 #ifdef SK_BUILD_FOR_MAC 10 #ifdef SK_BUILD_FOR_MAC
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return nullptr; 59 return nullptr;
60 } 60 }
61 61
62 SkAlphaType alphaType = hasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType ; 62 SkAlphaType alphaType = hasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType ;
63 SkImageInfo info = SkImageInfo::Make(width, height, kN32_SkColorType, alphaT ype); 63 SkImageInfo info = SkImageInfo::Make(width, height, kN32_SkColorType, alphaT ype);
64 64
65 // FIXME: We have the opportunity to extract color space information here, 65 // FIXME: We have the opportunity to extract color space information here,
66 // though I think it makes sense to wait until we understand how 66 // though I think it makes sense to wait until we understand how
67 // we want to communicate it to the generator. 67 // we want to communicate it to the generator.
68 68
69 return new SkImageGeneratorCG(info, autoImageSrc.detach(), data); 69 return new SkImageGeneratorCG(info, autoImageSrc.release(), data);
70 } 70 }
71 71
72 SkImageGeneratorCG::SkImageGeneratorCG(const SkImageInfo& info, const void* imag eSrc, SkData* data) 72 SkImageGeneratorCG::SkImageGeneratorCG(const SkImageInfo& info, const void* imag eSrc, SkData* data)
73 : INHERITED(info) 73 : INHERITED(info)
74 , fImageSrc(imageSrc) 74 , fImageSrc(imageSrc)
75 , fData(SkRef(data)) 75 , fData(SkRef(data))
76 {} 76 {}
77 77
78 SkData* SkImageGeneratorCG::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) { 78 SkData* SkImageGeneratorCG::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
79 return SkRef(fData.get()); 79 return SkRef(fData.get());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // kGray_8_SkColorType 113 // kGray_8_SkColorType
114 // kIndex_8_SkColorType 114 // kIndex_8_SkColorType
115 // Additionally, it would be interesting to compare the performance 115 // Additionally, it would be interesting to compare the performance
116 // of SkSwizzler with CG's built in swizzler. 116 // of SkSwizzler with CG's built in swizzler.
117 if (!SkCopyPixelsFromCGImage(info, rowBytes, pixels, image)) { 117 if (!SkCopyPixelsFromCGImage(info, rowBytes, pixels, image)) {
118 return false; 118 return false;
119 } 119 }
120 120
121 return true; 121 return true;
122 } 122 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkRemotableFontMgr_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698