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

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

Issue 163773007: WebGL: Transfer ownership of WebGraphicsContext3D from WebGLRenderingContext to DrawingBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@correct_webgl_destroy
Patch Set: Rebase to upstream Created 6 years, 9 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
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698