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

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

Issue 223223003: Re-land "WebGL: Transfer ownership of WebGraphicsContext3D to DrawingBuffer" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix errata on comment Created 6 years, 8 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderbuffer.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698