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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2046013002: Optimize color xforms with 2.2 gammas for SSE2 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 4 years, 6 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 fSrcData = codec->getICCData(); 165 fSrcData = codec->getICCData();
166 sk_sp<SkData> dstData = SkData::MakeFromFileName( 166 sk_sp<SkData> dstData = SkData::MakeFromFileName(
167 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str()); 167 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str());
168 SkASSERT(dstData); 168 SkASSERT(dstData);
169 169
170 170
171 #if defined(SK_TEST_QCMS) 171 #if defined(SK_TEST_QCMS)
172 if (FLAGS_qcms) { 172 if (FLAGS_qcms) {
173 fDstSpaceQCMS.reset(qcms_profile_from_memory(dstData->data(), dstData->s ize())); 173 fDstSpaceQCMS.reset(qcms_profile_from_memory(dstData->data(), dstData->s ize()));
174 SkASSERT(fDstSpaceQCMS); 174 SkASSERT(fDstSpaceQCMS);
175
176 // This call takes a non-trivial amount of time, but I think it's the mo st fair to
177 // treat it as overhead. It only needs to happen once.
178 qcms_profile_precache_output_transform(fDstSpaceQCMS);
175 } else 179 } else
176 #endif 180 #endif
177 { 181 {
178 fDstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); 182 fDstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size());
179 SkASSERT(fDstSpace); 183 SkASSERT(fDstSpace);
180 } 184 }
181 } 185 }
182 186
183 void ColorCodecBench::onDraw(int n, SkCanvas*) { 187 void ColorCodecBench::onDraw(int n, SkCanvas*) {
184 for (int i = 0; i < n; i++) { 188 for (int i = 0; i < n; i++) {
185 #if defined(SK_TEST_QCMS) 189 #if defined(SK_TEST_QCMS)
186 if (FLAGS_qcms) { 190 if (FLAGS_qcms) {
187 if (FLAGS_xform_only) { 191 if (FLAGS_xform_only) {
188 this->xformOnlyQCMS(); 192 this->xformOnlyQCMS();
189 } else { 193 } else {
190 this->decodeAndXformQCMS(); 194 this->decodeAndXformQCMS();
191 } 195 }
192 } else 196 } else
193 #endif 197 #endif
194 { 198 {
195 if (FLAGS_xform_only) { 199 if (FLAGS_xform_only) {
196 this->xformOnly(); 200 this->xformOnly();
197 } else { 201 } else {
198 this->decodeAndXform(); 202 this->decodeAndXform();
199 } 203 }
200 } 204 }
201 } 205 }
202 } 206 }
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