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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp

Issue 2942873002: Fix the color issue in CMYK jpeg images.
Patch Set: Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 return planes_[i]; 475 return planes_[i];
476 } 476 }
477 477
478 size_t ImagePlanes::RowBytes(int i) const { 478 size_t ImagePlanes::RowBytes(int i) const {
479 DCHECK_GE(i, 0); 479 DCHECK_GE(i, 0);
480 DCHECK_LT(i, 3); 480 DCHECK_LT(i, 3);
481 return row_bytes_[i]; 481 return row_bytes_[i];
482 } 482 }
483 483
484 void ImageDecoder::SetEmbeddedColorProfile(const char* icc_data, 484 void ImageDecoder::SetEmbeddedColorProfile(const char* icc_data,
485 unsigned icc_length) { 485 unsigned icc_length,
486 sk_sp<SkColorSpace> color_space = SkColorSpace::MakeICC(icc_data, icc_length); 486 SkColorSpace::ICCTypeFlag icc_type) {
487 sk_sp<SkColorSpace> color_space =
488 SkColorSpace::MakeICC(icc_data, icc_length, icc_type);
487 if (!color_space) 489 if (!color_space)
488 DLOG(ERROR) << "Failed to parse image ICC profile"; 490 DLOG(ERROR) << "Failed to parse image ICC profile";
489 SetEmbeddedColorSpace(std::move(color_space)); 491 SetEmbeddedColorSpace(std::move(color_space));
490 } 492 }
491 493
492 void ImageDecoder::SetEmbeddedColorSpace(sk_sp<SkColorSpace> color_space) { 494 void ImageDecoder::SetEmbeddedColorSpace(sk_sp<SkColorSpace> color_space) {
493 DCHECK(!IgnoresColorSpace()); 495 DCHECK(!IgnoresColorSpace());
494 DCHECK(!has_histogrammed_color_space_); 496 DCHECK(!has_histogrammed_color_space_);
495 497
496 embedded_color_space_ = color_space; 498 embedded_color_space_ = color_space;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 560 }
559 561
560 // For color spaces without an identifiable gamut, just fall through to 562 // For color spaces without an identifiable gamut, just fall through to
561 // sRGB. 563 // sRGB.
562 } 564 }
563 565
564 return SkColorSpace::MakeSRGB(); 566 return SkColorSpace::MakeSRGB();
565 } 567 }
566 568
567 } // namespace blink 569 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698