| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 width_(0), | 66 width_(0), |
| 67 height_(0), | 67 height_(0), |
| 68 scale_factor_(-1.f), | 68 scale_factor_(-1.f), |
| 69 test_support_(NULL), | 69 test_support_(NULL), |
| 70 last_update_type_(NO_UPDATE), | 70 last_update_type_(NO_UPDATE), |
| 71 next_insert_fence_sync_(1), | 71 next_insert_fence_sync_(1), |
| 72 unpack_alignment_(4), | 72 unpack_alignment_(4), |
| 73 bound_buffer_(0), | 73 bound_buffer_(0), |
| 74 weak_ptr_factory_(this) { | 74 weak_ptr_factory_(this) { |
| 75 CreateNamespace(); | 75 CreateNamespace(); |
| 76 set_support_image(true); | 76 test_capabilities_.image = true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() { | 79 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() { |
| 80 base::AutoLock lock(g_shared_namespace_lock.Get()); | 80 base::AutoLock lock(g_shared_namespace_lock.Get()); |
| 81 namespace_ = NULL; | 81 namespace_ = NULL; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void TestWebGraphicsContext3D::CreateNamespace() { | 84 void TestWebGraphicsContext3D::CreateNamespace() { |
| 85 base::AutoLock lock(g_shared_namespace_lock.Get()); | 85 base::AutoLock lock(g_shared_namespace_lock.Get()); |
| 86 if (shared_namespace_) { | 86 if (shared_namespace_) { |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 return id; | 755 return id; |
| 756 } | 756 } |
| 757 | 757 |
| 758 void TestWebGraphicsContext3D::RetireRenderbufferId(GLuint id) { | 758 void TestWebGraphicsContext3D::RetireRenderbufferId(GLuint id) { |
| 759 base::AutoLock lock_for_renderbuffer_access(namespace_->lock); | 759 base::AutoLock lock_for_renderbuffer_access(namespace_->lock); |
| 760 DCHECK(namespace_->renderbuffer_set.find(id) != | 760 DCHECK(namespace_->renderbuffer_set.find(id) != |
| 761 namespace_->renderbuffer_set.end()); | 761 namespace_->renderbuffer_set.end()); |
| 762 namespace_->renderbuffer_set.erase(id); | 762 namespace_->renderbuffer_set.erase(id); |
| 763 } | 763 } |
| 764 | 764 |
| 765 void TestWebGraphicsContext3D::SetMaxSamples(int max_samples) { | |
| 766 test_capabilities_.max_samples = max_samples; | |
| 767 } | |
| 768 | |
| 769 TestWebGraphicsContext3D::TextureTargets::TextureTargets() { | 765 TestWebGraphicsContext3D::TextureTargets::TextureTargets() { |
| 770 // Initialize default bindings. | 766 // Initialize default bindings. |
| 771 bound_textures_[GL_TEXTURE_2D] = 0; | 767 bound_textures_[GL_TEXTURE_2D] = 0; |
| 772 bound_textures_[GL_TEXTURE_EXTERNAL_OES] = 0; | 768 bound_textures_[GL_TEXTURE_EXTERNAL_OES] = 0; |
| 773 bound_textures_[GL_TEXTURE_RECTANGLE_ARB] = 0; | 769 bound_textures_[GL_TEXTURE_RECTANGLE_ARB] = 0; |
| 774 } | 770 } |
| 775 | 771 |
| 776 TestWebGraphicsContext3D::TextureTargets::~TextureTargets() {} | 772 TestWebGraphicsContext3D::TextureTargets::~TextureTargets() {} |
| 777 | 773 |
| 778 void TestWebGraphicsContext3D::TextureTargets::BindTexture( | 774 void TestWebGraphicsContext3D::TextureTargets::BindTexture( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 | 820 |
| 825 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 821 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
| 826 | 822 |
| 827 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 823 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
| 828 | 824 |
| 829 TestWebGraphicsContext3D::Image::Image() {} | 825 TestWebGraphicsContext3D::Image::Image() {} |
| 830 | 826 |
| 831 TestWebGraphicsContext3D::Image::~Image() {} | 827 TestWebGraphicsContext3D::Image::~Image() {} |
| 832 | 828 |
| 833 } // namespace cc | 829 } // namespace cc |
| OLD | NEW |