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

Side by Side Diff: components/exo/shared_memory.cc

Issue 2257793002: 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, 3 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 | « components/exo/display.cc ('k') | components/exo/shared_memory_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shared_memory.h" 5 #include "components/exo/shared_memory.h"
6 6
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (!gpu_memory_buffer) { 77 if (!gpu_memory_buffer) {
78 LOG(ERROR) << "Failed to create GpuMemoryBuffer from handle"; 78 LOG(ERROR) << "Failed to create GpuMemoryBuffer from handle";
79 return nullptr; 79 return nullptr;
80 } 80 }
81 81
82 // Zero-copy doesn't provide a benefit in the case of shared memory as an 82 // Zero-copy doesn't provide a benefit in the case of shared memory as an
83 // implicit copy is required when trying to use these buffers as zero-copy 83 // implicit copy is required when trying to use these buffers as zero-copy
84 // buffers. Making the copy explicit allows the buffer to be reused earlier. 84 // buffers. Making the copy explicit allows the buffer to be reused earlier.
85 bool use_zero_copy = false; 85 bool use_zero_copy = false;
86 86
87 return base::WrapUnique( 87 return base::MakeUnique<Buffer>(
88 new Buffer(std::move(gpu_memory_buffer), GL_TEXTURE_2D, 88 std::move(gpu_memory_buffer), GL_TEXTURE_2D,
89 // COMMANDS_ISSUED queries are sufficient for shared memory 89 // COMMANDS_ISSUED queries are sufficient for shared memory
90 // buffers as binding to texture is implemented using a call to 90 // buffers as binding to texture is implemented using a call to
91 // glTexImage2D and the buffer can be reused as soon as that 91 // glTexImage2D and the buffer can be reused as soon as that
92 // command has been issued. 92 // command has been issued.
93 GL_COMMANDS_ISSUED_CHROMIUM, use_zero_copy, 93 GL_COMMANDS_ISSUED_CHROMIUM, use_zero_copy,
94 false /* is_overlay_candidate */)); 94 false /* is_overlay_candidate */);
95 } 95 }
96 96
97 } // namespace exo 97 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/display.cc ('k') | components/exo/shared_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698