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

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

Issue 638353002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr in src/… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formating. Created 6 years, 2 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/one_copy_raster_worker_pool.h" 5 #include "cc/resources/one_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 "base/debug/trace_event_argument.h" 10 #include "base/debug/trace_event_argument.h"
(...skipping 13 matching lines...) Expand all
24 RasterBufferImpl(ResourceProvider* resource_provider, 24 RasterBufferImpl(ResourceProvider* resource_provider,
25 ResourcePool* resource_pool, 25 ResourcePool* resource_pool,
26 const Resource* resource) 26 const Resource* resource)
27 : resource_provider_(resource_provider), 27 : resource_provider_(resource_provider),
28 resource_pool_(resource_pool), 28 resource_pool_(resource_pool),
29 resource_(resource), 29 resource_(resource),
30 raster_resource_(resource_pool->AcquireResource(resource->size())), 30 raster_resource_(resource_pool->AcquireResource(resource->size())),
31 lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer( 31 lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer(
32 resource_provider_, 32 resource_provider_,
33 raster_resource_->id())), 33 raster_resource_->id())),
34 buffer_(NULL) {} 34 buffer_(nullptr) {}
35 35
36 virtual ~RasterBufferImpl() { 36 virtual ~RasterBufferImpl() {
37 // First unlock raster resource. 37 // First unlock raster resource.
38 lock_.reset(); 38 lock_.reset();
39 39
40 // Copy contents of raster resource to |resource_|. 40 // Copy contents of raster resource to |resource_|.
41 resource_provider_->CopyResource(raster_resource_->id(), resource_->id()); 41 resource_provider_->CopyResource(raster_resource_->id(), resource_->id());
42 42
43 // Return raster resource to pool so it can be used by another RasterBuffer 43 // Return raster resource to pool so it can be used by another RasterBuffer
44 // instance. 44 // instance.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 resource_pool_->total_memory_usage_bytes()); 271 resource_pool_->total_memory_usage_bytes());
272 staging_state->SetInteger("pending_copy_count", 272 staging_state->SetInteger("pending_copy_count",
273 resource_pool_->total_resource_count() - 273 resource_pool_->total_resource_count() -
274 resource_pool_->acquired_resource_count()); 274 resource_pool_->acquired_resource_count());
275 staging_state->SetInteger("bytes_pending_copy", 275 staging_state->SetInteger("bytes_pending_copy",
276 resource_pool_->total_memory_usage_bytes() - 276 resource_pool_->total_memory_usage_bytes() -
277 resource_pool_->acquired_memory_usage_bytes()); 277 resource_pool_->acquired_memory_usage_bytes());
278 } 278 }
279 279
280 } // namespace cc 280 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698