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

Unified Diff: third_party/WebKit/Source/core/frame/ImageBitmap.cpp

Issue 2454123002: Refactor image decoders to use 'colorSpace' instead of 'colorProfile' (Closed)
Patch Set: Fix legacy ImageFrame 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/ImageBitmap.cpp
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
index 2aa2786cb88392398151b6b5d09150bb129d6be7..ea65053dcc9cc3ede316e1038d221664f00deac9 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -276,8 +276,8 @@ static PassRefPtr<StaticBitmapImage> cropImage(
Image* image,
const ParsedOptions& parsedOptions,
AlphaDisposition imageFormat = PremultiplyAlpha,
- ImageDecoder::GammaAndColorProfileOption colorSpaceOp =
- ImageDecoder::GammaAndColorProfileApplied) {
+ ImageDecoder::ColorSpaceOption colorSpaceOp =
+ ImageDecoder::ColorSpaceApplied) {
ASSERT(image);
IntRect imgRect(IntPoint(), IntSize(image->width(), image->height()));
const IntRect srcRect = intersection(imgRect, parsedOptions.cropRect);
@@ -307,7 +307,7 @@ static PassRefPtr<StaticBitmapImage> cropImage(
if ((((!parsedOptions.premultiplyAlpha && !skiaImage->isOpaque()) ||
!skiaImage) &&
image->data() && imageFormat == PremultiplyAlpha) ||
- colorSpaceOp == ImageDecoder::GammaAndColorProfileIgnored) {
+ colorSpaceOp == ImageDecoder::ColorSpaceIgnored) {
std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create(
image->data(), true,
parsedOptions.premultiplyAlpha ? ImageDecoder::AlphaPremultiplied
@@ -388,12 +388,13 @@ ImageBitmap::ImageBitmap(HTMLImageElement* image,
if (dstBufferSizeHasOverflow(parsedOptions))
return;
- if (options.colorSpaceConversion() == "none")
+ if (options.colorSpaceConversion() == "none") {
m_image = cropImage(input.get(), parsedOptions, PremultiplyAlpha,
- ImageDecoder::GammaAndColorProfileIgnored);
- else
+ ImageDecoder::ColorSpaceIgnored);
+ } else {
m_image = cropImage(input.get(), parsedOptions, PremultiplyAlpha,
- ImageDecoder::GammaAndColorProfileApplied);
+ ImageDecoder::ColorSpaceApplied);
+ }
if (!m_image)
return;
// In the case where the source image is lazy-decoded, m_image may not be in
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698