| 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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 id, Resource(pixels, shared_bitmap, mailbox.size_in_pixels(), | 661 id, Resource(pixels, shared_bitmap, mailbox.size_in_pixels(), |
| 662 Resource::EXTERNAL, GL_LINEAR)); | 662 Resource::EXTERNAL, GL_LINEAR)); |
| 663 } | 663 } |
| 664 resource->allocated = true; | 664 resource->allocated = true; |
| 665 resource->set_mailbox(mailbox); | 665 resource->set_mailbox(mailbox); |
| 666 resource->release_callback_impl = | 666 resource->release_callback_impl = |
| 667 base::Bind(&SingleReleaseCallbackImpl::Run, | 667 base::Bind(&SingleReleaseCallbackImpl::Run, |
| 668 base::Owned(release_callback_impl.release())); | 668 base::Owned(release_callback_impl.release())); |
| 669 resource->read_lock_fences_enabled = read_lock_fences_enabled; | 669 resource->read_lock_fences_enabled = read_lock_fences_enabled; |
| 670 resource->is_overlay_candidate = mailbox.is_overlay_candidate(); | 670 resource->is_overlay_candidate = mailbox.is_overlay_candidate(); |
| 671 resource->color_space = mailbox.color_space(); |
| 671 | 672 |
| 672 return id; | 673 return id; |
| 673 } | 674 } |
| 674 | 675 |
| 675 ResourceId ResourceProvider::CreateResourceFromTextureMailbox( | 676 ResourceId ResourceProvider::CreateResourceFromTextureMailbox( |
| 676 const TextureMailbox& mailbox, | 677 const TextureMailbox& mailbox, |
| 677 std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl) { | 678 std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl) { |
| 678 return CreateResourceFromTextureMailbox( | 679 return CreateResourceFromTextureMailbox( |
| 679 mailbox, std::move(release_callback_impl), false); | 680 mailbox, std::move(release_callback_impl), false); |
| 680 } | 681 } |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 } | 1025 } |
| 1025 | 1026 |
| 1026 ResourceProvider::ScopedReadLockGL::ScopedReadLockGL( | 1027 ResourceProvider::ScopedReadLockGL::ScopedReadLockGL( |
| 1027 ResourceProvider* resource_provider, | 1028 ResourceProvider* resource_provider, |
| 1028 ResourceId resource_id) | 1029 ResourceId resource_id) |
| 1029 : resource_provider_(resource_provider), resource_id_(resource_id) { | 1030 : resource_provider_(resource_provider), resource_id_(resource_id) { |
| 1030 const Resource* resource = resource_provider->LockForRead(resource_id); | 1031 const Resource* resource = resource_provider->LockForRead(resource_id); |
| 1031 texture_id_ = resource->gl_id; | 1032 texture_id_ = resource->gl_id; |
| 1032 target_ = resource->target; | 1033 target_ = resource->target; |
| 1033 size_ = resource->size; | 1034 size_ = resource->size; |
| 1035 color_space_ = resource->color_space; |
| 1034 } | 1036 } |
| 1035 | 1037 |
| 1036 ResourceProvider::ScopedReadLockGL::~ScopedReadLockGL() { | 1038 ResourceProvider::ScopedReadLockGL::~ScopedReadLockGL() { |
| 1037 resource_provider_->UnlockForRead(resource_id_); | 1039 resource_provider_->UnlockForRead(resource_id_); |
| 1038 } | 1040 } |
| 1039 | 1041 |
| 1040 ResourceProvider::ScopedSamplerGL::ScopedSamplerGL( | 1042 ResourceProvider::ScopedSamplerGL::ScopedSamplerGL( |
| 1041 ResourceProvider* resource_provider, | 1043 ResourceProvider* resource_provider, |
| 1042 ResourceId resource_id, | 1044 ResourceId resource_id, |
| 1043 GLenum filter) | 1045 GLenum filter) |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2004 | 2006 |
| 2005 const int kImportance = 2; | 2007 const int kImportance = 2; |
| 2006 pmd->CreateSharedGlobalAllocatorDump(guid); | 2008 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 2007 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2009 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 2008 } | 2010 } |
| 2009 | 2011 |
| 2010 return true; | 2012 return true; |
| 2011 } | 2013 } |
| 2012 | 2014 |
| 2013 } // namespace cc | 2015 } // namespace cc |
| OLD | NEW |