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

Side by Side Diff: components/mus/gles2/command_buffer_local.cc

Issue 1974163003: Expose GpuMemoryBufferId through glGetImageivCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 7 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 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); 302 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM));
303 std::unique_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( 303 std::unique_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create(
304 gfx::Size(static_cast<int>(width), static_cast<int>(height)), 304 gfx::Size(static_cast<int>(width), static_cast<int>(height)),
305 gpu::DefaultBufferFormatForImageFormat(internal_format), 305 gpu::DefaultBufferFormatForImageFormat(internal_format),
306 gfx::BufferUsage::SCANOUT)); 306 gfx::BufferUsage::SCANOUT));
307 if (!buffer) 307 if (!buffer)
308 return -1; 308 return -1;
309 return CreateImage(buffer->AsClientBuffer(), width, height, internal_format); 309 return CreateImage(buffer->AsClientBuffer(), width, height, internal_format);
310 } 310 }
311 311
312 int32_t CommandBufferLocal::GetImageGpuMemoryBufferId(unsigned image_id) {
313 // TODO(erikchen): Once this class supports IOSurface GpuMemoryBuffer backed
314 // images, it will also need to keep a local cache from image id to
315 // GpuMemoryBuffer id.
316 NOTIMPLEMENTED();
317 return -1;
318 }
319
312 void CommandBufferLocal::SignalQuery(uint32_t query_id, 320 void CommandBufferLocal::SignalQuery(uint32_t query_id,
313 const base::Closure& callback) { 321 const base::Closure& callback) {
314 DCHECK(CalledOnValidThread()); 322 DCHECK(CalledOnValidThread());
315 323
316 gpu_state_->command_buffer_task_runner()->PostTask( 324 gpu_state_->command_buffer_task_runner()->PostTask(
317 driver_.get(), base::Bind(&CommandBufferLocal::SignalQueryOnGpuThread, 325 driver_.get(), base::Bind(&CommandBufferLocal::SignalQueryOnGpuThread,
318 base::Unretained(this), query_id, callback)); 326 base::Unretained(this), query_id, callback));
319 } 327 }
320 328
321 void CommandBufferLocal::SetLock(base::Lock* lock) { 329 void CommandBufferLocal::SetLock(base::Lock* lock) {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 client_->UpdateVSyncParameters(timebase, interval); 575 client_->UpdateVSyncParameters(timebase, interval);
568 } 576 }
569 577
570 void CommandBufferLocal::OnGpuCompletedSwapBuffersOnClientThread( 578 void CommandBufferLocal::OnGpuCompletedSwapBuffersOnClientThread(
571 gfx::SwapResult result) { 579 gfx::SwapResult result) {
572 if (client_) 580 if (client_)
573 client_->GpuCompletedSwapBuffers(result); 581 client_->GpuCompletedSwapBuffers(result);
574 } 582 }
575 583
576 } // namespace mus 584 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gles2/command_buffer_local.h ('k') | components/mus/public/cpp/lib/command_buffer_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698