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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.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/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
index 65f3f5bb41907120e921840bbce2dae8adacd2a1..202212cc1ffdb1fc6624314e2f76e6b1c5b9c310 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -24,8 +24,7 @@ OffscreenCanvasRenderingContext2D::~OffscreenCanvasRenderingContext2D()
}
OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(ScriptState* scriptState, OffscreenCanvas* canvas, const CanvasContextCreationAttributes& attrs)
- : CanvasRenderingContext(nullptr, canvas)
- , m_hasAlpha(attrs.alpha())
+ : CanvasRenderingContext(nullptr, canvas, attrs)
{
ExecutionContext* executionContext = scriptState->getExecutionContext();
if (executionContext->isDocument()) {
@@ -93,7 +92,7 @@ ImageBuffer* OffscreenCanvasRenderingContext2D::imageBuffer() const
{
if (!m_imageBuffer) {
IntSize surfaceSize(width(), height());
- OpacityMode opacityMode = m_hasAlpha ? NonOpaque : Opaque;
+ OpacityMode opacityMode = hasAlpha() ? NonOpaque : Opaque;
std::unique_ptr<ImageBufferSurface> surface;
if (shouldAccelerate(surfaceSize)) {
surface.reset(new AcceleratedImageBufferSurface(surfaceSize, opacityMode));

Powered by Google App Engine
This is Rietveld 408576698