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

Side by Side Diff: cc/raster/one_copy_raster_buffer_provider.cc

Issue 2258833002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/raster/gpu_raster_buffer_provider.cc ('k') | cc/raster/staging_buffer_pool.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 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/raster/one_copy_raster_buffer_provider.h" 5 #include "cc/raster/one_copy_raster_buffer_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 DCHECK(pending_raster_buffers_.empty()); 98 DCHECK(pending_raster_buffers_.empty());
99 } 99 }
100 100
101 std::unique_ptr<RasterBuffer> 101 std::unique_ptr<RasterBuffer>
102 OneCopyRasterBufferProvider::AcquireBufferForRaster( 102 OneCopyRasterBufferProvider::AcquireBufferForRaster(
103 const Resource* resource, 103 const Resource* resource,
104 uint64_t resource_content_id, 104 uint64_t resource_content_id,
105 uint64_t previous_content_id) { 105 uint64_t previous_content_id) {
106 // TODO(danakj): If resource_content_id != 0, we only need to copy/upload 106 // TODO(danakj): If resource_content_id != 0, we only need to copy/upload
107 // the dirty rect. 107 // the dirty rect.
108 return base::WrapUnique(new RasterBufferImpl(this, resource_provider_, 108 return base::MakeUnique<RasterBufferImpl>(this, resource_provider_, resource,
109 resource, previous_content_id, 109 previous_content_id,
110 async_worker_context_enabled_)); 110 async_worker_context_enabled_);
111 } 111 }
112 112
113 void OneCopyRasterBufferProvider::ReleaseBufferForRaster( 113 void OneCopyRasterBufferProvider::ReleaseBufferForRaster(
114 std::unique_ptr<RasterBuffer> buffer) { 114 std::unique_ptr<RasterBuffer> buffer) {
115 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. 115 // Nothing to do here. RasterBufferImpl destructor cleans up after itself.
116 } 116 }
117 117
118 void OneCopyRasterBufferProvider::OrderingBarrier() { 118 void OneCopyRasterBufferProvider::OrderingBarrier() {
119 TRACE_EVENT0("cc", "OneCopyRasterBufferProvider::OrderingBarrier"); 119 TRACE_EVENT0("cc", "OneCopyRasterBufferProvider::OrderingBarrier");
120 120
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 resource_lock->set_synchronized(!async_worker_context_enabled_); 380 resource_lock->set_synchronized(!async_worker_context_enabled_);
381 } 381 }
382 382
383 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { 383 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const {
384 return use_partial_raster_ 384 return use_partial_raster_
385 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT 385 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT
386 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; 386 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
387 } 387 }
388 388
389 } // namespace cc 389 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/gpu_raster_buffer_provider.cc ('k') | cc/raster/staging_buffer_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698