| 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 "gpu/ipc/in_process_command_buffer.h" | 5 #include "gpu/ipc/in_process_command_buffer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 821 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 822 DCHECK(image_manager); | 822 DCHECK(image_manager); |
| 823 if (!image_manager->LookupImage(id)) { | 823 if (!image_manager->LookupImage(id)) { |
| 824 LOG(ERROR) << "Image with ID doesn't exist."; | 824 LOG(ERROR) << "Image with ID doesn't exist."; |
| 825 return; | 825 return; |
| 826 } | 826 } |
| 827 | 827 |
| 828 image_manager->RemoveImage(id); | 828 image_manager->RemoveImage(id); |
| 829 } | 829 } |
| 830 | 830 |
| 831 int32_t InProcessCommandBuffer::CreateGpuMemoryBufferImage( | |
| 832 size_t width, | |
| 833 size_t height, | |
| 834 unsigned internalformat, | |
| 835 unsigned usage) { | |
| 836 CheckSequencedThread(); | |
| 837 | |
| 838 DCHECK(gpu_memory_buffer_manager_); | |
| 839 std::unique_ptr<gfx::GpuMemoryBuffer> buffer( | |
| 840 gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( | |
| 841 gfx::Size(base::checked_cast<int>(width), | |
| 842 base::checked_cast<int>(height)), | |
| 843 gpu::DefaultBufferFormatForImageFormat(internalformat), | |
| 844 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle)); | |
| 845 if (!buffer) | |
| 846 return -1; | |
| 847 | |
| 848 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | |
| 849 } | |
| 850 | |
| 851 void InProcessCommandBuffer::FenceSyncReleaseOnGpuThread(uint64_t release) { | 831 void InProcessCommandBuffer::FenceSyncReleaseOnGpuThread(uint64_t release) { |
| 852 DCHECK(!sync_point_client_->client_state()->IsFenceSyncReleased(release)); | 832 DCHECK(!sync_point_client_->client_state()->IsFenceSyncReleased(release)); |
| 853 gles2::MailboxManager* mailbox_manager = | 833 gles2::MailboxManager* mailbox_manager = |
| 854 decoder_->GetContextGroup()->mailbox_manager(); | 834 decoder_->GetContextGroup()->mailbox_manager(); |
| 855 if (mailbox_manager->UsesSync()) { | 835 if (mailbox_manager->UsesSync()) { |
| 856 SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(), | 836 SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(), |
| 857 GetCommandBufferID(), release); | 837 GetCommandBufferID(), release); |
| 858 mailbox_manager->PushTextureUpdates(sync_token); | 838 mailbox_manager->PushTextureUpdates(sync_token); |
| 859 } | 839 } |
| 860 | 840 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 return wrapped_callback; | 1148 return wrapped_callback; |
| 1169 } | 1149 } |
| 1170 | 1150 |
| 1171 InProcessCommandBuffer::GpuTask::GpuTask(const base::Closure& callback, | 1151 InProcessCommandBuffer::GpuTask::GpuTask(const base::Closure& callback, |
| 1172 uint32_t order_number) | 1152 uint32_t order_number) |
| 1173 : callback(callback), order_number(order_number) {} | 1153 : callback(callback), order_number(order_number) {} |
| 1174 | 1154 |
| 1175 InProcessCommandBuffer::GpuTask::~GpuTask() {} | 1155 InProcessCommandBuffer::GpuTask::~GpuTask() {} |
| 1176 | 1156 |
| 1177 } // namespace gpu | 1157 } // namespace gpu |
| OLD | NEW |