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

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

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/prioritized_resource.h ('k') | cc/resources/prioritized_resource_manager.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/prioritized_resource.h" 5 #include "cc/resources/prioritized_resource.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/resources/platform_color.h" 9 #include "cc/resources/platform_color.h"
10 #include "cc/resources/prioritized_resource_manager.h" 10 #include "cc/resources/prioritized_resource_manager.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 PrioritizedResource::Backing::Backing(unsigned id, 119 PrioritizedResource::Backing::Backing(unsigned id,
120 ResourceProvider* resource_provider, 120 ResourceProvider* resource_provider,
121 const gfx::Size& size, 121 const gfx::Size& size,
122 ResourceFormat format) 122 ResourceFormat format)
123 : Resource(id, size, format), 123 : Resource(id, size, format),
124 owner_(NULL), 124 owner_(NULL),
125 priority_at_last_priority_update_(PriorityCalculator::LowestPriority()), 125 priority_at_last_priority_update_(PriorityCalculator::LowestPriority()),
126 was_above_priority_cutoff_at_last_priority_update_(false), 126 was_above_priority_cutoff_at_last_priority_update_(false),
127 in_drawing_impl_tree_(false), 127 in_drawing_impl_tree_(false),
128 in_parent_compositor_(false), 128 in_parent_compositor_(false),
129 #if !DCHECK_IS_ON 129 #if !DCHECK_IS_ON()
130 resource_has_been_deleted_(false) { 130 resource_has_been_deleted_(false) {
131 #else 131 #else
132 resource_has_been_deleted_(false), 132 resource_has_been_deleted_(false),
133 resource_provider_(resource_provider) { 133 resource_provider_(resource_provider) {
134 #endif 134 #endif
135 } 135 }
136 136
137 PrioritizedResource::Backing::~Backing() { 137 PrioritizedResource::Backing::~Backing() {
138 DCHECK(!owner_); 138 DCHECK(!owner_);
139 DCHECK(resource_has_been_deleted_); 139 DCHECK(resource_has_been_deleted_);
140 } 140 }
141 141
142 void PrioritizedResource::Backing::DeleteResource( 142 void PrioritizedResource::Backing::DeleteResource(
143 ResourceProvider* resource_provider) { 143 ResourceProvider* resource_provider) {
144 DCHECK(!proxy() || proxy()->IsImplThread()); 144 DCHECK(!proxy() || proxy()->IsImplThread());
145 DCHECK(!resource_has_been_deleted_); 145 DCHECK(!resource_has_been_deleted_);
146 #if DCHECK_IS_ON 146 #if DCHECK_IS_ON()
147 DCHECK(resource_provider == resource_provider_); 147 DCHECK(resource_provider == resource_provider_);
148 #endif 148 #endif
149 149
150 resource_provider->DeleteResource(id()); 150 resource_provider->DeleteResource(id());
151 set_id(0); 151 set_id(0);
152 resource_has_been_deleted_ = true; 152 resource_has_been_deleted_ = true;
153 } 153 }
154 154
155 bool PrioritizedResource::Backing::ResourceHasBeenDeleted() const { 155 bool PrioritizedResource::Backing::ResourceHasBeenDeleted() const {
156 DCHECK(!proxy() || proxy()->IsImplThread()); 156 DCHECK(!proxy() || proxy()->IsImplThread());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 manager_->ReturnBackingTexture(this); 194 manager_->ReturnBackingTexture(this);
195 } 195 }
196 196
197 const Proxy* PrioritizedResource::Backing::proxy() const { 197 const Proxy* PrioritizedResource::Backing::proxy() const {
198 if (!owner_ || !owner_->resource_manager()) 198 if (!owner_ || !owner_->resource_manager())
199 return NULL; 199 return NULL;
200 return owner_->resource_manager()->ProxyForDebug(); 200 return owner_->resource_manager()->ProxyForDebug();
201 } 201 }
202 202
203 } // namespace cc 203 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/prioritized_resource.h ('k') | cc/resources/prioritized_resource_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698