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

Side by Side Diff: components/mus/public/cpp/lib/command_buffer_client_impl.cc

Issue 2008193002: Change mojo geometry structs from using type converters to StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 gpu::Capabilities CommandBufferClientImpl::GetCapabilities() { 205 gpu::Capabilities CommandBufferClientImpl::GetCapabilities() {
206 return capabilities_; 206 return capabilities_;
207 } 207 }
208 208
209 int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer, 209 int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer,
210 size_t width, 210 size_t width,
211 size_t height, 211 size_t height,
212 unsigned internalformat) { 212 unsigned internalformat) {
213 int32_t new_id = ++next_image_id_; 213 int32_t new_id = ++next_image_id_;
214 214
215 mojo::SizePtr size = mojo::Size::New(); 215 gfx::Size size(static_cast<int32_t>(width), static_cast<int32_t>(height));
216 size->width = static_cast<int32_t>(width);
217 size->height = static_cast<int32_t>(height);
218 216
219 mus::MojoGpuMemoryBufferImpl* gpu_memory_buffer = 217 mus::MojoGpuMemoryBufferImpl* gpu_memory_buffer =
220 mus::MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); 218 mus::MojoGpuMemoryBufferImpl::FromClientBuffer(buffer);
221 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle(); 219 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle();
222 220
223 bool requires_sync_point = false; 221 bool requires_sync_point = false;
224 if (handle.type != gfx::SHARED_MEMORY_BUFFER) { 222 if (handle.type != gfx::SHARED_MEMORY_BUFFER) {
225 requires_sync_point = true; 223 requires_sync_point = true;
226 NOTIMPLEMENTED(); 224 NOTIMPLEMENTED();
227 return -1; 225 return -1;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 374
377 // It is also safe to wait on the same context. 375 // It is also safe to wait on the same context.
378 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO && 376 if (sync_token->namespace_id() == gpu::CommandBufferNamespace::MOJO &&
379 sync_token->command_buffer_id() == GetCommandBufferID()) 377 sync_token->command_buffer_id() == GetCommandBufferID())
380 return true; 378 return true;
381 379
382 return false; 380 return false;
383 } 381 }
384 382
385 } // namespace mus 383 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698