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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 { | 80 { |
81 ASSERT(type < CanvasRenderingContext::ContextTypeCount); | 81 ASSERT(type < CanvasRenderingContext::ContextTypeCount); |
82 return renderingContextFactories()[type].get(); | 82 return renderingContextFactories()[type].get(); |
83 } | 83 } |
84 | 84 |
85 void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<CanvasRendering
ContextFactory> renderingContextFactory) | 85 void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<CanvasRendering
ContextFactory> renderingContextFactory) |
86 { | 86 { |
87 CanvasRenderingContext::ContextType type = renderingContextFactory->getConte
xtType(); | 87 CanvasRenderingContext::ContextType type = renderingContextFactory->getConte
xtType(); |
88 ASSERT(type < CanvasRenderingContext::ContextTypeCount); | 88 ASSERT(type < CanvasRenderingContext::ContextTypeCount); |
89 ASSERT(!renderingContextFactories()[type]); | 89 ASSERT(!renderingContextFactories()[type]); |
90 renderingContextFactories()[type] = renderingContextFactory; | 90 renderingContextFactories()[type] = std::move(renderingContextFactory); |
91 } | 91 } |
92 | 92 |
93 DEFINE_TRACE(OffscreenCanvas) | 93 DEFINE_TRACE(OffscreenCanvas) |
94 { | 94 { |
95 visitor->trace(m_context); | 95 visitor->trace(m_context); |
96 visitor->trace(m_canvas); | 96 visitor->trace(m_canvas); |
97 } | 97 } |
98 | 98 |
99 } // namespace blink | 99 } // namespace blink |
OLD | NEW |