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

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

Issue 928233002: IDL: Don't lose nullable flag when "preprocessing" type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix compilation Created 5 years, 10 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 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 bool WebGLRenderingContextBase::extensionSupportedAndAllowed(const ExtensionTrac ker* tracker) 2245 bool WebGLRenderingContextBase::extensionSupportedAndAllowed(const ExtensionTrac ker* tracker)
2246 { 2246 {
2247 if (tracker->draft() && !RuntimeEnabledFeatures::webGLDraftExtensionsEnabled ()) 2247 if (tracker->draft() && !RuntimeEnabledFeatures::webGLDraftExtensionsEnabled ())
2248 return false; 2248 return false;
2249 if (!tracker->supported(this)) 2249 if (!tracker->supported(this))
2250 return false; 2250 return false;
2251 return true; 2251 return true;
2252 } 2252 }
2253 2253
2254 2254
2255 PassRefPtrWillBeRawPtr<WebGLExtension> WebGLRenderingContextBase::getExtension(c onst String& name) 2255 ScriptValue WebGLRenderingContextBase::getExtension(ScriptState* scriptState, co nst String& name)
2256 { 2256 {
2257 if (isContextLost()) 2257 RefPtrWillBeRawPtr<WebGLExtension> extension;
2258 return nullptr;
2259 2258
2260 for (size_t i = 0; i < m_extensions.size(); ++i) { 2259 if (!isContextLost()) {
2261 ExtensionTracker* tracker = m_extensions[i].get(); 2260 for (size_t i = 0; i < m_extensions.size(); ++i) {
2262 if (tracker->matchesNameWithPrefixes(name)) { 2261 ExtensionTracker* tracker = m_extensions[i].get();
2263 if (!extensionSupportedAndAllowed(tracker)) 2262 if (tracker->matchesNameWithPrefixes(name)) {
2264 return nullptr; 2263 if (extensionSupportedAndAllowed(tracker)) {
2265 2264 extension = tracker->getExtension(this);
2266 RefPtrWillBeRawPtr<WebGLExtension> extension = tracker->getExtension (this); 2265 if (extension)
2267 if (extension) 2266 m_extensionEnabled[extension->name()] = true;
2268 m_extensionEnabled[extension->name()] = true; 2267 }
2269 return extension.release(); 2268 break;
2269 }
2270 } 2270 }
2271 } 2271 }
2272 2272
2273 return nullptr; 2273 return ScriptValue(scriptState, toV8(extension, scriptState->context()->Glob al(), scriptState->isolate()));
2274 } 2274 }
2275 2275
2276 ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter(ScriptS tate* scriptState, GLenum target, GLenum attachment, GLenum pname) 2276 ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter(ScriptS tate* scriptState, GLenum target, GLenum attachment, GLenum pname)
2277 { 2277 {
2278 if (isContextLost() || !validateFramebufferFuncParameters("getFramebufferAtt achmentParameter", target, attachment)) 2278 if (isContextLost() || !validateFramebufferFuncParameters("getFramebufferAtt achmentParameter", target, attachment))
2279 return ScriptValue::createNull(scriptState); 2279 return ScriptValue::createNull(scriptState);
2280 2280
2281 if (!m_framebufferBinding || !m_framebufferBinding->object()) { 2281 if (!m_framebufferBinding || !m_framebufferBinding->object()) {
2282 synthesizeGLError(GL_INVALID_OPERATION, "getFramebufferAttachmentParamet er", "no framebuffer bound"); 2282 synthesizeGLError(GL_INVALID_OPERATION, "getFramebufferAttachmentParamet er", "no framebuffer bound");
2283 return ScriptValue::createNull(scriptState); 2283 return ScriptValue::createNull(scriptState);
(...skipping 3753 matching lines...) Expand 10 before | Expand all | Expand 10 after
6037 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 6037 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
6038 } 6038 }
6039 #else 6039 #else
6040 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6040 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6041 { 6041 {
6042 return m_drawingBuffer.get(); 6042 return m_drawingBuffer.get();
6043 } 6043 }
6044 #endif 6044 #endif
6045 6045
6046 } // namespace blink 6046 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698