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 WebGLDrawBuffers* WebGLDrawBuffers::create(WebGLRenderingContextBase* context) | 48 PassRefPtrWillBeRawPtr<WebGLDrawBuffers> WebGLDrawBuffers::create(WebGLRendering
ContextBase* context) |
49 { | 49 { |
50 return new WebGLDrawBuffers(context); | 50 return adoptRefWillBeNoop(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 | |
61 const char* WebGLDrawBuffers::extensionName() | 60 const char* WebGLDrawBuffers::extensionName() |
62 { | 61 { |
63 return "WEBGL_draw_buffers"; | 62 return "WEBGL_draw_buffers"; |
64 } | 63 } |
65 | 64 |
66 void WebGLDrawBuffers::drawBuffersWEBGL(const Vector<GLenum>& buffers) | 65 void WebGLDrawBuffers::drawBuffersWEBGL(const Vector<GLenum>& buffers) |
67 { | 66 { |
68 WebGLExtensionScopedContext scoped(this); | 67 WebGLExtensionScopedContext scoped(this); |
69 if (scoped.isLost()) | 68 if (scoped.isLost()) |
70 return; | 69 return; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (supportsDepth) | 172 if (supportsDepth) |
174 context->deleteTexture(depth); | 173 context->deleteTexture(depth); |
175 if (supportsDepthStencil) | 174 if (supportsDepthStencil) |
176 context->deleteTexture(depthStencil); | 175 context->deleteTexture(depthStencil); |
177 for (size_t i = 0; i < colors.size(); ++i) | 176 for (size_t i = 0; i < colors.size(); ++i) |
178 context->deleteTexture(colors[i]); | 177 context->deleteTexture(colors[i]); |
179 return ok; | 178 return ok; |
180 } | 179 } |
181 | 180 |
182 } // namespace blink | 181 } // namespace blink |
OLD | NEW |