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 67 matching lines...) Loading... | |
78 return nullptr; | 78 return nullptr; |
79 } | 79 } |
80 | 80 |
81 // The only situation that attrs is null is through Document::getCSSCanvasCo ntext(). | 81 // The only situation that attrs is null is through Document::getCSSCanvasCo ntext(). |
82 RefPtrWillBeRawPtr<WebGLContextAttributes> defaultAttrs = nullptr; | 82 RefPtrWillBeRawPtr<WebGLContextAttributes> defaultAttrs = nullptr; |
83 if (!attrs) { | 83 if (!attrs) { |
84 defaultAttrs = WebGLContextAttributes::create(); | 84 defaultAttrs = WebGLContextAttributes::create(); |
85 attrs = defaultAttrs.get(); | 85 attrs = defaultAttrs.get(); |
86 } | 86 } |
87 blink::WebGraphicsContext3D::Attributes attributes = attrs->attributes(docum ent.topDocument().url().string(), settings, 1); | 87 blink::WebGraphicsContext3D::Attributes attributes = attrs->attributes(docum ent.topDocument().url().string(), settings, 1); |
88 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0)); | 88 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0)); |
dshwang
2014/08/16 15:21:27
chromium doesn't do initial bind unlike createShar
| |
89 if (!context || !context->makeContextCurrent()) { | 89 if (!context) { |
90 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Could not create a WebGL context.")); | 90 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon textcreationerror, false, true, "Could not create a WebGL context.")); |
91 return nullptr; | 91 return nullptr; |
92 } | 92 } |
93 | 93 |
94 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g et()); | 94 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g et()); |
95 if (!extensionsUtil) | 95 if (!extensionsUtil) |
96 return nullptr; | 96 return nullptr; |
97 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) | 97 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) |
98 context->pushGroupMarkerEXT("WebGLRenderingContext"); | 98 context->pushGroupMarkerEXT("WebGLRenderingContext"); |
99 | 99 |
(...skipping 67 matching lines...) Loading... | |
167 visitor->trace(m_webglDrawBuffers); | 167 visitor->trace(m_webglDrawBuffers); |
168 visitor->trace(m_webglCompressedTextureATC); | 168 visitor->trace(m_webglCompressedTextureATC); |
169 visitor->trace(m_webglCompressedTextureETC1); | 169 visitor->trace(m_webglCompressedTextureETC1); |
170 visitor->trace(m_webglCompressedTexturePVRTC); | 170 visitor->trace(m_webglCompressedTexturePVRTC); |
171 visitor->trace(m_webglCompressedTextureS3TC); | 171 visitor->trace(m_webglCompressedTextureS3TC); |
172 visitor->trace(m_webglDepthTexture); | 172 visitor->trace(m_webglDepthTexture); |
173 WebGLRenderingContextBase::trace(visitor); | 173 WebGLRenderingContextBase::trace(visitor); |
174 } | 174 } |
175 | 175 |
176 } // namespace blink | 176 } // namespace blink |
OLD | NEW |