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

Side by Side Diff: mojo/gles2/command_buffer_client_impl.cc

Issue 1340983002: Mandoline UI Process: Update namespaces and file names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 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 | « mojo/cc/output_surface_mojo.cc ('k') | mojo/runner/android/main.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 "mojo/gles2/command_buffer_client_impl.h" 5 #include "mojo/gles2/command_buffer_client_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 last_state_.error = gpu::error::kLostContext; 231 last_state_.error = gpu::error::kLostContext;
232 return NULL; 232 return NULL;
233 } 233 }
234 234
235 *id = ++next_transfer_buffer_id_; 235 *id = ++next_transfer_buffer_id_;
236 236
237 command_buffer_->RegisterTransferBuffer( 237 command_buffer_->RegisterTransferBuffer(
238 *id, duped.Pass(), static_cast<uint32_t>(size)); 238 *id, duped.Pass(), static_cast<uint32_t>(size));
239 239
240 scoped_ptr<gpu::BufferBacking> backing( 240 scoped_ptr<gpu::BufferBacking> backing(
241 new MojoBufferBacking(handle.Pass(), memory, size)); 241 new mus::MojoBufferBacking(handle.Pass(), memory, size));
242 scoped_refptr<gpu::Buffer> buffer(new gpu::Buffer(backing.Pass())); 242 scoped_refptr<gpu::Buffer> buffer(new gpu::Buffer(backing.Pass()));
243 return buffer; 243 return buffer;
244 } 244 }
245 245
246 void CommandBufferClientImpl::DestroyTransferBuffer(int32 id) { 246 void CommandBufferClientImpl::DestroyTransferBuffer(int32 id) {
247 command_buffer_->DestroyTransferBuffer(id); 247 command_buffer_->DestroyTransferBuffer(id);
248 } 248 }
249 249
250 gpu::Capabilities CommandBufferClientImpl::GetCapabilities() { 250 gpu::Capabilities CommandBufferClientImpl::GetCapabilities() {
251 return capabilities_; 251 return capabilities_;
252 } 252 }
253 253
254 int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer, 254 int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer,
255 size_t width, 255 size_t width,
256 size_t height, 256 size_t height,
257 unsigned internalformat) { 257 unsigned internalformat) {
258 int32 new_id = ++next_image_id_; 258 int32 new_id = ++next_image_id_;
259 259
260 mojo::SizePtr size = mojo::Size::New(); 260 mojo::SizePtr size = mojo::Size::New();
261 size->width = static_cast<int32_t>(width); 261 size->width = static_cast<int32_t>(width);
262 size->height = static_cast<int32_t>(height); 262 size->height = static_cast<int32_t>(height);
263 263
264 MojoGpuMemoryBufferImpl* gpu_memory_buffer = 264 mus::MojoGpuMemoryBufferImpl* gpu_memory_buffer =
265 MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); 265 mus::MojoGpuMemoryBufferImpl::FromClientBuffer(buffer);
266 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle(); 266 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle();
267 267
268 bool requires_sync_point = false; 268 bool requires_sync_point = false;
269 base::SharedMemoryHandle dupd_handle = 269 base::SharedMemoryHandle dupd_handle =
270 base::SharedMemory::DuplicateHandle(handle.handle); 270 base::SharedMemory::DuplicateHandle(handle.handle);
271 #if defined(OS_WIN) 271 #if defined(OS_WIN)
272 HANDLE platform_handle = dupd_handle; 272 HANDLE platform_handle = dupd_handle;
273 #else 273 #else
274 int platform_handle = dupd_handle.fd; 274 int platform_handle = dupd_handle.fd;
275 #endif 275 #endif
(...skipping 29 matching lines...) Expand all
305 305
306 void CommandBufferClientImpl::DestroyImage(int32 id) { 306 void CommandBufferClientImpl::DestroyImage(int32 id) {
307 command_buffer_->DestroyImage(id); 307 command_buffer_->DestroyImage(id);
308 } 308 }
309 309
310 int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage( 310 int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage(
311 size_t width, 311 size_t width,
312 size_t height, 312 size_t height,
313 unsigned internalformat, 313 unsigned internalformat,
314 unsigned usage) { 314 unsigned usage) {
315 scoped_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( 315 scoped_ptr<gfx::GpuMemoryBuffer> buffer(mus::MojoGpuMemoryBufferImpl::Create(
316 gfx::Size(static_cast<int>(width), static_cast<int>(height)), 316 gfx::Size(static_cast<int>(width), static_cast<int>(height)),
317 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), 317 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat),
318 gpu::ImageFactory::ImageUsageToGpuMemoryBufferUsage(usage))); 318 gpu::ImageFactory::ImageUsageToGpuMemoryBufferUsage(usage)));
319 if (!buffer) 319 if (!buffer)
320 return -1; 320 return -1;
321 321
322 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); 322 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat);
323 } 323 }
324 324
325 uint32_t CommandBufferClientImpl::InsertSyncPoint() { 325 uint32_t CommandBufferClientImpl::InsertSyncPoint() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 387
388 void CommandBufferClientImpl::SetLock(base::Lock* lock) { 388 void CommandBufferClientImpl::SetLock(base::Lock* lock) {
389 } 389 }
390 390
391 bool CommandBufferClientImpl::IsGpuChannelLost() { 391 bool CommandBufferClientImpl::IsGpuChannelLost() {
392 // This is only possible for out-of-process command buffers. 392 // This is only possible for out-of-process command buffers.
393 return false; 393 return false;
394 } 394 }
395 395
396 } // namespace gles2 396 } // namespace gles2
OLDNEW
« no previous file with comments | « mojo/cc/output_surface_mojo.cc ('k') | mojo/runner/android/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698