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

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

Issue 981913002: update getFramebufferAttachmentParameter for WebGL 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2280 case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 2280 case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
2281 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(obj ect)); 2281 return WebGLAny(scriptState, PassRefPtrWillBeRawPtr<WebGLObject>(obj ect));
2282 case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 2282 case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
2283 case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 2283 case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
2284 { 2284 {
2285 GLint value = 0; 2285 GLint value = 0;
2286 webContext()->getFramebufferAttachmentParameteriv(target, attach ment, pname, &value); 2286 webContext()->getFramebufferAttachmentParameteriv(target, attach ment, pname, &value);
2287 return WebGLAny(scriptState, value); 2287 return WebGLAny(scriptState, value);
2288 } 2288 }
2289 case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: 2289 case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:
2290 if (extensionEnabled(EXTsRGBName) || isWebGL2OrHigher()) { 2290 if (extensionEnabled(EXTsRGBName)) {
2291 GLint value = 0; 2291 GLint value = 0;
2292 webContext()->getFramebufferAttachmentParameteriv(target, attach ment, pname, &value); 2292 webContext()->getFramebufferAttachmentParameteriv(target, attach ment, pname, &value);
2293 return WebGLAny(scriptState, value); 2293 return WebGLAny(scriptState, static_cast<unsigned>(value));
2294 } 2294 }
2295 synthesizeGLError(GL_INVALID_ENUM, "getFramebufferAttachmentParamete r", "invalid parameter name for renderbuffer attachment"); 2295 synthesizeGLError(GL_INVALID_ENUM, "getFramebufferAttachmentParamete r", "invalid parameter name for renderbuffer attachment");
2296 return ScriptValue::createNull(scriptState); 2296 return ScriptValue::createNull(scriptState);
2297 default: 2297 default:
2298 synthesizeGLError(GL_INVALID_ENUM, "getFramebufferAttachmentParamete r", "invalid parameter name for texture attachment"); 2298 synthesizeGLError(GL_INVALID_ENUM, "getFramebufferAttachmentParamete r", "invalid parameter name for texture attachment");
2299 return ScriptValue::createNull(scriptState); 2299 return ScriptValue::createNull(scriptState);
2300 } 2300 }
2301 } else { 2301 } else {
2302 switch (pname) { 2302 switch (pname) {
2303 case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 2303 case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
(...skipping 3711 matching lines...) Expand 10 before | Expand all | Expand 10 after
6015 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 6015 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
6016 } 6016 }
6017 #else 6017 #else
6018 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6018 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6019 { 6019 {
6020 return m_drawingBuffer.get(); 6020 return m_drawingBuffer.get();
6021 } 6021 }
6022 #endif 6022 #endif
6023 6023
6024 } // namespace blink 6024 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698