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

Side by Side Diff: components/mus/gles2/command_buffer_local.cc

Issue 1548113002: Switch to standard integer types in components/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 4 years, 12 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
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/mus/gles2/command_buffer_local.h" 5 #include "components/mus/gles2/command_buffer_local.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "components/mus/gles2/command_buffer_local_client.h" 10 #include "components/mus/gles2/command_buffer_local_client.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 decoder_->SetWaitSyncPointCallback( 106 decoder_->SetWaitSyncPointCallback(
107 base::Bind(&CommandBufferLocal::OnWaitSyncPoint, base::Unretained(this))); 107 base::Bind(&CommandBufferLocal::OnWaitSyncPoint, base::Unretained(this)));
108 decoder_->SetFenceSyncReleaseCallback(base::Bind( 108 decoder_->SetFenceSyncReleaseCallback(base::Bind(
109 &CommandBufferLocal::OnFenceSyncRelease, base::Unretained(this))); 109 &CommandBufferLocal::OnFenceSyncRelease, base::Unretained(this)));
110 decoder_->SetWaitFenceSyncCallback( 110 decoder_->SetWaitFenceSyncCallback(
111 base::Bind(&CommandBufferLocal::OnWaitFenceSync, base::Unretained(this))); 111 base::Bind(&CommandBufferLocal::OnWaitFenceSync, base::Unretained(this)));
112 112
113 gpu::gles2::DisallowedFeatures disallowed_features; 113 gpu::gles2::DisallowedFeatures disallowed_features;
114 114
115 // TODO(piman): attributes. 115 // TODO(piman): attributes.
116 std::vector<int32> attrib_vector; 116 std::vector<int32_t> attrib_vector;
117 if (!decoder_->Initialize(surface_, context_, false /* offscreen */, 117 if (!decoder_->Initialize(surface_, context_, false /* offscreen */,
118 gfx::Size(1, 1), disallowed_features, 118 gfx::Size(1, 1), disallowed_features,
119 attrib_vector)) 119 attrib_vector))
120 return false; 120 return false;
121 121
122 command_buffer_->SetPutOffsetChangeCallback( 122 command_buffer_->SetPutOffsetChangeCallback(
123 base::Bind(&CommandBufferLocal::PumpCommands, base::Unretained(this))); 123 base::Bind(&CommandBufferLocal::PumpCommands, base::Unretained(this)));
124 command_buffer_->SetGetBufferChangeCallback(base::Bind( 124 command_buffer_->SetGetBufferChangeCallback(base::Bind(
125 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get()))); 125 &gpu::GpuScheduler::SetGetBuffer, base::Unretained(scheduler_.get())));
126 command_buffer_->SetParseErrorCallback( 126 command_buffer_->SetParseErrorCallback(
(...skipping 24 matching lines...) Expand all
151 scoped_refptr<gl::GLImageSharedMemory> image(new gl::GLImageSharedMemory( 151 scoped_refptr<gl::GLImageSharedMemory> image(new gl::GLImageSharedMemory(
152 gfx::Size(static_cast<int>(width), static_cast<int>(height)), 152 gfx::Size(static_cast<int>(width), static_cast<int>(height)),
153 internalformat)); 153 internalformat));
154 if (!image->Initialize(base::SharedMemory::DuplicateHandle(handle.handle), 154 if (!image->Initialize(base::SharedMemory::DuplicateHandle(handle.handle),
155 handle.id, gpu_memory_buffer->GetFormat(), 0, 155 handle.id, gpu_memory_buffer->GetFormat(), 0,
156 gfx::RowSizeForBufferFormat( 156 gfx::RowSizeForBufferFormat(
157 width, gpu_memory_buffer->GetFormat(), 0))) { 157 width, gpu_memory_buffer->GetFormat(), 0))) {
158 return -1; 158 return -1;
159 } 159 }
160 160
161 static int32 next_id = 1; 161 static int32_t next_id = 1;
162 int32 new_id = next_id++; 162 int32_t new_id = next_id++;
163 163
164 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); 164 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
165 DCHECK(image_manager); 165 DCHECK(image_manager);
166 image_manager->AddImage(image.get(), new_id); 166 image_manager->AddImage(image.get(), new_id);
167 return new_id; 167 return new_id;
168 } 168 }
169 169
170 void CommandBufferLocal::DestroyImage(int32 id) { 170 void CommandBufferLocal::DestroyImage(int32_t id) {
171 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); 171 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
172 DCHECK(image_manager); 172 DCHECK(image_manager);
173 image_manager->RemoveImage(id); 173 image_manager->RemoveImage(id);
174 } 174 }
175 175
176 int32_t CommandBufferLocal::CreateGpuMemoryBufferImage(size_t width, 176 int32_t CommandBufferLocal::CreateGpuMemoryBufferImage(size_t width,
177 size_t height, 177 size_t height,
178 unsigned internalformat, 178 unsigned internalformat,
179 unsigned usage) { 179 unsigned usage) {
180 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); 180 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM));
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); 340 gpu::CommandBuffer::State state = command_buffer_->GetLastState();
341 OnContextLost(state.context_lost_reason); 341 OnContextLost(state.context_lost_reason);
342 } 342 }
343 343
344 void CommandBufferLocal::OnContextLost(uint32_t reason) { 344 void CommandBufferLocal::OnContextLost(uint32_t reason) {
345 if (client_) 345 if (client_)
346 client_->DidLoseContext(); 346 client_->DidLoseContext();
347 } 347 }
348 348
349 } // namespace mus 349 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gles2/command_buffer_local.h ('k') | components/mus/gles2/command_buffer_local_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698