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

Unified Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp

Issue 1609763002: Implement ImageBitmap options premultiplyAlpha (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
index 2d6fa0db8f52f59d3de3caa0678281cbf38ffe4f..261a7c976b07ce316773402d0b0eea226927ec93 100644
--- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
+++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
@@ -68,6 +68,7 @@ static inline ImageBitmapSource* toImageBitmapSourceInternal(const ImageBitmapSo
ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, const ImageBitmapSourceUnion& bitmapSource, ExceptionState& exceptionState)
{
ImageBitmapOptions options;
+ options.setPremultiplyAlpha(true);
return createImageBitmap(scriptState, eventTarget, bitmapSource, options, exceptionState);
}
@@ -89,6 +90,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, const ImageBitmapSourceUnion& bitmapSource, int sx, int sy, int sw, int sh, ExceptionState& exceptionState)
{
ImageBitmapOptions options;
+ options.setPremultiplyAlpha(true);
return createImageBitmap(scriptState, eventTarget, bitmapSource, sx, sy, sw, sh, options, exceptionState);
}
@@ -157,8 +159,8 @@ ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader(ImageBitmapFactories&
, m_factory(&factory)
, m_resolver(ScriptPromiseResolver::create(scriptState))
, m_cropRect(cropRect)
- , m_options(options)
{
+ m_options.setPremultiplyAlpha(true);
}
void ImageBitmapFactories::ImageBitmapLoader::loadBlobAsync(ExecutionContext* context, Blob* blob)

Powered by Google App Engine
This is Rietveld 408576698