OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/offscreencanvas/OffscreenCanvas.h" | 5 #include "core/offscreencanvas/OffscreenCanvas.h" |
6 | 6 |
7 #include "core/dom/ExceptionCode.h" | 7 #include "core/dom/ExceptionCode.h" |
8 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 8 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
9 #include "core/html/canvas/CanvasRenderingContext.h" | 9 #include "core/html/canvas/CanvasRenderingContext.h" |
10 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 10 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void OffscreenCanvas::registerRenderingContextFactory(std::unique_ptr<CanvasRend
eringContextFactory> renderingContextFactory) | 99 void OffscreenCanvas::registerRenderingContextFactory(std::unique_ptr<CanvasRend
eringContextFactory> renderingContextFactory) |
100 { | 100 { |
101 CanvasRenderingContext::ContextType type = renderingContextFactory->getConte
xtType(); | 101 CanvasRenderingContext::ContextType type = renderingContextFactory->getConte
xtType(); |
102 ASSERT(type < CanvasRenderingContext::ContextTypeCount); | 102 ASSERT(type < CanvasRenderingContext::ContextTypeCount); |
103 ASSERT(!renderingContextFactories()[type]); | 103 ASSERT(!renderingContextFactories()[type]); |
104 renderingContextFactories()[type] = std::move(renderingContextFactory); | 104 renderingContextFactories()[type] = std::move(renderingContextFactory); |
105 } | 105 } |
106 | 106 |
107 bool OffscreenCanvas::originClean() const | 107 bool OffscreenCanvas::originClean() const |
108 { | 108 { |
109 // TODO(crbug.com/607575): Make Settings accessable in worker and use | 109 return m_originClean && !m_disableReadingFromCanvas; |
110 // disableReadingFromCanvas to determine originClean value. | |
111 return m_originClean; | |
112 } | 110 } |
113 | 111 |
114 DEFINE_TRACE(OffscreenCanvas) | 112 DEFINE_TRACE(OffscreenCanvas) |
115 { | 113 { |
116 visitor->trace(m_context); | 114 visitor->trace(m_context); |
117 } | 115 } |
118 | 116 |
119 } // namespace blink | 117 } // namespace blink |
OLD | NEW |