| 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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 resource = InsertResource( | 1467 resource = InsertResource( |
| 1468 local_id, Resource(0, it->size, Resource::DELEGATED, | 1468 local_id, Resource(0, it->size, Resource::DELEGATED, |
| 1469 it->mailbox_holder.texture_target, it->filter, | 1469 it->mailbox_holder.texture_target, it->filter, |
| 1470 TEXTURE_HINT_IMMUTABLE, RESOURCE_TYPE_GL_TEXTURE, | 1470 TEXTURE_HINT_IMMUTABLE, RESOURCE_TYPE_GL_TEXTURE, |
| 1471 it->format)); | 1471 it->format)); |
| 1472 resource->set_mailbox(TextureMailbox(it->mailbox_holder.mailbox, | 1472 resource->set_mailbox(TextureMailbox(it->mailbox_holder.mailbox, |
| 1473 it->mailbox_holder.sync_token, | 1473 it->mailbox_holder.sync_token, |
| 1474 it->mailbox_holder.texture_target)); | 1474 it->mailbox_holder.texture_target)); |
| 1475 resource->read_lock_fences_enabled = it->read_lock_fences_enabled; | 1475 resource->read_lock_fences_enabled = it->read_lock_fences_enabled; |
| 1476 resource->is_overlay_candidate = it->is_overlay_candidate; | 1476 resource->is_overlay_candidate = it->is_overlay_candidate; |
| 1477 resource->color_space = it->color_space; |
| 1477 } | 1478 } |
| 1478 resource->child_id = child; | 1479 resource->child_id = child; |
| 1479 // Don't allocate a texture for a child. | 1480 // Don't allocate a texture for a child. |
| 1480 resource->allocated = true; | 1481 resource->allocated = true; |
| 1481 resource->imported_count = 1; | 1482 resource->imported_count = 1; |
| 1482 child_info.parent_to_child_map[local_id] = it->id; | 1483 child_info.parent_to_child_map[local_id] = it->id; |
| 1483 child_info.child_to_parent_map[it->id] = local_id; | 1484 child_info.child_to_parent_map[it->id] = local_id; |
| 1484 } | 1485 } |
| 1485 } | 1486 } |
| 1486 | 1487 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 DCHECK(!source->lock_for_read_count); | 1594 DCHECK(!source->lock_for_read_count); |
| 1594 DCHECK(source->origin != Resource::EXTERNAL || source->mailbox().IsValid()); | 1595 DCHECK(source->origin != Resource::EXTERNAL || source->mailbox().IsValid()); |
| 1595 DCHECK(source->allocated); | 1596 DCHECK(source->allocated); |
| 1596 resource->id = id; | 1597 resource->id = id; |
| 1597 resource->format = source->format; | 1598 resource->format = source->format; |
| 1598 resource->mailbox_holder.texture_target = source->target; | 1599 resource->mailbox_holder.texture_target = source->target; |
| 1599 resource->filter = source->filter; | 1600 resource->filter = source->filter; |
| 1600 resource->size = source->size; | 1601 resource->size = source->size; |
| 1601 resource->read_lock_fences_enabled = source->read_lock_fences_enabled; | 1602 resource->read_lock_fences_enabled = source->read_lock_fences_enabled; |
| 1602 resource->is_overlay_candidate = source->is_overlay_candidate; | 1603 resource->is_overlay_candidate = source->is_overlay_candidate; |
| 1604 resource->color_space = source->color_space; |
| 1603 | 1605 |
| 1604 if (source->type == RESOURCE_TYPE_BITMAP) { | 1606 if (source->type == RESOURCE_TYPE_BITMAP) { |
| 1605 resource->mailbox_holder.mailbox = source->shared_bitmap_id; | 1607 resource->mailbox_holder.mailbox = source->shared_bitmap_id; |
| 1606 resource->is_software = true; | 1608 resource->is_software = true; |
| 1607 } else { | 1609 } else { |
| 1608 DCHECK(source->mailbox().IsValid()); | 1610 DCHECK(source->mailbox().IsValid()); |
| 1609 DCHECK(source->mailbox().IsTexture()); | 1611 DCHECK(source->mailbox().IsTexture()); |
| 1610 DCHECK(!source->image_id || !source->dirty_image); | 1612 DCHECK(!source->image_id || !source->dirty_image); |
| 1611 // This is either an external resource, or a compositor resource that we | 1613 // This is either an external resource, or a compositor resource that we |
| 1612 // already exported. Make sure to forward the sync point that we were given. | 1614 // already exported. Make sure to forward the sync point that we were given. |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1991 | 1993 |
| 1992 const int kImportance = 2; | 1994 const int kImportance = 2; |
| 1993 pmd->CreateSharedGlobalAllocatorDump(guid); | 1995 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 1994 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1996 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 1995 } | 1997 } |
| 1996 | 1998 |
| 1997 return true; | 1999 return true; |
| 1998 } | 2000 } |
| 1999 | 2001 |
| 2000 } // namespace cc | 2002 } // namespace cc |
| OLD | NEW |