| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // static | 101 // static |
| 102 bool WebGLDrawBuffers::satisfiesWebGLRequirements(WebGLRenderingContextBase* web
glContext) | 102 bool WebGLDrawBuffers::satisfiesWebGLRequirements(WebGLRenderingContextBase* web
glContext) |
| 103 { | 103 { |
| 104 WebGraphicsContext3D* context = webglContext->webContext(); | 104 WebGraphicsContext3D* context = webglContext->webContext(); |
| 105 gpu::gles2::GLES2Interface* gl = webglContext->contextGL(); | 105 gpu::gles2::GLES2Interface* gl = webglContext->contextGL(); |
| 106 Extensions3DUtil* extensionsUtil = webglContext->extensionsUtil(); | 106 Extensions3DUtil* extensionsUtil = webglContext->extensionsUtil(); |
| 107 | 107 |
| 108 // This is called after we make sure GL_EXT_draw_buffers is supported. | 108 // This is called after we make sure GL_EXT_draw_buffers is supported. |
| 109 GLint maxDrawBuffers = 0; | 109 GLint maxDrawBuffers = 0; |
| 110 GLint maxColorAttachments = 0; | 110 GLint maxColorAttachments = 0; |
| 111 context->getIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &maxDrawBuffers); | 111 gl->GetIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &maxDrawBuffers); |
| 112 context->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &maxColorAttachments); | 112 gl->GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &maxColorAttachments); |
| 113 if (maxDrawBuffers < 4 || maxColorAttachments < 4) | 113 if (maxDrawBuffers < 4 || maxColorAttachments < 4) |
| 114 return false; | 114 return false; |
| 115 | 115 |
| 116 Platform3DObject fbo = context->createFramebuffer(); | 116 Platform3DObject fbo = context->createFramebuffer(); |
| 117 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); | 117 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); |
| 118 | 118 |
| 119 const unsigned char* buffer = 0; // Chromium doesn't allow init data for dep
th/stencil tetxures. | 119 const unsigned char* buffer = 0; // Chromium doesn't allow init data for dep
th/stencil tetxures. |
| 120 bool supportsDepth = (extensionsUtil->supportsExtension("GL_CHROMIUM_depth_t
exture") | 120 bool supportsDepth = (extensionsUtil->supportsExtension("GL_CHROMIUM_depth_t
exture") |
| 121 || extensionsUtil->supportsExtension("GL_OES_depth_texture") | 121 || extensionsUtil->supportsExtension("GL_OES_depth_texture") |
| 122 || extensionsUtil->supportsExtension("GL_ARB_depth_texture")); | 122 || extensionsUtil->supportsExtension("GL_ARB_depth_texture")); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (supportsDepth) | 174 if (supportsDepth) |
| 175 context->deleteTexture(depth); | 175 context->deleteTexture(depth); |
| 176 if (supportsDepthStencil) | 176 if (supportsDepthStencil) |
| 177 context->deleteTexture(depthStencil); | 177 context->deleteTexture(depthStencil); |
| 178 for (size_t i = 0; i < colors.size(); ++i) | 178 for (size_t i = 0; i < colors.size(); ++i) |
| 179 context->deleteTexture(colors[i]); | 179 context->deleteTexture(colors[i]); |
| 180 return ok; | 180 return ok; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace blink | 183 } // namespace blink |
| OLD | NEW |