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

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

Issue 2825183002: Plumb CanvasColorParams to canvas image classes (Closed)
Patch Set: 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/html/HTMLCanvasElement.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 74e0cefdb8c8c8bfb85ccbcd086c6a89733e8317..2d4a7656047d0c8b7cd3c8c7448afd25c76bb6dc 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -896,9 +896,15 @@ ImageBitmap::ImageBitmap(ImageData* data,
return;
}
- std::unique_ptr<ImageBuffer> buffer =
- ImageBuffer::Create(parsed_options.crop_rect.Size(), kNonOpaque,
- kDoNotInitializeImagePixels, data->GetSkColorSpace());
+ // TODO(ccameron): Retrieve full CanvasColorParams from ImageData.
ccameron 2017/04/18 21:23:50 I suspect we should make some changes to ImageData
+ ImageDataColorSettings color_settings;
+ data->getColorSettings(color_settings);
+ CanvasColorSpace canvas_color_space =
+ ImageData::GetCanvasColorSpace(color_settings.colorSpace());
+ CanvasPixelFormat canvas_pixel_format = kRGBA8CanvasPixelFormat;
zakerinasab 2017/04/18 21:46:58 I think we need to set the canvas pixel format for
ccameron 2017/04/18 22:10:45 Good point -- done.
+ std::unique_ptr<ImageBuffer> buffer = ImageBuffer::Create(
+ parsed_options.crop_rect.Size(), kNonOpaque, kDoNotInitializeImagePixels,
+ CanvasColorParams(canvas_color_space, canvas_pixel_format));
if (!buffer)
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698