| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_local.h" | 5 #include "components/mus/gles2/command_buffer_local.h" |
| 6 | 6 |
| 7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); | 286 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); |
| 287 scoped_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( | 287 scoped_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( |
| 288 gfx::Size(static_cast<int>(width), static_cast<int>(height)), | 288 gfx::Size(static_cast<int>(width), static_cast<int>(height)), |
| 289 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internal_format), | 289 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internal_format), |
| 290 gfx::BufferUsage::SCANOUT)); | 290 gfx::BufferUsage::SCANOUT)); |
| 291 if (!buffer) | 291 if (!buffer) |
| 292 return -1; | 292 return -1; |
| 293 return CreateImage(buffer->AsClientBuffer(), width, height, internal_format); | 293 return CreateImage(buffer->AsClientBuffer(), width, height, internal_format); |
| 294 } | 294 } |
| 295 | 295 |
| 296 uint32_t CommandBufferLocal::InsertSyncPoint() { | |
| 297 NOTREACHED(); | |
| 298 return 0; | |
| 299 } | |
| 300 | |
| 301 uint32_t CommandBufferLocal::InsertFutureSyncPoint() { | |
| 302 NOTREACHED(); | |
| 303 return 0; | |
| 304 } | |
| 305 | |
| 306 void CommandBufferLocal::RetireSyncPoint(uint32_t sync_point) { | |
| 307 NOTREACHED(); | |
| 308 } | |
| 309 | |
| 310 void CommandBufferLocal::SignalSyncPoint(uint32_t sync_point, | |
| 311 const base::Closure& callback) { | |
| 312 NOTREACHED(); | |
| 313 } | |
| 314 | |
| 315 void CommandBufferLocal::SignalQuery(uint32_t query_id, | 296 void CommandBufferLocal::SignalQuery(uint32_t query_id, |
| 316 const base::Closure& callback) { | 297 const base::Closure& callback) { |
| 317 DCHECK(CalledOnValidThread()); | 298 DCHECK(CalledOnValidThread()); |
| 318 | 299 |
| 319 gpu_state_->command_buffer_task_runner()->PostTask( | 300 gpu_state_->command_buffer_task_runner()->PostTask( |
| 320 driver_.get(), base::Bind(&CommandBufferLocal::SignalQueryOnGpuThread, | 301 driver_.get(), base::Bind(&CommandBufferLocal::SignalQueryOnGpuThread, |
| 321 base::Unretained(this), query_id, callback)); | 302 base::Unretained(this), query_id, callback)); |
| 322 } | 303 } |
| 323 | 304 |
| 324 void CommandBufferLocal::SetLock(base::Lock* lock) { | 305 void CommandBufferLocal::SetLock(base::Lock* lock) { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 client_->DidLoseContext(); | 524 client_->DidLoseContext(); |
| 544 } | 525 } |
| 545 | 526 |
| 546 void CommandBufferLocal::UpdateVSyncParametersOnClientThread(int64_t timebase, | 527 void CommandBufferLocal::UpdateVSyncParametersOnClientThread(int64_t timebase, |
| 547 int64_t interval) { | 528 int64_t interval) { |
| 548 if (client_) | 529 if (client_) |
| 549 client_->UpdateVSyncParameters(timebase, interval); | 530 client_->UpdateVSyncParameters(timebase, interval); |
| 550 } | 531 } |
| 551 | 532 |
| 552 } // namespace mus | 533 } // namespace mus |
| OLD | NEW |