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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 statusMessage.append("."); | 114 statusMessage.append("."); |
115 } | 115 } |
116 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, statusMessage)); | 116 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, statusMessage)); |
117 return nullptr; | 117 return nullptr; |
118 } | 118 } |
119 | 119 |
120 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g
et()); | 120 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g
et()); |
121 if (!extensionsUtil) | 121 if (!extensionsUtil) |
122 return nullptr; | 122 return nullptr; |
123 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) | 123 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { |
124 context->pushGroupMarkerEXT("WebGLRenderingContext"); | 124 String contextLabel(String::format("WebGLRenderingContext-%p", context.g
et())); |
| 125 context->pushGroupMarkerEXT(contextLabel.ascii().data()); |
| 126 } |
125 | 127 |
126 OwnPtrWillBeRawPtr<WebGLRenderingContext> renderingContext = adoptPtrWillBeN
oop(new WebGLRenderingContext(canvas, context.release(), attributes)); | 128 OwnPtrWillBeRawPtr<WebGLRenderingContext> renderingContext = adoptPtrWillBeN
oop(new WebGLRenderingContext(canvas, context.release(), attributes)); |
127 renderingContext->registerContextExtensions(); | 129 renderingContext->registerContextExtensions(); |
128 renderingContext->suspendIfNeeded(); | 130 renderingContext->suspendIfNeeded(); |
129 | 131 |
130 if (!renderingContext->drawingBuffer()) { | 132 if (!renderingContext->drawingBuffer()) { |
131 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "Could not create a WebGL context.")); | 133 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "Could not create a WebGL context.")); |
132 return nullptr; | 134 return nullptr; |
133 } | 135 } |
134 | 136 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 visitor->trace(m_webglDepthTexture); | 203 visitor->trace(m_webglDepthTexture); |
202 WebGLRenderingContextBase::trace(visitor); | 204 WebGLRenderingContextBase::trace(visitor); |
203 } | 205 } |
204 | 206 |
205 void WebGLRenderingContext::forceNextWebGLContextCreationToFail() | 207 void WebGLRenderingContext::forceNextWebGLContextCreationToFail() |
206 { | 208 { |
207 shouldFailContextCreationForTesting = true; | 209 shouldFailContextCreationForTesting = true; |
208 } | 210 } |
209 | 211 |
210 } // namespace blink | 212 } // namespace blink |
OLD | NEW |