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