Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.cpp

Issue 1748163003: Add rendering context and rendering 2D context to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make OffscreenCanvasRenderingContext Modules exportable" Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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/layout/LayoutThemeAndroid.h" 5 #include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 PassRefPtr<LayoutTheme> LayoutThemeAndroid::create() 9 OffscreenCanvasRenderingContext::OffscreenCanvasRenderingContext(OffscreenCanvas * canvas)
10 { 10 : m_offscreenCanvas(canvas)
11 return adoptRef(new LayoutThemeAndroid());
12 }
13
14 LayoutTheme& LayoutTheme::nativeTheme()
15 {
16 DEFINE_STATIC_REF(LayoutTheme, layoutTheme, (LayoutThemeAndroid::create()));
17 return *layoutTheme;
18 }
19
20 LayoutThemeAndroid::~LayoutThemeAndroid()
21 { 11 {
22 } 12 }
23 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
24 } // namespace blink 30 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698