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

Side by Side Diff: components/mus/gles2/command_buffer_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/gles2/command_buffer_impl.h" 5 #include "components/mus/gles2/command_buffer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "components/mus/gles2/command_buffer_driver.h" 10 #include "components/mus/gles2/command_buffer_driver.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void CommandBufferImpl::DestroyTransferBuffer(int32_t id) { 108 void CommandBufferImpl::DestroyTransferBuffer(int32_t id) {
109 gpu_state_->command_buffer_task_runner()->PostTask( 109 gpu_state_->command_buffer_task_runner()->PostTask(
110 driver_.get(), 110 driver_.get(),
111 base::Bind(&CommandBufferImpl::DestroyTransferBufferOnGpuThread, 111 base::Bind(&CommandBufferImpl::DestroyTransferBufferOnGpuThread,
112 base::Unretained(this), id)); 112 base::Unretained(this), id));
113 } 113 }
114 114
115 void CommandBufferImpl::CreateImage(int32_t id, 115 void CommandBufferImpl::CreateImage(int32_t id,
116 mojo::ScopedHandle memory_handle, 116 mojo::ScopedHandle memory_handle,
117 int32_t type, 117 int32_t type,
118 mojo::SizePtr size, 118 const gfx::Size& size,
119 int32_t format, 119 int32_t format,
120 int32_t internal_format) { 120 int32_t internal_format) {
121 gpu_state_->command_buffer_task_runner()->PostTask( 121 gpu_state_->command_buffer_task_runner()->PostTask(
122 driver_.get(), 122 driver_.get(),
123 base::Bind(&CommandBufferImpl::CreateImageOnGpuThread, 123 base::Bind(&CommandBufferImpl::CreateImageOnGpuThread,
124 base::Unretained(this), id, base::Passed(&memory_handle), type, 124 base::Unretained(this), id, base::Passed(&memory_handle), type,
125 base::Passed(&size), format, internal_format)); 125 size, format, internal_format));
126 } 126 }
127 127
128 void CommandBufferImpl::DestroyImage(int32_t id) { 128 void CommandBufferImpl::DestroyImage(int32_t id) {
129 gpu_state_->command_buffer_task_runner()->PostTask( 129 gpu_state_->command_buffer_task_runner()->PostTask(
130 driver_.get(), base::Bind(&CommandBufferImpl::DestroyImageOnGpuThread, 130 driver_.get(), base::Bind(&CommandBufferImpl::DestroyImageOnGpuThread,
131 base::Unretained(this), id)); 131 base::Unretained(this), id));
132 } 132 }
133 133
134 void CommandBufferImpl::CreateStreamTexture( 134 void CommandBufferImpl::CreateStreamTexture(
135 uint32_t client_texture_id, 135 uint32_t client_texture_id,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 bool CommandBufferImpl::DestroyTransferBufferOnGpuThread(int32_t id) { 244 bool CommandBufferImpl::DestroyTransferBufferOnGpuThread(int32_t id) {
245 DCHECK(driver_->IsScheduled()); 245 DCHECK(driver_->IsScheduled());
246 driver_->DestroyTransferBuffer(id); 246 driver_->DestroyTransferBuffer(id);
247 return true; 247 return true;
248 } 248 }
249 249
250 bool CommandBufferImpl::CreateImageOnGpuThread(int32_t id, 250 bool CommandBufferImpl::CreateImageOnGpuThread(int32_t id,
251 mojo::ScopedHandle memory_handle, 251 mojo::ScopedHandle memory_handle,
252 int32_t type, 252 int32_t type,
253 mojo::SizePtr size, 253 const gfx::Size& size,
254 int32_t format, 254 int32_t format,
255 int32_t internal_format) { 255 int32_t internal_format) {
256 DCHECK(driver_->IsScheduled()); 256 DCHECK(driver_->IsScheduled());
257 driver_->CreateImage(id, std::move(memory_handle), type, std::move(size), 257 driver_->CreateImage(id, std::move(memory_handle), type, std::move(size),
258 format, internal_format); 258 format, internal_format);
259 return true; 259 return true;
260 } 260 }
261 261
262 bool CommandBufferImpl::DestroyImageOnGpuThread(int32_t id) { 262 bool CommandBufferImpl::DestroyImageOnGpuThread(int32_t id) {
263 DCHECK(driver_->IsScheduled()); 263 DCHECK(driver_->IsScheduled());
(...skipping 25 matching lines...) Expand all
289 bool CommandBufferImpl::DeleteOnGpuThread() { 289 bool CommandBufferImpl::DeleteOnGpuThread() {
290 delete this; 290 delete this;
291 return true; 291 return true;
292 } 292 }
293 293
294 void CommandBufferImpl::DeleteOnGpuThread2() { 294 void CommandBufferImpl::DeleteOnGpuThread2() {
295 delete this; 295 delete this;
296 } 296 }
297 297
298 } // namespace mus 298 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698