OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 "modules/offscreencanvas/OffscreenCanvasRenderingContext.h" |
| 6 |
| 7 namespace blink { |
| 8 |
| 9 OffscreenCanvasRenderingContext::OffscreenCanvasRenderingContext(OffscreenCanvas
* canvas) |
| 10 : m_offscreenCanvas(canvas) |
| 11 { |
| 12 } |
| 13 |
| 14 OffscreenCanvasRenderingContext::ContextType OffscreenCanvasRenderingContext::co
ntextTypeFromId(const String& id) |
| 15 { |
| 16 if (id == "2d") |
| 17 return Context2d; |
| 18 if (id == "webgl") |
| 19 return ContextWebgl; |
| 20 if (id == "webgl2") |
| 21 return ContextWebgl2; |
| 22 return ContextTypeCount; |
| 23 } |
| 24 |
| 25 DEFINE_TRACE(OffscreenCanvasRenderingContext) |
| 26 { |
| 27 visitor->trace(m_offscreenCanvas); |
| 28 } |
| 29 |
| 30 } // namespace blink |
OLD | NEW |