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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

Issue 179973004: Share Group plumbing in Blink; Remove WebGL from default share group (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed nullptr to 0 Created 6 years, 10 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 | Annotate | Revision Log
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Web page was not allowed to create a WebGL cont ext.")); 72 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Web page was not allowed to create a WebGL cont ext."));
73 return nullptr; 73 return nullptr;
74 } 74 }
75 75
76 // The only situation that attrs is null is through Document::getCSSCanvasCo ntext(). 76 // The only situation that attrs is null is through Document::getCSSCanvasCo ntext().
77 RefPtr<WebGLContextAttributes> defaultAttrs; 77 RefPtr<WebGLContextAttributes> defaultAttrs;
78 if (!attrs) { 78 if (!attrs) {
79 defaultAttrs = WebGLContextAttributes::create(); 79 defaultAttrs = WebGLContextAttributes::create();
80 attrs = defaultAttrs.get(); 80 attrs = defaultAttrs.get();
81 } 81 }
82
82 blink::WebGraphicsContext3D::Attributes attributes = attrs->attributes(docum ent.topDocument()->url().string(), settings); 83 blink::WebGraphicsContext3D::Attributes attributes = attrs->attributes(docum ent.topDocument()->url().string(), settings);
83 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes)); 84 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0));
84 if (!context || !context->makeContextCurrent()) { 85 if (!context || !context->makeContextCurrent()) {
85 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Could not create a WebGL context.")); 86 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Could not create a WebGL context."));
86 return nullptr; 87 return nullptr;
87 } 88 }
88 89
89 Extensions3DUtil extensionsUtil(context.get()); 90 Extensions3DUtil extensionsUtil(context.get());
90 if (extensionsUtil.supportsExtension("GL_EXT_debug_marker")) 91 if (extensionsUtil.supportsExtension("GL_EXT_debug_marker"))
91 context->pushGroupMarkerEXT("WebGLRenderingContext"); 92 context->pushGroupMarkerEXT("WebGLRenderingContext");
92 93
93 OwnPtr<WebGLRenderingContext> renderingContext = adoptPtr(new WebGLRendering Context(canvas, context.release(), attrs)); 94 OwnPtr<WebGLRenderingContext> renderingContext = adoptPtr(new WebGLRendering Context(canvas, context.release(), attrs));
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 138
138 // Register draft extensions. 139 // Register draft extensions.
139 registerExtension<EXTFragDepth>(m_extFragDepth, DraftExtension); 140 registerExtension<EXTFragDepth>(m_extFragDepth, DraftExtension);
140 141
141 // Register privileged extensions. 142 // Register privileged extensions.
142 registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo, WebGLDeb ugRendererInfoExtension); 143 registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo, WebGLDeb ugRendererInfoExtension);
143 registerExtension<WebGLDebugShaders>(m_webglDebugShaders, PrivilegedExtensio n); 144 registerExtension<WebGLDebugShaders>(m_webglDebugShaders, PrivilegedExtensio n);
144 } 145 }
145 146
146 } // namespace WebCore 147 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698