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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 resource->pixels = nullptr; | 840 resource->pixels = nullptr; |
841 } | 841 } |
842 if (resource->gpu_memory_buffer) { | 842 if (resource->gpu_memory_buffer) { |
843 DCHECK(resource->origin == Resource::INTERNAL || | 843 DCHECK(resource->origin == Resource::INTERNAL || |
844 resource->origin == Resource::DELEGATED); | 844 resource->origin == Resource::DELEGATED); |
845 resource->gpu_memory_buffer.reset(); | 845 resource->gpu_memory_buffer.reset(); |
846 } | 846 } |
847 resources_.erase(it); | 847 resources_.erase(it); |
848 } | 848 } |
849 | 849 |
| 850 void ResourceProvider::FlushPendingDeletions() const { |
| 851 if (auto* gl = ContextGL()) |
| 852 gl->ShallowFlushCHROMIUM(); |
| 853 } |
| 854 |
850 ResourceProvider::ResourceType ResourceProvider::GetResourceType( | 855 ResourceProvider::ResourceType ResourceProvider::GetResourceType( |
851 ResourceId id) { | 856 ResourceId id) { |
852 return GetResource(id)->type; | 857 return GetResource(id)->type; |
853 } | 858 } |
854 | 859 |
855 GLenum ResourceProvider::GetResourceTextureTarget(ResourceId id) { | 860 GLenum ResourceProvider::GetResourceTextureTarget(ResourceId id) { |
856 return GetResource(id)->target; | 861 return GetResource(id)->target; |
857 } | 862 } |
858 | 863 |
859 bool ResourceProvider::IsImmutable(ResourceId id) { | 864 bool ResourceProvider::IsImmutable(ResourceId id) { |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 | 2154 |
2150 const int kImportance = 2; | 2155 const int kImportance = 2; |
2151 pmd->CreateSharedGlobalAllocatorDump(guid); | 2156 pmd->CreateSharedGlobalAllocatorDump(guid); |
2152 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2157 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
2153 } | 2158 } |
2154 | 2159 |
2155 return true; | 2160 return true; |
2156 } | 2161 } |
2157 | 2162 |
2158 } // namespace cc | 2163 } // namespace cc |
OLD | NEW |