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

Unified Diff: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp

Issue 2212163002: Add some plumbing for the color management of canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 4 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/modules/imagebitmap/ImageBitmapRenderingContext.cpp
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
index 20b6491e85010f2bf0c79c649415f7e6e0351a80..8cb74652cdba6392f6e968cded2af9bb19fd97d7 100644
--- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
+++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
@@ -13,9 +13,8 @@
namespace blink {
-ImageBitmapRenderingContext::ImageBitmapRenderingContext(HTMLCanvasElement* canvas, CanvasContextCreationAttributes attrs, Document& document)
- : CanvasRenderingContext(canvas)
- , m_hasAlpha(attrs.alpha())
+ImageBitmapRenderingContext::ImageBitmapRenderingContext(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document& document)
+ : CanvasRenderingContext(canvas, nullptr, attrs)
{ }
ImageBitmapRenderingContext::~ImageBitmapRenderingContext() { }
@@ -53,7 +52,7 @@ bool ImageBitmapRenderingContext::paint(GraphicsContext& gc, const IntRect& r)
// With impl-side painting, it is unsafe to use a gpu-backed SkImage
ASSERT(!m_image->imageForCurrentFrame()->isTextureBacked());
- gc.drawImage(m_image.get(), r, nullptr, m_hasAlpha ? SkXfermode::kSrcOver_Mode : SkXfermode::kSrc_Mode);
+ gc.drawImage(m_image.get(), r, nullptr, creationAttributes().alpha() ? SkXfermode::kSrcOver_Mode : SkXfermode::kSrc_Mode);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698