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