| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 GLenum internalformat, | 632 GLenum internalformat, |
| 633 GLenum usage) { | 633 GLenum usage) { |
| 634 DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat)); | 634 DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat)); |
| 635 GLuint image_id = NextImageId(); | 635 GLuint image_id = NextImageId(); |
| 636 base::AutoLock lock(namespace_->lock); | 636 base::AutoLock lock(namespace_->lock); |
| 637 std::unordered_set<unsigned>& images = namespace_->images; | 637 std::unordered_set<unsigned>& images = namespace_->images; |
| 638 images.insert(image_id); | 638 images.insert(image_id); |
| 639 return image_id; | 639 return image_id; |
| 640 } | 640 } |
| 641 | 641 |
| 642 GLint TestWebGraphicsContext3D::getImageivCHROMIUM(GLuint image_id, |
| 643 GLenum param) { |
| 644 DCHECK_EQ(GL_GPU_MEMORY_BUFFER_ID, static_cast<int>(param)); |
| 645 base::AutoLock lock(namespace_->lock); |
| 646 std::unordered_set<unsigned>& images = namespace_->images; |
| 647 if (images.find(image_id) != images.end()) |
| 648 return 1; |
| 649 return -1; |
| 650 } |
| 651 |
| 642 GLuint64 TestWebGraphicsContext3D::insertFenceSync() { | 652 GLuint64 TestWebGraphicsContext3D::insertFenceSync() { |
| 643 return next_insert_fence_sync_++; | 653 return next_insert_fence_sync_++; |
| 644 } | 654 } |
| 645 | 655 |
| 646 void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync, | 656 void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync, |
| 647 GLbyte* sync_token) { | 657 GLbyte* sync_token) { |
| 648 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, | 658 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, |
| 649 gpu::CommandBufferId(), fence_sync); | 659 gpu::CommandBufferId(), fence_sync); |
| 650 sync_token_data.SetVerifyFlush(); | 660 sync_token_data.SetVerifyFlush(); |
| 651 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | 661 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 | 834 |
| 825 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} | 835 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} |
| 826 | 836 |
| 827 TestWebGraphicsContext3D::Buffer::~Buffer() {} | 837 TestWebGraphicsContext3D::Buffer::~Buffer() {} |
| 828 | 838 |
| 829 TestWebGraphicsContext3D::Image::Image() {} | 839 TestWebGraphicsContext3D::Image::Image() {} |
| 830 | 840 |
| 831 TestWebGraphicsContext3D::Image::~Image() {} | 841 TestWebGraphicsContext3D::Image::~Image() {} |
| 832 | 842 |
| 833 } // namespace cc | 843 } // namespace cc |
| OLD | NEW |