| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return; | 93 return; |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 scoped.context()->m_framebufferBinding->drawBuffers(buffers); | 96 scoped.context()->m_framebufferBinding->drawBuffers(buffers); |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 // static | 100 // static |
| 101 bool WebGLDrawBuffers::satisfiesWebGLRequirements(WebGLRenderingContextBase* web
glContext) | 101 bool WebGLDrawBuffers::satisfiesWebGLRequirements(WebGLRenderingContextBase* web
glContext) |
| 102 { | 102 { |
| 103 blink::WebGraphicsContext3D* context = webglContext->webContext(); | 103 WebGraphicsContext3D* context = webglContext->webContext(); |
| 104 Extensions3DUtil* extensionsUtil = webglContext->extensionsUtil(); | 104 Extensions3DUtil* extensionsUtil = webglContext->extensionsUtil(); |
| 105 | 105 |
| 106 // This is called after we make sure GL_EXT_draw_buffers is supported. | 106 // This is called after we make sure GL_EXT_draw_buffers is supported. |
| 107 GLint maxDrawBuffers = 0; | 107 GLint maxDrawBuffers = 0; |
| 108 GLint maxColorAttachments = 0; | 108 GLint maxColorAttachments = 0; |
| 109 context->getIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &maxDrawBuffers); | 109 context->getIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &maxDrawBuffers); |
| 110 context->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &maxColorAttachments); | 110 context->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &maxColorAttachments); |
| 111 if (maxDrawBuffers < 4 || maxColorAttachments < 4) | 111 if (maxDrawBuffers < 4 || maxColorAttachments < 4) |
| 112 return false; | 112 return false; |
| 113 | 113 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 if (supportsDepth) | 172 if (supportsDepth) |
| 173 context->deleteTexture(depth); | 173 context->deleteTexture(depth); |
| 174 if (supportsDepthStencil) | 174 if (supportsDepthStencil) |
| 175 context->deleteTexture(depthStencil); | 175 context->deleteTexture(depthStencil); |
| 176 for (size_t i = 0; i < colors.size(); ++i) | 176 for (size_t i = 0; i < colors.size(); ++i) |
| 177 context->deleteTexture(colors[i]); | 177 context->deleteTexture(colors[i]); |
| 178 return ok; | 178 return ok; |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |