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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2206403003: Optimize color xforms when src and dst are matching (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 4 years, 4 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 #if defined(SK_TEST_QCMS) 175 #if defined(SK_TEST_QCMS)
176 else if (FLAGS_qcms) { 176 else if (FLAGS_qcms) {
177 // Set-up a row buffer to decode into before transforming to dst. 177 // Set-up a row buffer to decode into before transforming to dst.
178 fSrc.reset(fSrcInfo.minRowBytes()); 178 fSrc.reset(fSrcInfo.minRowBytes());
179 } 179 }
180 #endif 180 #endif
181 } 181 }
182 182
183 void ColorCodecBench::onDraw(int n, SkCanvas*) { 183 void ColorCodecBench::onDraw(int n, SkCanvas*) {
184 #if defined(SK_TEST_QCMS) 184 #if defined(SK_TEST_QCMS)
185 bool to8888 = FLAGS_srgb || FLAGS_qcms; 185 if (FLAGS_qcms && FLAGS_half) {
186 #else
187 bool to8888 = FLAGS_srgb;
188 #endif
189 if (to8888 && FLAGS_half) {
190 SkDebugf("Error: Contradicting flags.\n"); 186 SkDebugf("Error: Contradicting flags.\n");
191 return; 187 return;
192 } 188 }
189 #endif
193 190
194 for (int i = 0; i < n; i++) { 191 for (int i = 0; i < n; i++) {
195 #if defined(SK_TEST_QCMS) 192 #if defined(SK_TEST_QCMS)
196 if (FLAGS_qcms) { 193 if (FLAGS_qcms) {
197 if (FLAGS_xform_only) { 194 if (FLAGS_xform_only) {
198 this->xformOnlyQCMS(); 195 this->xformOnlyQCMS();
199 } else { 196 } else {
200 this->decodeAndXformQCMS(); 197 this->decodeAndXformQCMS();
201 } 198 }
202 } else 199 } else
203 #endif 200 #endif
204 { 201 {
205 if (FLAGS_xform_only) { 202 if (FLAGS_xform_only) {
206 this->xformOnly(); 203 this->xformOnly();
207 } else { 204 } else {
208 this->decodeAndXform(); 205 this->decodeAndXform();
209 } 206 }
210 } 207 }
211 } 208 }
212 } 209 }
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