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

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

Issue 793693003: Tile Compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/managed_tile_state.h ('k') | cc/resources/picture_layer_tiling.h » ('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 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_tile_task_worker_pool.h" 5 #include "cc/resources/one_copy_tile_task_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 12 matching lines...) Expand all
23 class RasterBufferImpl : public RasterBuffer { 23 class RasterBufferImpl : public RasterBuffer {
24 public: 24 public:
25 RasterBufferImpl(OneCopyTileTaskWorkerPool* worker_pool, 25 RasterBufferImpl(OneCopyTileTaskWorkerPool* worker_pool,
26 ResourceProvider* resource_provider, 26 ResourceProvider* resource_provider,
27 ResourcePool* resource_pool, 27 ResourcePool* resource_pool,
28 const Resource* resource) 28 const Resource* resource)
29 : worker_pool_(worker_pool), 29 : worker_pool_(worker_pool),
30 resource_provider_(resource_provider), 30 resource_provider_(resource_provider),
31 resource_pool_(resource_pool), 31 resource_pool_(resource_pool),
32 resource_(resource), 32 resource_(resource),
33 raster_resource_(resource_pool->AcquireResource(resource->size())), 33 raster_resource_(resource_pool->AcquireResource(resource->size(),
34 resource->format())),
34 lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer( 35 lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer(
35 resource_provider_, 36 resource_provider_,
36 raster_resource_->id())), 37 raster_resource_->id())),
37 sequence_(0) {} 38 sequence_(0) {}
38 39
39 ~RasterBufferImpl() override { 40 ~RasterBufferImpl() override {
40 // Release write lock in case a copy was never scheduled. 41 // Release write lock in case a copy was never scheduled.
41 lock_.reset(); 42 lock_.reset();
42 43
43 // Make sure any scheduled copy operations are issued before we release the 44 // Make sure any scheduled copy operations are issued before we release the
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 task->CompleteOnOriginThread(this); 243 task->CompleteOnOriginThread(this);
243 task->DidComplete(); 244 task->DidComplete();
244 245
245 task->RunReplyOnOriginThread(); 246 task->RunReplyOnOriginThread();
246 } 247 }
247 completed_tasks_.clear(); 248 completed_tasks_.clear();
248 } 249 }
249 250
250 scoped_ptr<RasterBuffer> OneCopyTileTaskWorkerPool::AcquireBufferForRaster( 251 scoped_ptr<RasterBuffer> OneCopyTileTaskWorkerPool::AcquireBufferForRaster(
251 const Resource* resource) { 252 const Resource* resource) {
252 DCHECK_EQ(resource->format(), resource_pool_->resource_format());
253 return make_scoped_ptr<RasterBuffer>( 253 return make_scoped_ptr<RasterBuffer>(
254 new RasterBufferImpl(this, resource_provider_, resource_pool_, resource)); 254 new RasterBufferImpl(this, resource_provider_, resource_pool_, resource));
255 } 255 }
256 256
257 void OneCopyTileTaskWorkerPool::ReleaseBufferForRaster( 257 void OneCopyTileTaskWorkerPool::ReleaseBufferForRaster(
258 scoped_ptr<RasterBuffer> buffer) { 258 scoped_ptr<RasterBuffer> buffer) {
259 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. 259 // Nothing to do here. RasterBufferImpl destructor cleans up after itself.
260 } 260 }
261 261
262 CopySequenceNumber 262 CopySequenceNumber
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 resource_pool_->total_memory_usage_bytes()); 482 resource_pool_->total_memory_usage_bytes());
483 staging_state->SetInteger("pending_copy_count", 483 staging_state->SetInteger("pending_copy_count",
484 resource_pool_->total_resource_count() - 484 resource_pool_->total_resource_count() -
485 resource_pool_->acquired_resource_count()); 485 resource_pool_->acquired_resource_count());
486 staging_state->SetInteger("bytes_pending_copy", 486 staging_state->SetInteger("bytes_pending_copy",
487 resource_pool_->total_memory_usage_bytes() - 487 resource_pool_->total_memory_usage_bytes() -
488 resource_pool_->acquired_memory_usage_bytes()); 488 resource_pool_->acquired_memory_usage_bytes());
489 } 489 }
490 490
491 } // namespace cc 491 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/managed_tile_state.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698