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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } else | 192 } else |
193 #endif | 193 #endif |
194 { | 194 { |
195 fDstSpace = FLAGS_srgb ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Name
d) : | 195 fDstSpace = FLAGS_srgb ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Name
d) : |
196 SkColorSpace::NewICC(dstData->data(), dstData->
size()); | 196 SkColorSpace::NewICC(dstData->data(), dstData->
size()); |
197 SkASSERT(fDstSpace); | 197 SkASSERT(fDstSpace); |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 void ColorCodecBench::onDraw(int n, SkCanvas*) { | 201 void ColorCodecBench::onDraw(int n, SkCanvas*) { |
202 if ((FLAGS_srgb || FLAGS_qcms) && FLAGS_half) { | 202 #if defined(SK_TEST_QCMS) |
| 203 bool to8888 = FLAGS_srgb || FLAGS_qcms; |
| 204 #else |
| 205 bool to8888 = FLAGS_srgb; |
| 206 #endif |
| 207 if (to8888 && FLAGS_half) { |
203 SkDebugf("Error: Contradicting flags.\n"); | 208 SkDebugf("Error: Contradicting flags.\n"); |
204 return; | 209 return; |
205 } | 210 } |
206 | 211 |
207 for (int i = 0; i < n; i++) { | 212 for (int i = 0; i < n; i++) { |
208 #if defined(SK_TEST_QCMS) | 213 #if defined(SK_TEST_QCMS) |
209 if (FLAGS_qcms) { | 214 if (FLAGS_qcms) { |
210 if (FLAGS_xform_only) { | 215 if (FLAGS_xform_only) { |
211 this->xformOnlyQCMS(); | 216 this->xformOnlyQCMS(); |
212 } else { | 217 } else { |
213 this->decodeAndXformQCMS(); | 218 this->decodeAndXformQCMS(); |
214 } | 219 } |
215 } else | 220 } else |
216 #endif | 221 #endif |
217 { | 222 { |
218 if (FLAGS_xform_only) { | 223 if (FLAGS_xform_only) { |
219 this->xformOnly(); | 224 this->xformOnly(); |
220 } else { | 225 } else { |
221 this->decodeAndXform(); | 226 this->decodeAndXform(); |
222 } | 227 } |
223 } | 228 } |
224 } | 229 } |
225 } | 230 } |
OLD | NEW |