| OLD | NEW |
| 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 "components/mus/public/cpp/lib/command_buffer_client_impl.h" | 5 #include "components/mus/public/cpp/lib/command_buffer_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 client_binding_(this), | 70 client_binding_(this), |
| 71 command_buffer_(std::move(command_buffer_ptr)), | 71 command_buffer_(std::move(command_buffer_ptr)), |
| 72 command_buffer_id_(), | 72 command_buffer_id_(), |
| 73 shared_state_(NULL), | 73 shared_state_(NULL), |
| 74 last_put_offset_(-1), | 74 last_put_offset_(-1), |
| 75 next_transfer_buffer_id_(0), | 75 next_transfer_buffer_id_(0), |
| 76 next_image_id_(0), | 76 next_image_id_(0), |
| 77 next_fence_sync_release_(1), | 77 next_fence_sync_release_(1), |
| 78 flushed_fence_sync_release_(0) { | 78 flushed_fence_sync_release_(0) { |
| 79 command_buffer_.set_connection_error_handler( | 79 command_buffer_.set_connection_error_handler( |
| 80 [this]() { Destroyed(gpu::error::kUnknown, gpu::error::kLostContext); }); | 80 base::Bind(&CommandBufferClientImpl::Destroyed, base::Unretained(this), |
| 81 gpu::error::kUnknown, gpu::error::kLostContext)); |
| 81 } | 82 } |
| 82 | 83 |
| 83 CommandBufferClientImpl::~CommandBufferClientImpl() {} | 84 CommandBufferClientImpl::~CommandBufferClientImpl() {} |
| 84 | 85 |
| 85 bool CommandBufferClientImpl::Initialize() { | 86 bool CommandBufferClientImpl::Initialize() { |
| 86 const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); | 87 const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); |
| 87 void* memory = NULL; | 88 void* memory = NULL; |
| 88 mojo::ScopedSharedBufferHandle duped; | 89 mojo::ScopedSharedBufferHandle duped; |
| 89 bool result = CreateMapAndDupSharedBuffer(kSharedStateSize, &memory, | 90 bool result = CreateMapAndDupSharedBuffer(kSharedStateSize, &memory, |
| 90 &shared_state_handle_, &duped); | 91 &shared_state_handle_, &duped); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 375 |
| 375 // It is also safe to wait on the same context. | 376 // It is also safe to wait on the same context. |
| 376 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && | 377 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && |
| 377 sync_token->command_buffer_id() == GetCommandBufferID()) | 378 sync_token->command_buffer_id() == GetCommandBufferID()) |
| 378 return true; | 379 return true; |
| 379 | 380 |
| 380 return false; | 381 return false; |
| 381 } | 382 } |
| 382 | 383 |
| 383 } // namespace mus | 384 } // namespace mus |
| OLD | NEW |