| 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/command_buffer/service/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 gfx::GpuMemoryBufferHandle ShareGpuMemoryBufferToGpuThread( | 93 gfx::GpuMemoryBufferHandle ShareGpuMemoryBufferToGpuThread( |
| 94 const gfx::GpuMemoryBufferHandle& source_handle, | 94 const gfx::GpuMemoryBufferHandle& source_handle, |
| 95 bool* requires_sync_point) { | 95 bool* requires_sync_point) { |
| 96 switch (source_handle.type) { | 96 switch (source_handle.type) { |
| 97 case gfx::SHARED_MEMORY_BUFFER: { | 97 case gfx::SHARED_MEMORY_BUFFER: { |
| 98 gfx::GpuMemoryBufferHandle handle; | 98 gfx::GpuMemoryBufferHandle handle; |
| 99 handle.type = gfx::SHARED_MEMORY_BUFFER; | 99 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 100 handle.handle = ShareToGpuThread(source_handle.handle); | 100 handle.handle = ShareToGpuThread(source_handle.handle); |
| 101 handle.offset = source_handle.offset; |
| 101 *requires_sync_point = false; | 102 *requires_sync_point = false; |
| 102 return handle; | 103 return handle; |
| 103 } | 104 } |
| 104 case gfx::IO_SURFACE_BUFFER: | 105 case gfx::IO_SURFACE_BUFFER: |
| 105 case gfx::SURFACE_TEXTURE_BUFFER: | 106 case gfx::SURFACE_TEXTURE_BUFFER: |
| 106 case gfx::OZONE_NATIVE_PIXMAP: | 107 case gfx::OZONE_NATIVE_PIXMAP: |
| 107 *requires_sync_point = true; | 108 *requires_sync_point = true; |
| 108 return source_handle; | 109 return source_handle; |
| 109 default: | 110 default: |
| 110 NOTREACHED(); | 111 NOTREACHED(); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 DCHECK(image_manager); | 707 DCHECK(image_manager); |
| 707 if (image_manager->LookupImage(id)) { | 708 if (image_manager->LookupImage(id)) { |
| 708 LOG(ERROR) << "Image already exists with same ID."; | 709 LOG(ERROR) << "Image already exists with same ID."; |
| 709 return; | 710 return; |
| 710 } | 711 } |
| 711 | 712 |
| 712 switch (handle.type) { | 713 switch (handle.type) { |
| 713 case gfx::SHARED_MEMORY_BUFFER: { | 714 case gfx::SHARED_MEMORY_BUFFER: { |
| 714 scoped_refptr<gfx::GLImageSharedMemory> image( | 715 scoped_refptr<gfx::GLImageSharedMemory> image( |
| 715 new gfx::GLImageSharedMemory(size, internalformat)); | 716 new gfx::GLImageSharedMemory(size, internalformat)); |
| 716 if (!image->Initialize(handle.handle, handle.id, format)) { | 717 if (!image->Initialize(handle.handle, handle.id, format, handle.offset)) { |
| 717 LOG(ERROR) << "Failed to initialize image."; | 718 LOG(ERROR) << "Failed to initialize image."; |
| 718 return; | 719 return; |
| 719 } | 720 } |
| 720 | 721 |
| 721 image_manager->AddImage(image.get(), id); | 722 image_manager->AddImage(image.get(), id); |
| 722 break; | 723 break; |
| 723 } | 724 } |
| 724 default: { | 725 default: { |
| 725 if (!image_factory_) { | 726 if (!image_factory_) { |
| 726 LOG(ERROR) << "Image factory missing but required by buffer type."; | 727 LOG(ERROR) << "Image factory missing but required by buffer type."; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 framebuffer_completeness_cache_ = | 1093 framebuffer_completeness_cache_ = |
| 1093 new gpu::gles2::FramebufferCompletenessCache; | 1094 new gpu::gles2::FramebufferCompletenessCache; |
| 1094 return framebuffer_completeness_cache_; | 1095 return framebuffer_completeness_cache_; |
| 1095 } | 1096 } |
| 1096 | 1097 |
| 1097 SyncPointManager* GpuInProcessThread::sync_point_manager() { | 1098 SyncPointManager* GpuInProcessThread::sync_point_manager() { |
| 1098 return sync_point_manager_; | 1099 return sync_point_manager_; |
| 1099 } | 1100 } |
| 1100 | 1101 |
| 1101 } // namespace gpu | 1102 } // namespace gpu |
| OLD | NEW |