| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |