| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 WebGLDrawBuffers::~WebGLDrawBuffers() | 39 WebGLDrawBuffers::~WebGLDrawBuffers() |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 WebGLExtensionName WebGLDrawBuffers::name() const | 43 WebGLExtensionName WebGLDrawBuffers::name() const |
| 44 { | 44 { |
| 45 return WebGLDrawBuffersName; | 45 return WebGLDrawBuffersName; |
| 46 } | 46 } |
| 47 | 47 |
| 48 PassRefPtrWillBeRawPtr<WebGLDrawBuffers> WebGLDrawBuffers::create(WebGLRendering
ContextBase* context) | 48 WebGLDrawBuffers* WebGLDrawBuffers::create(WebGLRenderingContextBase* context) |
| 49 { | 49 { |
| 50 return adoptRefWillBeNoop(new WebGLDrawBuffers(context)); | 50 return new WebGLDrawBuffers(context); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // static | 53 // static |
| 54 bool WebGLDrawBuffers::supported(WebGLRenderingContextBase* context) | 54 bool WebGLDrawBuffers::supported(WebGLRenderingContextBase* context) |
| 55 { | 55 { |
| 56 return (context->extensionsUtil()->supportsExtension("GL_EXT_draw_buffers") | 56 return (context->extensionsUtil()->supportsExtension("GL_EXT_draw_buffers") |
| 57 && satisfiesWebGLRequirements(context)); | 57 && satisfiesWebGLRequirements(context)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 // static |
| 60 const char* WebGLDrawBuffers::extensionName() | 61 const char* WebGLDrawBuffers::extensionName() |
| 61 { | 62 { |
| 62 return "WEBGL_draw_buffers"; | 63 return "WEBGL_draw_buffers"; |
| 63 } | 64 } |
| 64 | 65 |
| 65 void WebGLDrawBuffers::drawBuffersWEBGL(const Vector<GLenum>& buffers) | 66 void WebGLDrawBuffers::drawBuffersWEBGL(const Vector<GLenum>& buffers) |
| 66 { | 67 { |
| 67 WebGLExtensionScopedContext scoped(this); | 68 WebGLExtensionScopedContext scoped(this); |
| 68 if (scoped.isLost()) | 69 if (scoped.isLost()) |
| 69 return; | 70 return; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 if (supportsDepth) | 173 if (supportsDepth) |
| 173 context->deleteTexture(depth); | 174 context->deleteTexture(depth); |
| 174 if (supportsDepthStencil) | 175 if (supportsDepthStencil) |
| 175 context->deleteTexture(depthStencil); | 176 context->deleteTexture(depthStencil); |
| 176 for (size_t i = 0; i < colors.size(); ++i) | 177 for (size_t i = 0; i < colors.size(); ++i) |
| 177 context->deleteTexture(colors[i]); | 178 context->deleteTexture(colors[i]); |
| 178 return ok; | 179 return ok; |
| 179 } | 180 } |
| 180 | 181 |
| 181 } // namespace blink | 182 } // namespace blink |
| OLD | NEW |