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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 next_shader_id_(2000), | 60 next_shader_id_(2000), |
61 max_texture_size_(2048), | 61 max_texture_size_(2048), |
62 reshape_called_(false), | 62 reshape_called_(false), |
63 width_(0), | 63 width_(0), |
64 height_(0), | 64 height_(0), |
65 scale_factor_(-1.f), | 65 scale_factor_(-1.f), |
66 test_support_(NULL), | 66 test_support_(NULL), |
67 last_update_type_(NoUpdate), | 67 last_update_type_(NoUpdate), |
68 next_insert_sync_point_(1), | 68 next_insert_sync_point_(1), |
69 last_waited_sync_point_(0), | 69 last_waited_sync_point_(0), |
| 70 query_result_available_ext_(1), |
70 bound_buffer_(0), | 71 bound_buffer_(0), |
71 weak_ptr_factory_(this) { | 72 weak_ptr_factory_(this) { |
72 CreateNamespace(); | 73 CreateNamespace(); |
73 } | 74 } |
74 | 75 |
75 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() { | 76 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() { |
76 base::AutoLock lock(g_shared_namespace_lock.Get()); | 77 base::AutoLock lock(g_shared_namespace_lock.Get()); |
77 namespace_ = NULL; | 78 namespace_ = NULL; |
78 } | 79 } |
79 | 80 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 --times_end_query_succeeds_; | 351 --times_end_query_succeeds_; |
351 } | 352 } |
352 } | 353 } |
353 | 354 |
354 void TestWebGraphicsContext3D::getQueryObjectuivEXT( | 355 void TestWebGraphicsContext3D::getQueryObjectuivEXT( |
355 GLuint query, | 356 GLuint query, |
356 GLenum pname, | 357 GLenum pname, |
357 GLuint* params) { | 358 GLuint* params) { |
358 // If the context is lost, behave as if result is available. | 359 // If the context is lost, behave as if result is available. |
359 if (pname == GL_QUERY_RESULT_AVAILABLE_EXT) | 360 if (pname == GL_QUERY_RESULT_AVAILABLE_EXT) |
360 *params = 1; | 361 *params = query_result_available_ext_; |
361 } | 362 } |
362 | 363 |
363 void TestWebGraphicsContext3D::getIntegerv( | 364 void TestWebGraphicsContext3D::getIntegerv( |
364 GLenum pname, | 365 GLenum pname, |
365 GLint* value) { | 366 GLint* value) { |
366 if (pname == GL_MAX_TEXTURE_SIZE) | 367 if (pname == GL_MAX_TEXTURE_SIZE) |
367 *value = max_texture_size_; | 368 *value = max_texture_size_; |
368 else if (pname == GL_ACTIVE_TEXTURE) | 369 else if (pname == GL_ACTIVE_TEXTURE) |
369 *value = GL_TEXTURE0; | 370 *value = GL_TEXTURE0; |
370 } | 371 } |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 | 714 |
714 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 715 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
715 | 716 |
716 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 717 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
717 | 718 |
718 TestWebGraphicsContext3D::Image::Image() {} | 719 TestWebGraphicsContext3D::Image::Image() {} |
719 | 720 |
720 TestWebGraphicsContext3D::Image::~Image() {} | 721 TestWebGraphicsContext3D::Image::~Image() {} |
721 | 722 |
722 } // namespace cc | 723 } // namespace cc |
OLD | NEW |