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

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

Issue 2771813003: Prepare ImageData for color managed BaseRenderingContext2D::create/put/get-ImageData (Closed)
Patch Set: Fixing issues Created 3 years, 8 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/frame/ImageBitmapTest.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 2dff4143cee1d75d96c5b6a0b3b0eaea1a0f161f..c3cd961a5b12b29186bb1a6b3c37db276e19f1b6 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -789,7 +789,7 @@ ImageBitmap::ImageBitmap(ImageData* data,
// Using kN32 type, swizzle input if necessary.
SkImageInfo info = SkImageInfo::Make(
parsedOptions.cropRect.width(), parsedOptions.cropRect.height(),
- kN32_SkColorType, kUnpremul_SkAlphaType, data->getSkColorSpace());
+ kN32_SkColorType, kUnpremul_SkAlphaType, data->skColorSpace());
unsigned bytesPerPixel = static_cast<unsigned>(info.bytesPerPixel());
unsigned srcPixelBytesPerRow = bytesPerPixel * data->size().width();
unsigned dstPixelBytesPerRow =
@@ -866,15 +866,15 @@ ImageBitmap::ImageBitmap(ImageData* data,
}
if (!skImage)
return;
- if (data->getSkColorSpace()) {
- parsedOptions.latestColorSpace = data->getSkColorSpace();
+ if (data->skColorSpace()) {
+ parsedOptions.latestColorSpace = data->skColorSpace();
applyColorSpaceConversion(skImage, parsedOptions);
}
if (parsedOptions.shouldScaleInput) {
m_image = StaticBitmapImage::create(
scaleSkImage(skImage, parsedOptions.resizeWidth,
parsedOptions.resizeHeight, parsedOptions.resizeQuality,
- parsedOptions.latestColorType, data->getSkColorSpace()));
+ parsedOptions.latestColorType, data->skColorSpace()));
} else {
m_image = StaticBitmapImage::create(skImage);
}
@@ -886,7 +886,7 @@ ImageBitmap::ImageBitmap(ImageData* data,
std::unique_ptr<ImageBuffer> buffer =
ImageBuffer::create(parsedOptions.cropRect.size(), NonOpaque,
- DoNotInitializeImagePixels, data->getSkColorSpace());
+ DoNotInitializeImagePixels, data->skColorSpace());
if (!buffer)
return;
@@ -914,7 +914,7 @@ ImageBitmap::ImageBitmap(ImageData* data,
if (parsedOptions.shouldScaleInput) {
sk_sp<SkSurface> surface = SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(
parsedOptions.resizeWidth, parsedOptions.resizeHeight,
- data->getSkColorSpace()));
+ data->skColorSpace()));
if (!surface)
return;
SkPaint paint;
@@ -924,8 +924,8 @@ ImageBitmap::ImageBitmap(ImageData* data,
surface->getCanvas()->drawImageRect(skImage, dstDrawRect, &paint);
skImage = surface->makeImageSnapshot();
}
- if (data->getSkColorSpace()) {
- parsedOptions.latestColorSpace = data->getSkColorSpace();
+ if (data->skColorSpace()) {
+ parsedOptions.latestColorSpace = data->skColorSpace();
applyColorSpaceConversion(skImage, parsedOptions);
}
m_image = StaticBitmapImage::create(std::move(skImage));
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698