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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2347473007: Revert of Support Float32 output from SkColorSpaceXform (Closed)
Patch Set: 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 | gm/colorspacexform.cpp » ('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"
11 #include "SkCodecPriv.h"
12 #include "SkColorSpaceXform.h" 11 #include "SkColorSpaceXform.h"
13 #include "SkCommandLineFlags.h" 12 #include "SkCommandLineFlags.h"
14 13
15 #if defined(SK_TEST_QCMS) 14 #if defined(SK_TEST_QCMS)
16 DEFINE_bool(qcms, false, "Bench qcms color conversion"); 15 DEFINE_bool(qcms, false, "Bench qcms color conversion");
17 #endif 16 #endif
18 DEFINE_bool(xform_only, false, "Only time the color xform, do not include the de code time"); 17 DEFINE_bool(xform_only, false, "Only time the color xform, do not include the de code time");
19 DEFINE_bool(srgb, false, "Convert to srgb dst space"); 18 DEFINE_bool(srgb, false, "Convert to srgb dst space");
20 DEFINE_bool(half, false, "Convert to half floats"); 19 DEFINE_bool(half, false, "Convert to half floats");
21 20
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewICC(fSrcData->data(), fSrcDa ta->size()); 92 sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewICC(fSrcData->data(), fSrcDa ta->size());
94 if (!srcSpace) { 93 if (!srcSpace) {
95 srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 94 srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
96 } 95 }
97 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace, fDstSpace); 96 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace, fDstSpace);
98 SkASSERT(xform); 97 SkASSERT(xform);
99 98
100 void* dst = fDst.get(); 99 void* dst = fDst.get();
101 void* src = fSrc.get(); 100 void* src = fSrc.get();
102 for (int y = 0; y < fSrcInfo.height(); y++) { 101 for (int y = 0; y < fSrcInfo.height(); y++) {
103 xform->apply(dst, (uint32_t*) src, fSrcInfo.width(), 102 xform->apply(dst, (uint32_t*) src, fSrcInfo.width(), fDstInfo.colorType( ),
104 select_xform_format(fDstInfo.colorType()), fDstInfo.alphaTy pe()); 103 fDstInfo.alphaType());
105 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes()); 104 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes());
106 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes()); 105 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes());
107 } 106 }
108 } 107 }
109 108
110 #if defined(SK_TEST_QCMS) 109 #if defined(SK_TEST_QCMS)
111 void ColorCodecBench::xformOnlyQCMS() { 110 void ColorCodecBench::xformOnlyQCMS() {
112 SkAutoTCallVProc<qcms_profile, qcms_profile_release> 111 SkAutoTCallVProc<qcms_profile, qcms_profile_release>
113 srcSpace(qcms_profile_from_memory(fSrcData->data(), fSrcData->size() )); 112 srcSpace(qcms_profile_from_memory(fSrcData->data(), fSrcData->size() ));
114 SkASSERT(srcSpace); 113 SkASSERT(srcSpace);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 #endif 204 #endif
206 { 205 {
207 if (FLAGS_xform_only) { 206 if (FLAGS_xform_only) {
208 this->xformOnly(); 207 this->xformOnly();
209 } else { 208 } else {
210 this->decodeAndXform(); 209 this->decodeAndXform();
211 } 210 }
212 } 211 }
213 } 212 }
214 } 213 }
OLDNEW
« no previous file with comments | « no previous file | gm/colorspacexform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698