Chromium Code Reviews| 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 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1362 return; | 1362 return; |
| 1363 if (!data) | 1363 if (!data) |
| 1364 return; | 1364 return; |
| 1365 bufferSubDataImpl(target, offset, data->byteLength(), data->baseAddress()); | 1365 bufferSubDataImpl(target, offset, data->byteLength(), data->baseAddress()); |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target) | 1368 GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target) |
| 1369 { | 1369 { |
| 1370 if (isContextLost()) | 1370 if (isContextLost()) |
| 1371 return GL_FRAMEBUFFER_UNSUPPORTED; | 1371 return GL_FRAMEBUFFER_UNSUPPORTED; |
| 1372 if (target != GL_FRAMEBUFFER) { | 1372 if (!((isWebGL2OrHigher() && (target == GL_READ_FRAMEBUFFER || target == GL_ DRAW_FRAMEBUFFER)) || target == GL_FRAMEBUFFER)) { |
|
Ken Russell (switch to Gerrit)
2015/04/23 17:54:31
These nested expressions are unreadable. Please fa
yunchao
2015/04/24 07:07:34
Agree. It is much clear. In fact, I also thought a
| |
| 1373 synthesizeGLError(GL_INVALID_ENUM, "checkFramebufferStatus", "invalid ta rget"); | 1373 synthesizeGLError(GL_INVALID_ENUM, "checkFramebufferStatus", "invalid ta rget"); |
| 1374 return 0; | 1374 return 0; |
| 1375 } | 1375 } |
| 1376 if (!m_framebufferBinding || !m_framebufferBinding->object()) | 1376 if (!m_framebufferBinding || !m_framebufferBinding->object()) |
| 1377 return GL_FRAMEBUFFER_COMPLETE; | 1377 return GL_FRAMEBUFFER_COMPLETE; |
| 1378 const char* reason = "framebuffer incomplete"; | 1378 const char* reason = "framebuffer incomplete"; |
| 1379 GLenum result = m_framebufferBinding->checkStatus(&reason); | 1379 GLenum result = m_framebufferBinding->checkStatus(&reason); |
| 1380 if (result != GL_FRAMEBUFFER_COMPLETE) { | 1380 if (result != GL_FRAMEBUFFER_COMPLETE) { |
| 1381 emitGLWarning("checkFramebufferStatus", reason); | 1381 emitGLWarning("checkFramebufferStatus", reason); |
| 1382 return result; | 1382 return result; |
| (...skipping 3984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5367 | 5367 |
| 5368 void WebGLRenderingContextBase::printWarningToConsole(const String& message) | 5368 void WebGLRenderingContextBase::printWarningToConsole(const String& message) |
| 5369 { | 5369 { |
| 5370 if (!canvas()) | 5370 if (!canvas()) |
| 5371 return; | 5371 return; |
| 5372 canvas()->document().addConsoleMessage(ConsoleMessage::create(RenderingMessa geSource, WarningMessageLevel, message)); | 5372 canvas()->document().addConsoleMessage(ConsoleMessage::create(RenderingMessa geSource, WarningMessageLevel, message)); |
| 5373 } | 5373 } |
| 5374 | 5374 |
| 5375 bool WebGLRenderingContextBase::validateFramebufferFuncParameters(const char* fu nctionName, GLenum target, GLenum attachment) | 5375 bool WebGLRenderingContextBase::validateFramebufferFuncParameters(const char* fu nctionName, GLenum target, GLenum attachment) |
| 5376 { | 5376 { |
| 5377 if (target != GL_FRAMEBUFFER) { | 5377 if (!((isWebGL2OrHigher() && (target == GL_READ_FRAMEBUFFER || target == GL_ DRAW_FRAMEBUFFER)) || target == GL_FRAMEBUFFER)) { |
| 5378 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); | 5378 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); |
| 5379 return false; | 5379 return false; |
| 5380 } | 5380 } |
| 5381 switch (attachment) { | 5381 switch (attachment) { |
| 5382 case GL_COLOR_ATTACHMENT0: | 5382 case GL_COLOR_ATTACHMENT0: |
| 5383 case GL_DEPTH_ATTACHMENT: | 5383 case GL_DEPTH_ATTACHMENT: |
| 5384 case GL_STENCIL_ATTACHMENT: | 5384 case GL_STENCIL_ATTACHMENT: |
| 5385 case GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL: | 5385 case GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL: |
| 5386 break; | 5386 break; |
| 5387 default: | 5387 default: |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6093 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; | 6093 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; |
| 6094 } | 6094 } |
| 6095 #else | 6095 #else |
| 6096 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6096 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6097 { | 6097 { |
| 6098 return m_drawingBuffer.get(); | 6098 return m_drawingBuffer.get(); |
| 6099 } | 6099 } |
| 6100 #endif | 6100 #endif |
| 6101 | 6101 |
| 6102 } // namespace blink | 6102 } // namespace blink |
| OLD | NEW |