| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/test/test_web_graphics_context_3d.h" | 5 #include "cc/test/test_web_graphics_context_3d.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void TestWebGraphicsContext3D::genTextures(GLsizei count, GLuint* ids) { | 177 void TestWebGraphicsContext3D::genTextures(GLsizei count, GLuint* ids) { |
| 178 for (int i = 0; i < count; ++i) { | 178 for (int i = 0; i < count; ++i) { |
| 179 ids[i] = NextTextureId(); | 179 ids[i] = NextTextureId(); |
| 180 DCHECK_NE(ids[i], kExternalTextureId); | 180 DCHECK_NE(ids[i], kExternalTextureId); |
| 181 } | 181 } |
| 182 base::AutoLock lock(namespace_->lock); | 182 base::AutoLock lock(namespace_->lock); |
| 183 for (int i = 0; i < count; ++i) | 183 for (int i = 0; i < count; ++i) |
| 184 namespace_->textures.Append(ids[i], new TestTexture()); | 184 namespace_->textures.Append(ids[i], new TestTexture()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void TestWebGraphicsContext3D::deleteBuffers(GLsizei count, GLuint* ids) { | 187 void TestWebGraphicsContext3D::deleteBuffers(GLsizei count, const GLuint* ids) { |
| 188 for (int i = 0; i < count; ++i) | 188 for (int i = 0; i < count; ++i) |
| 189 RetireBufferId(ids[i]); | 189 RetireBufferId(ids[i]); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void TestWebGraphicsContext3D::deleteFramebuffers( | 192 void TestWebGraphicsContext3D::deleteFramebuffers(GLsizei count, |
| 193 GLsizei count, GLuint* ids) { | 193 const GLuint* ids) { |
| 194 for (int i = 0; i < count; ++i) { | 194 for (int i = 0; i < count; ++i) { |
| 195 if (ids[i]) { | 195 if (ids[i]) { |
| 196 RetireFramebufferId(ids[i]); | 196 RetireFramebufferId(ids[i]); |
| 197 if (ids[i] == current_framebuffer_) | 197 if (ids[i] == current_framebuffer_) |
| 198 current_framebuffer_ = 0; | 198 current_framebuffer_ = 0; |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 void TestWebGraphicsContext3D::deleteRenderbuffers( | 203 void TestWebGraphicsContext3D::deleteRenderbuffers(GLsizei count, |
| 204 GLsizei count, GLuint* ids) { | 204 const GLuint* ids) { |
| 205 for (int i = 0; i < count; ++i) | 205 for (int i = 0; i < count; ++i) |
| 206 RetireRenderbufferId(ids[i]); | 206 RetireRenderbufferId(ids[i]); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void TestWebGraphicsContext3D::deleteTextures(GLsizei count, GLuint* ids) { | 209 void TestWebGraphicsContext3D::deleteTextures(GLsizei count, |
| 210 const GLuint* ids) { |
| 210 for (int i = 0; i < count; ++i) | 211 for (int i = 0; i < count; ++i) |
| 211 RetireTextureId(ids[i]); | 212 RetireTextureId(ids[i]); |
| 212 base::AutoLock lock(namespace_->lock); | 213 base::AutoLock lock(namespace_->lock); |
| 213 for (int i = 0; i < count; ++i) { | 214 for (int i = 0; i < count; ++i) { |
| 214 namespace_->textures.Remove(ids[i]); | 215 namespace_->textures.Remove(ids[i]); |
| 215 texture_targets_.UnbindTexture(ids[i]); | 216 texture_targets_.UnbindTexture(ids[i]); |
| 216 } | 217 } |
| 217 } | 218 } |
| 218 | 219 |
| 219 GLuint TestWebGraphicsContext3D::createBuffer() { | 220 GLuint TestWebGraphicsContext3D::createBuffer() { |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 | 829 |
| 829 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 830 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
| 830 | 831 |
| 831 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 832 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
| 832 | 833 |
| 833 TestWebGraphicsContext3D::Image::Image() {} | 834 TestWebGraphicsContext3D::Image::Image() {} |
| 834 | 835 |
| 835 TestWebGraphicsContext3D::Image::~Image() {} | 836 TestWebGraphicsContext3D::Image::~Image() {} |
| 836 | 837 |
| 837 } // namespace cc | 838 } // namespace cc |
| OLD | NEW |