| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 #if defined(OS_CHROMEOS) | 912 #if defined(OS_CHROMEOS) |
| 913 // TODO(reveman): GL_COMMANDS_ISSUED_CHROMIUM is used for synchronization | 913 // TODO(reveman): GL_COMMANDS_ISSUED_CHROMIUM is used for synchronization |
| 914 // on ChromeOS to avoid some performance issues. This only works with | 914 // on ChromeOS to avoid some performance issues. This only works with |
| 915 // shared memory backed buffers. crbug.com/436314 | 915 // shared memory backed buffers. crbug.com/436314 |
| 916 DCHECK_EQ(gpu_memory_buffer_->GetHandle().type, gfx::SHARED_MEMORY_BUFFER); | 916 DCHECK_EQ(gpu_memory_buffer_->GetHandle().type, gfx::SHARED_MEMORY_BUFFER); |
| 917 #endif | 917 #endif |
| 918 | 918 |
| 919 resource_->image_id = gl->CreateImageCHROMIUM( | 919 resource_->image_id = gl->CreateImageCHROMIUM( |
| 920 gpu_memory_buffer_->AsClientBuffer(), size_.width(), size_.height(), | 920 gpu_memory_buffer_->AsClientBuffer(), size_.width(), size_.height(), |
| 921 GLInternalFormat(resource_->format)); | 921 GLInternalFormat(resource_->format)); |
| 922 resource_->is_overlay_candidate = true; |
| 922 } | 923 } |
| 923 | 924 |
| 924 std::swap(resource_->gpu_memory_buffer, gpu_memory_buffer_); | 925 std::swap(resource_->gpu_memory_buffer, gpu_memory_buffer_); |
| 925 resource_->allocated = true; | 926 resource_->allocated = true; |
| 926 resource_->dirty_image = true; | 927 resource_->dirty_image = true; |
| 927 | 928 |
| 928 // GpuMemoryBuffer provides direct access to the memory used by the GPU. | 929 // GpuMemoryBuffer provides direct access to the memory used by the GPU. |
| 929 // Read lock fences are required to ensure that we're not trying to map a | 930 // Read lock fences are required to ensure that we're not trying to map a |
| 930 // buffer that is currently in-use by the GPU. | 931 // buffer that is currently in-use by the GPU. |
| 931 resource_->read_lock_fences_enabled = true; | 932 resource_->read_lock_fences_enabled = true; |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 const int kImportance = 2; | 1670 const int kImportance = 2; |
| 1670 pmd->CreateSharedGlobalAllocatorDump(guid); | 1671 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 1671 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1672 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 1672 } | 1673 } |
| 1673 } | 1674 } |
| 1674 | 1675 |
| 1675 return true; | 1676 return true; |
| 1676 } | 1677 } |
| 1677 | 1678 |
| 1678 } // namespace cc | 1679 } // namespace cc |
| OLD | NEW |