| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 images.insert(image_id); | 639 images.insert(image_id); |
| 640 return image_id; | 640 return image_id; |
| 641 } | 641 } |
| 642 | 642 |
| 643 GLuint64 TestWebGraphicsContext3D::insertFenceSync() { | 643 GLuint64 TestWebGraphicsContext3D::insertFenceSync() { |
| 644 return next_insert_fence_sync_++; | 644 return next_insert_fence_sync_++; |
| 645 } | 645 } |
| 646 | 646 |
| 647 void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync, | 647 void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync, |
| 648 GLbyte* sync_token) { | 648 GLbyte* sync_token) { |
| 649 // Don't return a valid sync token if context is lost. This matches behavior |
| 650 // of CommandBufferProxyImpl. |
| 651 if (context_lost_) |
| 652 return; |
| 649 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, | 653 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, |
| 650 gpu::CommandBufferId(), fence_sync); | 654 gpu::CommandBufferId(), fence_sync); |
| 651 sync_token_data.SetVerifyFlush(); | 655 sync_token_data.SetVerifyFlush(); |
| 652 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | 656 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
| 653 } | 657 } |
| 654 | 658 |
| 655 void TestWebGraphicsContext3D::waitSyncToken(const GLbyte* sync_token) { | 659 void TestWebGraphicsContext3D::waitSyncToken(const GLbyte* sync_token) { |
| 656 if (sync_token) { | 660 if (sync_token) { |
| 657 gpu::SyncToken sync_token_data; | 661 gpu::SyncToken sync_token_data; |
| 658 memcpy(sync_token_data.GetData(), sync_token, sizeof(sync_token_data)); | 662 memcpy(sync_token_data.GetData(), sync_token, sizeof(sync_token_data)); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 | 829 |
| 826 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 830 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
| 827 | 831 |
| 828 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 832 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
| 829 | 833 |
| 830 TestWebGraphicsContext3D::Image::Image() {} | 834 TestWebGraphicsContext3D::Image::Image() {} |
| 831 | 835 |
| 832 TestWebGraphicsContext3D::Image::~Image() {} | 836 TestWebGraphicsContext3D::Image::~Image() {} |
| 833 | 837 |
| 834 } // namespace cc | 838 } // namespace cc |
| OLD | NEW |