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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2353363008: Add BGRA as input format to SkColorSpaceXform (Closed)
Patch Set: Response to comments 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"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 95 srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
96 } 96 }
97 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace.g et(), 97 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace.g et(),
98 fDstSpace. get()); 98 fDstSpace. get());
99 SkASSERT(xform); 99 SkASSERT(xform);
100 100
101 void* dst = fDst.get(); 101 void* dst = fDst.get();
102 void* src = fSrc.get(); 102 void* src = fSrc.get();
103 for (int y = 0; y < fSrcInfo.height(); y++) { 103 for (int y = 0; y < fSrcInfo.height(); y++) {
104 xform->apply(dst, (uint32_t*) src, fSrcInfo.width(), 104 xform->apply(dst, (uint32_t*) src, fSrcInfo.width(),
105 select_xform_format(fDstInfo.colorType()), fDstInfo.alphaTy pe()); 105 select_xform_format(fDstInfo.colorType()),
106 SkColorSpaceXform::kRGBA_8888_ColorFormat, fDstInfo.alphaTy pe());
106 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes()); 107 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes());
107 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes()); 108 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes());
108 } 109 }
109 } 110 }
110 111
111 #if defined(SK_TEST_QCMS) 112 #if defined(SK_TEST_QCMS)
112 void ColorCodecBench::xformOnlyQCMS() { 113 void ColorCodecBench::xformOnlyQCMS() {
113 SkAutoTCallVProc<qcms_profile, qcms_profile_release> 114 SkAutoTCallVProc<qcms_profile, qcms_profile_release>
114 srcSpace(qcms_profile_from_memory(fSrcData->data(), fSrcData->size() )); 115 srcSpace(qcms_profile_from_memory(fSrcData->data(), fSrcData->size() ));
115 SkASSERT(srcSpace); 116 SkASSERT(srcSpace);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 #endif 207 #endif
207 { 208 {
208 if (FLAGS_xform_only) { 209 if (FLAGS_xform_only) {
209 this->xformOnly(); 210 this->xformOnly();
210 } else { 211 } else {
211 this->decodeAndXform(); 212 this->decodeAndXform();
212 } 213 }
213 } 214 }
214 } 215 }
215 } 216 }
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