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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 mailbox_name1 = '1'; | 437 mailbox_name1 = '1'; |
438 ++mailbox_name2; | 438 ++mailbox_name2; |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current, | 442 void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current, |
443 GLenum other) { | 443 GLenum other) { |
444 if (context_lost_) | 444 if (context_lost_) |
445 return; | 445 return; |
446 context_lost_ = true; | 446 context_lost_ = true; |
447 if (!context_lost_callback_.is_null()) | |
448 context_lost_callback_.Run(); | |
449 | 447 |
450 for (size_t i = 0; i < shared_contexts_.size(); ++i) | 448 for (size_t i = 0; i < shared_contexts_.size(); ++i) |
451 shared_contexts_[i]->loseContextCHROMIUM(current, other); | 449 shared_contexts_[i]->loseContextCHROMIUM(current, other); |
452 shared_contexts_.clear(); | 450 shared_contexts_.clear(); |
| 451 |
| 452 // In the single thread case, this could cause the context to be |
| 453 // synchronously deleted, so do it last. |
| 454 if (!context_lost_callback_.is_null()) |
| 455 context_lost_callback_.Run(); |
453 } | 456 } |
454 | 457 |
455 void TestWebGraphicsContext3D::finish() { | 458 void TestWebGraphicsContext3D::finish() { |
456 test_support_->CallAllSyncPointCallbacks(); | 459 test_support_->CallAllSyncPointCallbacks(); |
457 } | 460 } |
458 | 461 |
459 void TestWebGraphicsContext3D::flush() { | 462 void TestWebGraphicsContext3D::flush() { |
460 test_support_->CallAllSyncPointCallbacks(); | 463 test_support_->CallAllSyncPointCallbacks(); |
461 } | 464 } |
462 | 465 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | 723 |
721 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 724 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
722 | 725 |
723 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 726 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
724 | 727 |
725 TestWebGraphicsContext3D::Image::Image() {} | 728 TestWebGraphicsContext3D::Image::Image() {} |
726 | 729 |
727 TestWebGraphicsContext3D::Image::~Image() {} | 730 TestWebGraphicsContext3D::Image::~Image() {} |
728 | 731 |
729 } // namespace cc | 732 } // namespace cc |
OLD | NEW |