| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "core/html/canvas/OffscreenCanvas.h" | |
| 6 | |
| 7 #include "wtf/MathExtras.h" | |
| 8 | |
| 9 namespace blink { | |
| 10 | |
| 11 OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height) | |
| 12 { | |
| 13 return new OffscreenCanvas(IntSize(clampTo<int>(width), clampTo<int>(height)
)); | |
| 14 } | |
| 15 | |
| 16 void OffscreenCanvas::setWidth(unsigned width) | |
| 17 { | |
| 18 m_size.setWidth(clampTo<int>(width)); | |
| 19 } | |
| 20 | |
| 21 void OffscreenCanvas::setHeight(unsigned height) | |
| 22 { | |
| 23 m_size.setHeight(clampTo<int>(height)); | |
| 24 } | |
| 25 | |
| 26 OffscreenCanvas::OffscreenCanvas(const IntSize& size) | |
| 27 : m_size(size) | |
| 28 { | |
| 29 } | |
| 30 | |
| 31 DEFINE_TRACE(OffscreenCanvas) | |
| 32 { | |
| 33 } | |
| 34 | |
| 35 } // namespace blink | |
| OLD | NEW |