Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: cc/resources/resource_provider.cc

Issue 2607033002: Flush after ResourcePool deletions complete (Closed)
Patch Set: fix |resource_provider_| check Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698