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

Unified Diff: gpu/command_buffer/service/memory_program_cache.cc

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/memory_program_cache.cc
diff --git a/gpu/command_buffer/service/memory_program_cache.cc b/gpu/command_buffer/service/memory_program_cache.cc
index ced200d57e0481fdb289ae62ac9650bb02cc1c48..4cd3fd2edc00fe1c943871ac19e94fa8e72245d6 100644
--- a/gpu/command_buffer/service/memory_program_cache.cc
+++ b/gpu/command_buffer/service/memory_program_cache.cc
@@ -214,7 +214,7 @@ ProgramCache::ProgramLoadResult MemoryProgramCache::LoadLinkedProgram(
shader_b->set_output_variable_list(value->output_variable_list_1());
if (!shader_callback.is_null() && !disable_gpu_shader_disk_cache_) {
- scoped_ptr<GpuProgramProto> proto(
+ std::unique_ptr<GpuProgramProto> proto(
GpuProgramProto::default_instance().New());
proto->set_sha(sha, kHashLength);
proto->set_format(value->format());
@@ -242,7 +242,7 @@ void MemoryProgramCache::SaveLinkedProgram(
if (length == 0 || static_cast<unsigned int>(length) > max_size_bytes_) {
return;
}
- scoped_ptr<char[]> binary(new char[length]);
+ std::unique_ptr<char[]> binary(new char[length]);
glGetProgramBinary(program,
length,
NULL,
@@ -283,7 +283,7 @@ void MemoryProgramCache::SaveLinkedProgram(
}
if (!shader_callback.is_null() && !disable_gpu_shader_disk_cache_) {
- scoped_ptr<GpuProgramProto> proto(
+ std::unique_ptr<GpuProgramProto> proto(
GpuProgramProto::default_instance().New());
proto->set_sha(sha, kHashLength);
proto->set_format(format);
@@ -308,7 +308,8 @@ void MemoryProgramCache::SaveLinkedProgram(
}
void MemoryProgramCache::LoadProgram(const std::string& program) {
- scoped_ptr<GpuProgramProto> proto(GpuProgramProto::default_instance().New());
+ std::unique_ptr<GpuProgramProto> proto(
+ GpuProgramProto::default_instance().New());
if (proto->ParseFromString(program)) {
AttributeMap vertex_attribs;
UniformMap vertex_uniforms;
@@ -353,7 +354,7 @@ void MemoryProgramCache::LoadProgram(const std::string& program) {
&fragment_output_variables);
}
- scoped_ptr<char[]> binary(new char[proto->program().length()]);
+ std::unique_ptr<char[]> binary(new char[proto->program().length()]);
memcpy(binary.get(), proto->program().c_str(), proto->program().length());
store_.Put(
« no previous file with comments | « gpu/command_buffer/service/memory_program_cache.h ('k') | gpu/command_buffer/service/memory_program_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698