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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2335723002: Reduce overhead for linear color xforms (Closed)
Patch Set: More refactoring Created 4 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 | « no previous file | src/core/SkColorSpaceXform.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 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 "ColorCodecBench.h" 8 #include "ColorCodecBench.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 qcms_profile_precache_output_transform(fDstSpaceQCMS); 154 qcms_profile_precache_output_transform(fDstSpaceQCMS);
155 } else 155 } else
156 #endif 156 #endif
157 { 157 {
158 fDstSpace = FLAGS_srgb ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Name d) : 158 fDstSpace = FLAGS_srgb ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Name d) :
159 SkColorSpace::NewICC(dstData->data(), dstData-> size()); 159 SkColorSpace::NewICC(dstData->data(), dstData-> size());
160 SkASSERT(fDstSpace); 160 SkASSERT(fDstSpace);
161 } 161 }
162 162
163 fSrcInfo = codec->getInfo().makeColorType(kRGBA_8888_SkColorType); 163 fSrcInfo = codec->getInfo().makeColorType(kRGBA_8888_SkColorType);
164 fDstInfo = fSrcInfo;
164 165
165 if (FLAGS_half) { 166 if (FLAGS_half) {
166 fDstInfo = fDstInfo.makeColorType(kRGBA_F16_SkColorType); 167 fDstInfo = fDstInfo.makeColorType(kRGBA_F16_SkColorType);
167 fDstSpace = fDstSpace->makeLinearGamma(); 168 fDstSpace = fDstSpace->makeLinearGamma();
168 } 169 }
169 170
170 fDstInfo = fSrcInfo.makeColorSpace(fDstSpace); 171 fDstInfo = fDstInfo.makeColorSpace(fDstSpace);
171 172
172 fDst.reset(fDstInfo.getSafeSize(fDstInfo.minRowBytes())); 173 fDst.reset(fDstInfo.getSafeSize(fDstInfo.minRowBytes()));
173 174
174 if (FLAGS_xform_only) { 175 if (FLAGS_xform_only) {
175 fSrc.reset(fSrcInfo.getSafeSize(fSrcInfo.minRowBytes())); 176 fSrc.reset(fSrcInfo.getSafeSize(fSrcInfo.minRowBytes()));
176 codec->getPixels(fSrcInfo, fSrc.get(), fSrcInfo.minRowBytes()); 177 codec->getPixels(fSrcInfo, fSrc.get(), fSrcInfo.minRowBytes());
177 } 178 }
178 #if defined(SK_TEST_QCMS) 179 #if defined(SK_TEST_QCMS)
179 else if (FLAGS_qcms) { 180 else if (FLAGS_qcms) {
180 // Set-up a row buffer to decode into before transforming to dst. 181 // Set-up a row buffer to decode into before transforming to dst.
(...skipping 22 matching lines...) Expand all
203 #endif 204 #endif
204 { 205 {
205 if (FLAGS_xform_only) { 206 if (FLAGS_xform_only) {
206 this->xformOnly(); 207 this->xformOnly();
207 } else { 208 } else {
208 this->decodeAndXform(); 209 this->decodeAndXform();
209 } 210 }
210 } 211 }
211 } 212 }
212 } 213 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698