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

Side by Side Diff: src/codec/SkWebpCodec.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 | « src/codec/SkPngCodec.cpp ('k') | src/core/SkColorSpaceXform.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkCodecPriv.h" 8 #include "SkCodecPriv.h"
9 #include "SkColorSpaceXform.h" 9 #include "SkColorSpaceXform.h"
10 #include "SkWebpCodec.h" 10 #include "SkWebpCodec.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 case VP8_STATUS_SUSPENDED: 300 case VP8_STATUS_SUSPENDED:
301 WebPIDecGetRGB(idec, rowsDecodedPtr, nullptr, nullptr, nullptr); 301 WebPIDecGetRGB(idec, rowsDecodedPtr, nullptr, nullptr, nullptr);
302 rowsDecoded = *rowsDecodedPtr; 302 rowsDecoded = *rowsDecodedPtr;
303 result = kIncompleteInput; 303 result = kIncompleteInput;
304 break; 304 break;
305 default: 305 default:
306 return kInvalidInput; 306 return kInvalidInput;
307 } 307 }
308 308
309 if (colorXform) { 309 if (colorXform) {
310 SkColorSpaceXform::ColorFormat colorFormat = select_xform_format(dstInfo .colorType()); 310 SkAlphaType xformAlphaType = select_alpha_xform(dstInfo.alphaType(),
311 SkAlphaType xformAlphaType = select_xform_alpha(dstInfo.alphaType(),
312 this->getInfo().alphaTyp e()); 311 this->getInfo().alphaTyp e());
313 312
314 uint32_t* src = (uint32_t*) config.output.u.RGBA.rgba; 313 uint32_t* src = (uint32_t*) config.output.u.RGBA.rgba;
315 size_t srcRowBytes = config.output.u.RGBA.stride; 314 size_t srcRowBytes = config.output.u.RGBA.stride;
316 for (int y = 0; y < rowsDecoded; y++) { 315 for (int y = 0; y < rowsDecoded; y++) {
317 colorXform->apply(dst, src, dstInfo.width(), colorFormat, xformAlpha Type); 316 colorXform->apply(dst, src, dstInfo.width(), dstInfo.colorType(), xf ormAlphaType);
318 dst = SkTAddOffset<void>(dst, rowBytes); 317 dst = SkTAddOffset<void>(dst, rowBytes);
319 src = SkTAddOffset<uint32_t>(src, srcRowBytes); 318 src = SkTAddOffset<uint32_t>(src, srcRowBytes);
320 } 319 }
321 } 320 }
322 321
323 return result; 322 return result;
324 } 323 }
325 324
326 SkWebpCodec::SkWebpCodec(int width, int height, const SkEncodedInfo& info, 325 SkWebpCodec::SkWebpCodec(int width, int height, const SkEncodedInfo& info,
327 sk_sp<SkColorSpace> colorSpace, SkStream* stream, WebPD emuxer* demux, 326 sk_sp<SkColorSpace> colorSpace, SkStream* stream, WebPD emuxer* demux,
328 sk_sp<SkData> data) 327 sk_sp<SkData> data)
329 : INHERITED(width, height, info, stream, std::move(colorSpace)) 328 : INHERITED(width, height, info, stream, std::move(colorSpace))
330 , fDemux(demux) 329 , fDemux(demux)
331 , fData(std::move(data)) 330 , fData(std::move(data))
332 {} 331 {}
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698