Chromium Code Reviews| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 gpu::Capabilities CommandBufferClientImpl::GetCapabilities() { | 206 gpu::Capabilities CommandBufferClientImpl::GetCapabilities() { |
| 207 return capabilities_; | 207 return capabilities_; |
| 208 } | 208 } |
| 209 | 209 |
| 210 int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer, | 210 int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer, |
| 211 size_t width, | 211 size_t width, |
| 212 size_t height, | 212 size_t height, |
| 213 unsigned internalformat) { | 213 unsigned internalformat) { |
| 214 int32_t new_id = ++next_image_id_; | 214 int32_t new_id = ++next_image_id_; |
| 215 | 215 |
| 216 mojo::SizePtr size = mojo::Size::New(); | 216 gfx::Size size(static_cast<int32_t>(width), static_cast<int32_t>(height)); |
|
dcheng
2016/05/26 22:20:40
Not related to your change but I wonder why this f
| |
| 217 size->width = static_cast<int32_t>(width); | |
| 218 size->height = static_cast<int32_t>(height); | |
| 219 | 217 |
| 220 mus::MojoGpuMemoryBufferImpl* gpu_memory_buffer = | 218 mus::MojoGpuMemoryBufferImpl* gpu_memory_buffer = |
| 221 mus::MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); | 219 mus::MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); |
| 222 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle(); | 220 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle(); |
| 223 | 221 |
| 224 bool requires_sync_point = false; | 222 bool requires_sync_point = false; |
| 225 if (handle.type != gfx::SHARED_MEMORY_BUFFER) { | 223 if (handle.type != gfx::SHARED_MEMORY_BUFFER) { |
| 226 requires_sync_point = true; | 224 requires_sync_point = true; |
| 227 NOTIMPLEMENTED(); | 225 NOTIMPLEMENTED(); |
| 228 return -1; | 226 return -1; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 | 367 |
| 370 // It is also safe to wait on the same context. | 368 // It is also safe to wait on the same context. |
| 371 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && | 369 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && |
| 372 sync_token->command_buffer_id() == GetCommandBufferID()) | 370 sync_token->command_buffer_id() == GetCommandBufferID()) |
| 373 return true; | 371 return true; |
| 374 | 372 |
| 375 return false; | 373 return false; |
| 376 } | 374 } |
| 377 | 375 |
| 378 } // namespace mus | 376 } // namespace mus |
| OLD | NEW |