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

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

Issue 375303002: cc: Refactor ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/image_copy_raster_worker_pool.h" 5 #include "cc/resources/image_copy_raster_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/debug/traced_value.h" 10 #include "cc/debug/traced_value.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 "rasterizing", 219 "rasterizing",
220 "state", 220 "state",
221 TracedValue::FromValue(StateAsValue().release())); 221 TracedValue::FromValue(StateAsValue().release()));
222 client_->DidFinishRunningTasksRequiredForActivation(); 222 client_->DidFinishRunningTasksRequiredForActivation();
223 } 223 }
224 224
225 void ImageCopyRasterWorkerPool::FlushCopies() { 225 void ImageCopyRasterWorkerPool::FlushCopies() {
226 if (!has_performed_copy_since_last_flush_) 226 if (!has_performed_copy_since_last_flush_)
227 return; 227 return;
228 228
229 resource_provider_->ShallowFlushIfSupported(); 229 resource_provider_->GetResourceHelper()->ShallowFlushIfSupported();
danakj 2014/07/09 16:01:33 can we just call ShallowFlushCHROMIUM directly her
sohanjg 2014/07/10 15:11:06 Done.
230 has_performed_copy_since_last_flush_ = false; 230 has_performed_copy_since_last_flush_ = false;
231 } 231 }
232 232
233 scoped_ptr<base::Value> ImageCopyRasterWorkerPool::StateAsValue() const { 233 scoped_ptr<base::Value> ImageCopyRasterWorkerPool::StateAsValue() const {
234 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); 234 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue);
235 235
236 state->SetInteger("pending_count", raster_task_states_.size()); 236 state->SetInteger("pending_count", raster_task_states_.size());
237 state->SetBoolean("tasks_required_for_activation_pending", 237 state->SetBoolean("tasks_required_for_activation_pending",
238 raster_tasks_required_for_activation_pending_); 238 raster_tasks_required_for_activation_pending_);
239 state->Set("staging_state", StagingStateAsValue().release()); 239 state->Set("staging_state", StagingStateAsValue().release());
(...skipping 11 matching lines...) Expand all
251 resource_pool_->total_resource_count() - 251 resource_pool_->total_resource_count() -
252 resource_pool_->acquired_resource_count()); 252 resource_pool_->acquired_resource_count());
253 staging_state->SetInteger("bytes_pending_copy", 253 staging_state->SetInteger("bytes_pending_copy",
254 resource_pool_->total_memory_usage_bytes() - 254 resource_pool_->total_memory_usage_bytes() -
255 resource_pool_->acquired_memory_usage_bytes()); 255 resource_pool_->acquired_memory_usage_bytes());
256 256
257 return staging_state.PassAs<base::Value>(); 257 return staging_state.PassAs<base::Value>();
258 } 258 }
259 259
260 } // namespace cc 260 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698