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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2360863003: Make SkColorSpaceXform::New() take bare ptrs (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"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes()); 87 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes());
88 } 88 }
89 } 89 }
90 #endif 90 #endif
91 91
92 void ColorCodecBench::xformOnly() { 92 void ColorCodecBench::xformOnly() {
93 sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewICC(fSrcData->data(), fSrcDa ta->size()); 93 sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewICC(fSrcData->data(), fSrcDa ta->size());
94 if (!srcSpace) { 94 if (!srcSpace) {
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, fDstSpace); 97 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace.g et(),
98 fDstSpace. get());
98 SkASSERT(xform); 99 SkASSERT(xform);
99 100
100 void* dst = fDst.get(); 101 void* dst = fDst.get();
101 void* src = fSrc.get(); 102 void* src = fSrc.get();
102 for (int y = 0; y < fSrcInfo.height(); y++) { 103 for (int y = 0; y < fSrcInfo.height(); y++) {
103 xform->apply(dst, (uint32_t*) src, fSrcInfo.width(), 104 xform->apply(dst, (uint32_t*) src, fSrcInfo.width(),
104 select_xform_format(fDstInfo.colorType()), fDstInfo.alphaTy pe()); 105 select_xform_format(fDstInfo.colorType()), fDstInfo.alphaTy pe());
105 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes()); 106 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes());
106 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes()); 107 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes());
107 } 108 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 #endif 206 #endif
206 { 207 {
207 if (FLAGS_xform_only) { 208 if (FLAGS_xform_only) {
208 this->xformOnly(); 209 this->xformOnly();
209 } else { 210 } else {
210 this->decodeAndXform(); 211 this->decodeAndXform();
211 } 212 }
212 } 213 }
213 } 214 }
214 } 215 }
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