| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 return texture_targets_.BoundTexture(target); | 349 return texture_targets_.BoundTexture(target); |
| 350 } | 350 } |
| 351 | 351 |
| 352 scoped_refptr<TestTexture> TestWebGraphicsContext3D::BoundTexture( | 352 scoped_refptr<TestTexture> TestWebGraphicsContext3D::BoundTexture( |
| 353 GLenum target) { | 353 GLenum target) { |
| 354 // The caller is expected to lock the namespace for texture access. | 354 // The caller is expected to lock the namespace for texture access. |
| 355 namespace_->lock.AssertAcquired(); | 355 namespace_->lock.AssertAcquired(); |
| 356 return namespace_->textures.TextureForId(BoundTextureId(target)); | 356 return namespace_->textures.TextureForId(BoundTextureId(target)); |
| 357 } | 357 } |
| 358 | 358 |
| 359 scoped_refptr<TestTexture> TestWebGraphicsContext3D::UnboundTexture( |
| 360 GLuint texture) { |
| 361 // The caller is expected to lock the namespace for texture access. |
| 362 namespace_->lock.AssertAcquired(); |
| 363 return namespace_->textures.TextureForId(texture); |
| 364 } |
| 365 |
| 359 void TestWebGraphicsContext3D::CheckTextureIsBound(GLenum target) { | 366 void TestWebGraphicsContext3D::CheckTextureIsBound(GLenum target) { |
| 360 DCHECK(BoundTextureId(target)); | 367 DCHECK(BoundTextureId(target)); |
| 361 } | 368 } |
| 362 | 369 |
| 363 GLuint TestWebGraphicsContext3D::createQueryEXT() { return 1u; } | 370 GLuint TestWebGraphicsContext3D::createQueryEXT() { return 1u; } |
| 364 | 371 |
| 365 void TestWebGraphicsContext3D::endQueryEXT(GLenum target) { | 372 void TestWebGraphicsContext3D::endQueryEXT(GLenum target) { |
| 366 if (times_end_query_succeeds_ >= 0) { | 373 if (times_end_query_succeeds_ >= 0) { |
| 367 if (!times_end_query_succeeds_) { | 374 if (!times_end_query_succeeds_) { |
| 368 loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, | 375 loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 mailbox[2] = '\0'; | 466 mailbox[2] = '\0'; |
| 460 if (++mailbox_name1 == 0) { | 467 if (++mailbox_name1 == 0) { |
| 461 mailbox_name1 = '1'; | 468 mailbox_name1 = '1'; |
| 462 ++mailbox_name2; | 469 ++mailbox_name2; |
| 463 } | 470 } |
| 464 } | 471 } |
| 465 | 472 |
| 466 GLuint TestWebGraphicsContext3D::createAndConsumeTextureCHROMIUM( | 473 GLuint TestWebGraphicsContext3D::createAndConsumeTextureCHROMIUM( |
| 467 GLenum target, | 474 GLenum target, |
| 468 const GLbyte* mailbox) { | 475 const GLbyte* mailbox) { |
| 469 return createTexture(); | 476 GLuint texture_id = createTexture(); |
| 477 consumeTextureCHROMIUM(target, mailbox); |
| 478 return texture_id; |
| 470 } | 479 } |
| 471 | 480 |
| 472 void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current, | 481 void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current, |
| 473 GLenum other) { | 482 GLenum other) { |
| 474 if (context_lost_) | 483 if (context_lost_) |
| 475 return; | 484 return; |
| 476 context_lost_ = true; | 485 context_lost_ = true; |
| 477 if (!context_lost_callback_.is_null()) | 486 if (!context_lost_callback_.is_null()) |
| 478 context_lost_callback_.Run(); | 487 context_lost_callback_.Run(); |
| 479 | 488 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 | 800 |
| 792 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 801 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
| 793 | 802 |
| 794 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 803 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
| 795 | 804 |
| 796 TestWebGraphicsContext3D::Image::Image() {} | 805 TestWebGraphicsContext3D::Image::Image() {} |
| 797 | 806 |
| 798 TestWebGraphicsContext3D::Image::~Image() {} | 807 TestWebGraphicsContext3D::Image::~Image() {} |
| 799 | 808 |
| 800 } // namespace cc | 809 } // namespace cc |
| OLD | NEW |