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

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp

Issue 1881563003: Implement OffscreenCanvas.getContext('webgl') (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and remove static_cast Created 4 years, 7 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #include "core/html/canvas/CanvasRenderingContext.h" 26 #include "core/html/canvas/CanvasRenderingContext.h"
27 27
28 #include "core/html/canvas/CanvasImageSource.h" 28 #include "core/html/canvas/CanvasImageSource.h"
29 #include "platform/RuntimeEnabledFeatures.h" 29 #include "platform/RuntimeEnabledFeatures.h"
30 #include "platform/weborigin/SecurityOrigin.h" 30 #include "platform/weborigin/SecurityOrigin.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas) 34 CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas, Offscr eenCanvas* offscreenCanvas)
35 : m_canvas(canvas) 35 : m_canvas(canvas)
36 , m_offscreenCanvas(offscreenCanvas)
36 { 37 {
37 } 38 }
38 39
39 CanvasRenderingContext::CanvasRenderingContext(OffscreenCanvas* canvas)
40 : m_offscreenCanvas(canvas)
41 {
42 }
43
44 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId(co nst String& id) 40 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId(co nst String& id)
45 { 41 {
46 if (id == "2d") 42 if (id == "2d")
47 return Context2d; 43 return Context2d;
48 if (id == "experimental-webgl") 44 if (id == "experimental-webgl")
49 return ContextExperimentalWebgl; 45 return ContextExperimentalWebgl;
50 if (id == "webgl") 46 if (id == "webgl")
51 return ContextWebgl; 47 return ContextWebgl;
52 if (id == "webgl2") 48 if (id == "webgl2")
53 return ContextWebgl2; 49 return ContextWebgl2;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return taintOrigin; 83 return taintOrigin;
88 } 84 }
89 85
90 DEFINE_TRACE(CanvasRenderingContext) 86 DEFINE_TRACE(CanvasRenderingContext)
91 { 87 {
92 visitor->trace(m_canvas); 88 visitor->trace(m_canvas);
93 visitor->trace(m_offscreenCanvas); 89 visitor->trace(m_offscreenCanvas);
94 } 90 }
95 91
96 } // namespace blink 92 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698