| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 DCHECK(!source->locked_for_write); | 1557 DCHECK(!source->locked_for_write); |
| 1558 DCHECK(!source->lock_for_read_count); | 1558 DCHECK(!source->lock_for_read_count); |
| 1559 DCHECK(source->origin != Resource::EXTERNAL || source->mailbox().IsValid()); | 1559 DCHECK(source->origin != Resource::EXTERNAL || source->mailbox().IsValid()); |
| 1560 DCHECK(source->allocated); | 1560 DCHECK(source->allocated); |
| 1561 resource->id = id; | 1561 resource->id = id; |
| 1562 resource->format = source->format; | 1562 resource->format = source->format; |
| 1563 resource->mailbox_holder.texture_target = source->target; | 1563 resource->mailbox_holder.texture_target = source->target; |
| 1564 resource->filter = source->filter; | 1564 resource->filter = source->filter; |
| 1565 resource->size = source->size; | 1565 resource->size = source->size; |
| 1566 resource->read_lock_fences_enabled = source->read_lock_fences_enabled; | 1566 resource->read_lock_fences_enabled = source->read_lock_fences_enabled; |
| 1567 if (source->gpu_memory_buffer) |
| 1568 resource->gpu_memory_buffer_handle = source->gpu_memory_buffer->GetHandle(); |
| 1567 resource->is_overlay_candidate = source->is_overlay_candidate; | 1569 resource->is_overlay_candidate = source->is_overlay_candidate; |
| 1568 | 1570 |
| 1569 if (source->type == RESOURCE_TYPE_BITMAP) { | 1571 if (source->type == RESOURCE_TYPE_BITMAP) { |
| 1570 resource->mailbox_holder.mailbox = source->shared_bitmap_id; | 1572 resource->mailbox_holder.mailbox = source->shared_bitmap_id; |
| 1571 resource->is_software = true; | 1573 resource->is_software = true; |
| 1572 } else { | 1574 } else { |
| 1573 DCHECK(source->mailbox().IsValid()); | 1575 DCHECK(source->mailbox().IsValid()); |
| 1574 DCHECK(source->mailbox().IsTexture()); | 1576 DCHECK(source->mailbox().IsTexture()); |
| 1575 DCHECK(!source->image_id || !source->dirty_image); | 1577 DCHECK(!source->image_id || !source->dirty_image); |
| 1576 // This is either an external resource, or a compositor resource that we | 1578 // This is either an external resource, or a compositor resource that we |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 | 1957 |
| 1956 const int kImportance = 2; | 1958 const int kImportance = 2; |
| 1957 pmd->CreateSharedGlobalAllocatorDump(guid); | 1959 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 1958 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1960 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 1959 } | 1961 } |
| 1960 | 1962 |
| 1961 return true; | 1963 return true; |
| 1962 } | 1964 } |
| 1963 | 1965 |
| 1964 } // namespace cc | 1966 } // namespace cc |
| OLD | NEW |