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

Side by Side 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: minor corrections 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" 5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
6 6
7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h" 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/workers/WorkerGlobalScope.h" 10 #include "core/workers/WorkerGlobalScope.h"
11 #include "core/workers/WorkerSettings.h" 11 #include "core/workers/WorkerSettings.h"
12 #include "platform/graphics/ImageBuffer.h" 12 #include "platform/graphics/ImageBuffer.h"
13 #include "platform/graphics/StaticBitmapImage.h" 13 #include "platform/graphics/StaticBitmapImage.h"
14 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 14 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
15 #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h" 15 #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
16 #include "wtf/Assertions.h" 16 #include "wtf/Assertions.h"
17 17
18 #define UNIMPLEMENTED ASSERT_NOT_REACHED 18 #define UNIMPLEMENTED ASSERT_NOT_REACHED
19 19
20 namespace blink { 20 namespace blink {
21 21
22 OffscreenCanvasRenderingContext2D::~OffscreenCanvasRenderingContext2D() 22 OffscreenCanvasRenderingContext2D::~OffscreenCanvasRenderingContext2D()
23 { 23 {
24 } 24 }
25 25
26 OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(ScriptState * scriptState, OffscreenCanvas* canvas, const CanvasContextCreationAttributes& a ttrs) 26 OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(ScriptState * scriptState, OffscreenCanvas* canvas, const CanvasContextCreationAttributes& a ttrs)
27 : CanvasRenderingContext(nullptr, canvas) 27 : CanvasRenderingContext(nullptr, canvas, attrs.colorSpace())
28 , m_hasAlpha(attrs.alpha()) 28 , m_hasAlpha(attrs.alpha())
29 { 29 {
30 ExecutionContext* executionContext = scriptState->getExecutionContext(); 30 ExecutionContext* executionContext = scriptState->getExecutionContext();
31 if (executionContext->isDocument()) { 31 if (executionContext->isDocument()) {
32 if (toDocument(executionContext)->settings()->disableReadingFromCanvas() ) 32 if (toDocument(executionContext)->settings()->disableReadingFromCanvas() )
33 canvas->setDisableReadingFromCanvasTrue(); 33 canvas->setDisableReadingFromCanvasTrue();
34 return; 34 return;
35 } 35 }
36 36
37 WorkerSettings* workerSettings = toWorkerGlobalScope(executionContext)->work erSettings(); 37 WorkerSettings* workerSettings = toWorkerGlobalScope(executionContext)->work erSettings();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 #endif 190 #endif
191 } 191 }
192 192
193 bool OffscreenCanvasRenderingContext2D::isContextLost() const 193 bool OffscreenCanvasRenderingContext2D::isContextLost() const
194 { 194 {
195 return false; 195 return false;
196 } 196 }
197 197
198 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698