OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 Extensions3DUtil extensionsUtil(context.get()); | 89 Extensions3DUtil extensionsUtil(context.get()); |
90 if (extensionsUtil.supportsExtension("GL_EXT_debug_marker")) | 90 if (extensionsUtil.supportsExtension("GL_EXT_debug_marker")) |
91 context->pushGroupMarkerEXT("WebGLRenderingContext"); | 91 context->pushGroupMarkerEXT("WebGLRenderingContext"); |
92 | 92 |
93 OwnPtr<WebGLRenderingContext> renderingContext = adoptPtr(new WebGLRendering
Context(canvas, context.release(), attrs)); | 93 OwnPtr<WebGLRenderingContext> renderingContext = adoptPtr(new WebGLRendering
Context(canvas, context.release(), attrs)); |
94 renderingContext->registerContextExtensions(); | 94 renderingContext->registerContextExtensions(); |
95 renderingContext->suspendIfNeeded(); | 95 renderingContext->suspendIfNeeded(); |
96 | 96 |
97 if (renderingContext->m_drawingBuffer->isZeroSized()) { | 97 if (!renderingContext->m_drawingBuffer) { |
98 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "Could not create a WebGL context.")); | 98 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "Could not create a WebGL context.")); |
99 return nullptr; | 99 return nullptr; |
100 } | 100 } |
101 | 101 |
102 return renderingContext.release(); | 102 return renderingContext.release(); |
103 } | 103 } |
104 | 104 |
105 WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, Pa
ssOwnPtr<blink::WebGraphicsContext3D> context, WebGLContextAttributes* requested
Attributes) | 105 WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, Pa
ssOwnPtr<blink::WebGraphicsContext3D> context, WebGLContextAttributes* requested
Attributes) |
106 : WebGLRenderingContextBase(passedCanvas, context, requestedAttributes) | 106 : WebGLRenderingContextBase(passedCanvas, context, requestedAttributes) |
107 { | 107 { |
(...skipping 29 matching lines...) Expand all Loading... |
137 | 137 |
138 // Register draft extensions. | 138 // Register draft extensions. |
139 registerExtension<EXTFragDepth>(m_extFragDepth, DraftExtension); | 139 registerExtension<EXTFragDepth>(m_extFragDepth, DraftExtension); |
140 | 140 |
141 // Register privileged extensions. | 141 // Register privileged extensions. |
142 registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo, WebGLDeb
ugRendererInfoExtension); | 142 registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo, WebGLDeb
ugRendererInfoExtension); |
143 registerExtension<WebGLDebugShaders>(m_webglDebugShaders, PrivilegedExtensio
n); | 143 registerExtension<WebGLDebugShaders>(m_webglDebugShaders, PrivilegedExtensio
n); |
144 } | 144 } |
145 | 145 |
146 } // namespace WebCore | 146 } // namespace WebCore |
OLD | NEW |