Chromium Code Reviews| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 scoped.context()->m_framebufferBinding->drawBuffers(buffers); | 95 scoped.context()->m_framebufferBinding->drawBuffers(buffers); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 // static | 99 // static |
| 100 bool WebGLDrawBuffers::satisfiesWebGLRequirements( | 100 bool WebGLDrawBuffers::satisfiesWebGLRequirements( |
| 101 WebGLRenderingContextBase* webglContext) { | 101 WebGLRenderingContextBase* webglContext) { |
| 102 gpu::gles2::GLES2Interface* gl = webglContext->contextGL(); | 102 gpu::gles2::GLES2Interface* gl = webglContext->contextGL(); |
| 103 Extensions3DUtil* extensionsUtil = webglContext->extensionsUtil(); | 103 Extensions3DUtil* extensionsUtil = webglContext->extensionsUtil(); |
| 104 | 104 |
| 105 if (!extensionsUtil->isExtensionEnabled("GL_EXT_draw_buffers")) { | |
| 106 // Extension can be enabled but is not yet so we trust that the command | |
| 107 // decoder has full support | |
| 108 return true; | |
|
Zhenyao Mo
2017/02/06 22:31:38
So when we actually try to enable this extension,
Geoff Lang
2017/02/07 19:01:15
The comment below says that we can only get here i
| |
| 109 } | |
| 110 | |
| 105 // This is called after we make sure GL_EXT_draw_buffers is supported. | 111 // This is called after we make sure GL_EXT_draw_buffers is supported. |
| 106 GLint maxDrawBuffers = 0; | 112 GLint maxDrawBuffers = 0; |
| 107 GLint maxColorAttachments = 0; | 113 GLint maxColorAttachments = 0; |
| 108 gl->GetIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &maxDrawBuffers); | 114 gl->GetIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &maxDrawBuffers); |
| 109 gl->GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &maxColorAttachments); | 115 gl->GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &maxColorAttachments); |
| 110 if (maxDrawBuffers < 4 || maxColorAttachments < 4) | 116 if (maxDrawBuffers < 4 || maxColorAttachments < 4) |
| 111 return false; | 117 return false; |
| 112 | 118 |
| 113 GLuint fbo; | 119 GLuint fbo; |
| 114 gl->GenFramebuffers(1, &fbo); | 120 gl->GenFramebuffers(1, &fbo); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 if (supportsDepth) | 193 if (supportsDepth) |
| 188 gl->DeleteTextures(1, &depth); | 194 gl->DeleteTextures(1, &depth); |
| 189 if (supportsDepthStencil) | 195 if (supportsDepthStencil) |
| 190 gl->DeleteTextures(1, &depthStencil); | 196 gl->DeleteTextures(1, &depthStencil); |
| 191 gl->DeleteTextures(colors.size(), colors.data()); | 197 gl->DeleteTextures(colors.size(), colors.data()); |
| 192 | 198 |
| 193 return ok; | 199 return ok; |
| 194 } | 200 } |
| 195 | 201 |
| 196 } // namespace blink | 202 } // namespace blink |
| OLD | NEW |