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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2390263002: Add SkColorSpaceXform to the public API (Closed)
Patch Set: Remove type on enum Created 4 years, 2 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.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 SkAssertResult(xform->apply(select_xform_format(fDstInfo.colorType()), d st,
105 select_xform_format(fDstInfo.colorType()), 105 SkColorSpaceXform::kRGBA_8888_ColorFormat, s rc,
106 SkColorSpaceXform::kRGBA_8888_ColorFormat, fDstInfo.alphaTy pe()); 106 fSrcInfo.width(), fDstInfo.alphaType()));
107 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes()); 107 dst = SkTAddOffset<void>(dst, fDstInfo.minRowBytes());
108 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes()); 108 src = SkTAddOffset<void>(src, fSrcInfo.minRowBytes());
109 } 109 }
110 } 110 }
111 111
112 #if defined(SK_TEST_QCMS) 112 #if defined(SK_TEST_QCMS)
113 void ColorCodecBench::xformOnlyQCMS() { 113 void ColorCodecBench::xformOnlyQCMS() {
114 SkAutoTCallVProc<qcms_profile, qcms_profile_release> 114 SkAutoTCallVProc<qcms_profile, qcms_profile_release>
115 srcSpace(qcms_profile_from_memory(fSrcData->data(), fSrcData->size() )); 115 srcSpace(qcms_profile_from_memory(fSrcData->data(), fSrcData->size() ));
116 SkASSERT(srcSpace); 116 SkASSERT(srcSpace);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 #endif 207 #endif
208 { 208 {
209 if (FLAGS_xform_only) { 209 if (FLAGS_xform_only) {
210 this->xformOnly(); 210 this->xformOnly();
211 } else { 211 } else {
212 this->decodeAndXform(); 212 this->decodeAndXform();
213 } 213 }
214 } 214 }
215 } 215 }
216 } 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