| 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" |
| 11 #include "wtf/MathExtras.h" | 11 #include "wtf/MathExtras.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 OffscreenCanvas::OffscreenCanvas(const IntSize& size) | 15 OffscreenCanvas::OffscreenCanvas(const IntSize& size) |
| 16 : m_size(size) | 16 : m_size(size) |
| 17 { } | 17 { |
| 18 | 18 } |
| 19 OffscreenCanvas::~OffscreenCanvas() | |
| 20 { } | |
| 21 | 19 |
| 22 OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height) | 20 OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height) |
| 23 { | 21 { |
| 24 return new OffscreenCanvas(IntSize(clampTo<int>(width), clampTo<int>(height)
)); | 22 return new OffscreenCanvas(IntSize(clampTo<int>(width), clampTo<int>(height)
)); |
| 25 } | 23 } |
| 26 | 24 |
| 27 void OffscreenCanvas::setWidth(unsigned width) | 25 void OffscreenCanvas::setWidth(unsigned width) |
| 28 { | 26 { |
| 29 m_size.setWidth(clampTo<int>(width)); | 27 m_size.setWidth(clampTo<int>(width)); |
| 30 } | 28 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 renderingContextFactories()[type] = renderingContextFactory; | 90 renderingContextFactories()[type] = renderingContextFactory; |
| 93 } | 91 } |
| 94 | 92 |
| 95 DEFINE_TRACE(OffscreenCanvas) | 93 DEFINE_TRACE(OffscreenCanvas) |
| 96 { | 94 { |
| 97 visitor->trace(m_context); | 95 visitor->trace(m_context); |
| 98 visitor->trace(m_canvas); | 96 visitor->trace(m_canvas); |
| 99 } | 97 } |
| 100 | 98 |
| 101 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |