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

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

Issue 645943002: cc: Move GpuMemoryBuffer allocation to worker threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chromium-image-refactor
Patch Set: address review feedback Created 6 years, 1 month 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 | « no previous file | cc/resources/resource_provider.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_raster_worker_pool.h" 5 #include "cc/resources/one_copy_raster_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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Return raster resource to pool so it can be used by another RasterBuffer 48 // Return raster resource to pool so it can be used by another RasterBuffer
49 // instance. 49 // instance.
50 resource_pool_->ReleaseResource(raster_resource_.Pass()); 50 resource_pool_->ReleaseResource(raster_resource_.Pass());
51 } 51 }
52 52
53 // Overridden from RasterBuffer: 53 // Overridden from RasterBuffer:
54 void Playback(const PicturePileImpl* picture_pile, 54 void Playback(const PicturePileImpl* picture_pile,
55 const gfx::Rect& rect, 55 const gfx::Rect& rect,
56 float scale, 56 float scale,
57 RenderingStatsInstrumentation* stats) override { 57 RenderingStatsInstrumentation* stats) override {
58 gfx::GpuMemoryBuffer* gpu_memory_buffer = lock_->gpu_memory_buffer(); 58 gfx::GpuMemoryBuffer* gpu_memory_buffer = lock_->GetGpuMemoryBuffer();
59 if (!gpu_memory_buffer) 59 if (!gpu_memory_buffer)
60 return; 60 return;
61 61
62 RasterWorkerPool::PlaybackToMemory(gpu_memory_buffer->Map(), 62 RasterWorkerPool::PlaybackToMemory(gpu_memory_buffer->Map(),
63 raster_resource_->format(), 63 raster_resource_->format(),
64 raster_resource_->size(), 64 raster_resource_->size(),
65 gpu_memory_buffer->GetStride(), 65 gpu_memory_buffer->GetStride(),
66 picture_pile, 66 picture_pile,
67 rect, 67 rect,
68 scale, 68 scale,
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 resource_pool_->total_memory_usage_bytes()); 369 resource_pool_->total_memory_usage_bytes());
370 staging_state->SetInteger("pending_copy_count", 370 staging_state->SetInteger("pending_copy_count",
371 resource_pool_->total_resource_count() - 371 resource_pool_->total_resource_count() -
372 resource_pool_->acquired_resource_count()); 372 resource_pool_->acquired_resource_count());
373 staging_state->SetInteger("bytes_pending_copy", 373 staging_state->SetInteger("bytes_pending_copy",
374 resource_pool_->total_memory_usage_bytes() - 374 resource_pool_->total_memory_usage_bytes() -
375 resource_pool_->acquired_memory_usage_bytes()); 375 resource_pool_->acquired_memory_usage_bytes());
376 } 376 }
377 377
378 } // namespace cc 378 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698