Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.cpp |
| diff --git a/third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.cpp b/third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0a356370b804cbd58eea594d6463ebdae5303ed2 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.cpp |
| @@ -0,0 +1,33 @@ |
| +// Copyright 201666666 The Chromium Authors. All rights reserved. |
|
Justin Novosad
2016/03/02 15:41:50
You fell asleep on the keyboard? Stop working so h
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/html/canvas/OffscreenCanvasRenderingContext.h" |
| + |
| +namespace blink { |
| + |
| +OffscreenCanvasRenderingContext::OffscreenCanvasRenderingContext(OffscreenCanvas* canvas) |
| + : m_offscreenCanvas(canvas) |
| + , m_contextType(ContextTypeCount) |
| +{ |
| +} |
| + |
| +OffscreenCanvasRenderingContext::ContextType OffscreenCanvasRenderingContext::contextTypeFromId(const String& id) |
| +{ |
| + if (id == "2d") |
| + return Context2d; |
| + if (id == "webgl") |
| + return ContextWebgl; |
| + if (id == "webgl2") |
| + return ContextWebgl2; |
| + if (id == "imagebitmap") |
| + return ContextImageBitmap; |
| + return ContextTypeCount; |
| +} |
| + |
| +DEFINE_TRACE(OffscreenCanvasRenderingContext) |
| +{ |
| + visitor->trace(m_offscreenCanvas); |
| +} |
| + |
| +} // namespace blink |