| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 { | 92 { |
| 93 ASSERT(type < CanvasRenderingContext::ContextTypeCount); | 93 ASSERT(type < CanvasRenderingContext::ContextTypeCount); |
| 94 return renderingContextFactories()[type].get(); | 94 return renderingContextFactories()[type].get(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<CanvasRendering
ContextFactory> renderingContextFactory) | 97 void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<CanvasRendering
ContextFactory> renderingContextFactory) |
| 98 { | 98 { |
| 99 CanvasRenderingContext::ContextType type = renderingContextFactory->getConte
xtType(); | 99 CanvasRenderingContext::ContextType type = renderingContextFactory->getConte
xtType(); |
| 100 ASSERT(type < CanvasRenderingContext::ContextTypeCount); | 100 ASSERT(type < CanvasRenderingContext::ContextTypeCount); |
| 101 ASSERT(!renderingContextFactories()[type]); | 101 ASSERT(!renderingContextFactories()[type]); |
| 102 renderingContextFactories()[type] = renderingContextFactory; | 102 renderingContextFactories()[type] = std::move(renderingContextFactory); |
| 103 } | 103 } |
| 104 | 104 |
| 105 DEFINE_TRACE(OffscreenCanvas) | 105 DEFINE_TRACE(OffscreenCanvas) |
| 106 { | 106 { |
| 107 visitor->trace(m_context); | 107 visitor->trace(m_context); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |