| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "gpu/command_buffer/service/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/sequence_checker.h" | 18 #include "base/sequence_checker.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
| 21 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 21 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 22 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 22 #include "gpu/command_buffer/common/value_state.h" | 23 #include "gpu/command_buffer/common/value_state.h" |
| 23 #include "gpu/command_buffer/service/command_buffer_service.h" | 24 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 24 #include "gpu/command_buffer/service/context_group.h" | 25 #include "gpu/command_buffer/service/context_group.h" |
| 25 #include "gpu/command_buffer/service/gl_context_virtual.h" | 26 #include "gpu/command_buffer/service/gl_context_virtual.h" |
| 26 #include "gpu/command_buffer/service/gpu_scheduler.h" | 27 #include "gpu/command_buffer/service/gpu_scheduler.h" |
| 27 #include "gpu/command_buffer/service/gpu_switches.h" | 28 #include "gpu/command_buffer/service/gpu_switches.h" |
| 28 #include "gpu/command_buffer/service/image_factory.h" | 29 #include "gpu/command_buffer/service/image_factory.h" |
| 29 #include "gpu/command_buffer/service/image_manager.h" | 30 #include "gpu/command_buffer/service/image_manager.h" |
| 30 #include "gpu/command_buffer/service/mailbox_manager.h" | 31 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 31 #include "gpu/command_buffer/service/memory_program_cache.h" | 32 #include "gpu/command_buffer/service/memory_program_cache.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 176 } |
| 176 | 177 |
| 177 InProcessCommandBuffer::InProcessCommandBuffer( | 178 InProcessCommandBuffer::InProcessCommandBuffer( |
| 178 const scoped_refptr<Service>& service) | 179 const scoped_refptr<Service>& service) |
| 179 : command_buffer_id_(g_next_command_buffer_id.GetNext()), | 180 : command_buffer_id_(g_next_command_buffer_id.GetNext()), |
| 180 context_lost_(false), | 181 context_lost_(false), |
| 181 delayed_work_pending_(false), | 182 delayed_work_pending_(false), |
| 182 image_factory_(nullptr), | 183 image_factory_(nullptr), |
| 183 last_put_offset_(-1), | 184 last_put_offset_(-1), |
| 184 gpu_memory_buffer_manager_(nullptr), | 185 gpu_memory_buffer_manager_(nullptr), |
| 186 next_fence_sync_release_(1), |
| 187 flushed_fence_sync_release_(0), |
| 185 flush_event_(false, false), | 188 flush_event_(false, false), |
| 186 service_(GetInitialService(service)), | 189 service_(GetInitialService(service)), |
| 190 fence_sync_wait_event_(false, false), |
| 187 gpu_thread_weak_ptr_factory_(this) { | 191 gpu_thread_weak_ptr_factory_(this) { |
| 188 DCHECK(service_.get()); | 192 DCHECK(service_.get()); |
| 189 next_image_id_.GetNext(); | 193 next_image_id_.GetNext(); |
| 190 } | 194 } |
| 191 | 195 |
| 192 InProcessCommandBuffer::~InProcessCommandBuffer() { | 196 InProcessCommandBuffer::~InProcessCommandBuffer() { |
| 193 Destroy(); | 197 Destroy(); |
| 194 } | 198 } |
| 195 | 199 |
| 196 void InProcessCommandBuffer::OnResizeView(gfx::Size size, float scale_factor) { | 200 void InProcessCommandBuffer::OnResizeView(gfx::Size size, float scale_factor) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 else | 341 else |
| 338 surface_ = gfx::GLSurface::CreateViewGLSurface(params.window); | 342 surface_ = gfx::GLSurface::CreateViewGLSurface(params.window); |
| 339 } | 343 } |
| 340 | 344 |
| 341 if (!surface_.get()) { | 345 if (!surface_.get()) { |
| 342 LOG(ERROR) << "Could not create GLSurface."; | 346 LOG(ERROR) << "Could not create GLSurface."; |
| 343 DestroyOnGpuThread(); | 347 DestroyOnGpuThread(); |
| 344 return false; | 348 return false; |
| 345 } | 349 } |
| 346 | 350 |
| 347 sync_point_client_state_ = SyncPointClientState::Create(); | 351 sync_point_order_data_ = SyncPointOrderData::Create(); |
| 348 sync_point_client_ = service_->sync_point_manager()->CreateSyncPointClient( | 352 sync_point_client_ = service_->sync_point_manager()->CreateSyncPointClient( |
| 349 sync_point_client_state_, | 353 sync_point_order_data_, GetNamespaceID(), GetCommandBufferID()); |
| 350 GetNamespaceID(), GetCommandBufferID()); | |
| 351 | 354 |
| 352 if (service_->UseVirtualizedGLContexts() || | 355 if (service_->UseVirtualizedGLContexts() || |
| 353 decoder_->GetContextGroup() | 356 decoder_->GetContextGroup() |
| 354 ->feature_info() | 357 ->feature_info() |
| 355 ->workarounds() | 358 ->workarounds() |
| 356 .use_virtualized_gl_contexts) { | 359 .use_virtualized_gl_contexts) { |
| 357 context_ = gl_share_group_->GetSharedContext(); | 360 context_ = gl_share_group_->GetSharedContext(); |
| 358 if (!context_.get()) { | 361 if (!context_.get()) { |
| 359 context_ = gfx::GLContext::CreateGLContext( | 362 context_ = gfx::GLContext::CreateGLContext( |
| 360 gl_share_group_.get(), surface_.get(), params.gpu_preference); | 363 gl_share_group_.get(), surface_.get(), params.gpu_preference); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 } | 410 } |
| 408 *params.capabilities = decoder_->GetCapabilities(); | 411 *params.capabilities = decoder_->GetCapabilities(); |
| 409 | 412 |
| 410 if (!params.is_offscreen) { | 413 if (!params.is_offscreen) { |
| 411 decoder_->SetResizeCallback(base::Bind( | 414 decoder_->SetResizeCallback(base::Bind( |
| 412 &InProcessCommandBuffer::OnResizeView, gpu_thread_weak_ptr_)); | 415 &InProcessCommandBuffer::OnResizeView, gpu_thread_weak_ptr_)); |
| 413 } | 416 } |
| 414 decoder_->SetWaitSyncPointCallback( | 417 decoder_->SetWaitSyncPointCallback( |
| 415 base::Bind(&InProcessCommandBuffer::WaitSyncPointOnGpuThread, | 418 base::Bind(&InProcessCommandBuffer::WaitSyncPointOnGpuThread, |
| 416 base::Unretained(this))); | 419 base::Unretained(this))); |
| 420 decoder_->SetFenceSyncReleaseCallback( |
| 421 base::Bind(&InProcessCommandBuffer::FenceSyncReleaseOnGpuThread, |
| 422 base::Unretained(this))); |
| 423 decoder_->SetWaitFenceSyncCallback( |
| 424 base::Bind(&InProcessCommandBuffer::WaitFenceSyncOnGpuThread, |
| 425 base::Unretained(this))); |
| 417 | 426 |
| 418 image_factory_ = params.image_factory; | 427 image_factory_ = params.image_factory; |
| 419 | 428 |
| 420 return true; | 429 return true; |
| 421 } | 430 } |
| 422 | 431 |
| 423 void InProcessCommandBuffer::Destroy() { | 432 void InProcessCommandBuffer::Destroy() { |
| 424 CheckSequencedThread(); | 433 CheckSequencedThread(); |
| 425 | 434 |
| 426 base::WaitableEvent completion(true, false); | 435 base::WaitableEvent completion(true, false); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 438 command_buffer_.reset(); | 447 command_buffer_.reset(); |
| 439 // Clean up GL resources if possible. | 448 // Clean up GL resources if possible. |
| 440 bool have_context = context_.get() && context_->MakeCurrent(surface_.get()); | 449 bool have_context = context_.get() && context_->MakeCurrent(surface_.get()); |
| 441 if (decoder_) { | 450 if (decoder_) { |
| 442 decoder_->Destroy(have_context); | 451 decoder_->Destroy(have_context); |
| 443 decoder_.reset(); | 452 decoder_.reset(); |
| 444 } | 453 } |
| 445 context_ = NULL; | 454 context_ = NULL; |
| 446 surface_ = NULL; | 455 surface_ = NULL; |
| 447 sync_point_client_ = NULL; | 456 sync_point_client_ = NULL; |
| 448 sync_point_client_state_ = NULL; | 457 if (sync_point_order_data_) { |
| 458 sync_point_order_data_->Destroy(); |
| 459 sync_point_order_data_ = nullptr; |
| 460 } |
| 449 gl_share_group_ = NULL; | 461 gl_share_group_ = NULL; |
| 450 #if defined(OS_ANDROID) | 462 #if defined(OS_ANDROID) |
| 451 stream_texture_manager_.reset(); | 463 stream_texture_manager_.reset(); |
| 452 #endif | 464 #endif |
| 453 | 465 |
| 454 return true; | 466 return true; |
| 455 } | 467 } |
| 456 | 468 |
| 457 void InProcessCommandBuffer::CheckSequencedThread() { | 469 void InProcessCommandBuffer::CheckSequencedThread() { |
| 458 DCHECK(!sequence_checker_ || | 470 DCHECK(!sequence_checker_ || |
| (...skipping 28 matching lines...) Expand all Loading... |
| 487 GetStateFast(); | 499 GetStateFast(); |
| 488 return last_state_.token; | 500 return last_state_.token; |
| 489 } | 501 } |
| 490 | 502 |
| 491 void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset, | 503 void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset, |
| 492 uint32_t order_num) { | 504 uint32_t order_num) { |
| 493 CheckSequencedThread(); | 505 CheckSequencedThread(); |
| 494 ScopedEvent handle_flush(&flush_event_); | 506 ScopedEvent handle_flush(&flush_event_); |
| 495 base::AutoLock lock(command_buffer_lock_); | 507 base::AutoLock lock(command_buffer_lock_); |
| 496 | 508 |
| 497 sync_point_client_state_->BeginProcessingOrderNumber(order_num); | 509 sync_point_order_data_->BeginProcessingOrderNumber(order_num); |
| 498 command_buffer_->Flush(put_offset); | 510 command_buffer_->Flush(put_offset); |
| 499 { | 511 { |
| 500 // Update state before signaling the flush event. | 512 // Update state before signaling the flush event. |
| 501 base::AutoLock lock(state_after_last_flush_lock_); | 513 base::AutoLock lock(state_after_last_flush_lock_); |
| 502 state_after_last_flush_ = command_buffer_->GetLastState(); | 514 state_after_last_flush_ = command_buffer_->GetLastState(); |
| 503 } | 515 } |
| 504 DCHECK((!error::IsError(state_after_last_flush_.error) && !context_lost_) || | 516 DCHECK((!error::IsError(state_after_last_flush_.error) && !context_lost_) || |
| 505 (error::IsError(state_after_last_flush_.error) && context_lost_)); | 517 (error::IsError(state_after_last_flush_.error) && context_lost_)); |
| 506 | 518 |
| 507 // Currently the in process command buffer does not support being descheduled, | 519 // Currently the in process command buffer does not support being descheduled, |
| 508 // if it does we would need to back off on calling the finish processing | 520 // if it does we would need to back off on calling the finish processing |
| 509 // order number function until the message is rescheduled and finished | 521 // order number function until the message is rescheduled and finished |
| 510 // processing. This DCHECK is to enforce this. | 522 // processing. This DCHECK is to enforce this. |
| 511 DCHECK(context_lost_ || put_offset == state_after_last_flush_.get_offset); | 523 DCHECK(context_lost_ || put_offset == state_after_last_flush_.get_offset); |
| 512 sync_point_client_state_->FinishProcessingOrderNumber(order_num); | 524 sync_point_order_data_->FinishProcessingOrderNumber(order_num); |
| 513 | 525 |
| 514 // If we've processed all pending commands but still have pending queries, | 526 // If we've processed all pending commands but still have pending queries, |
| 515 // pump idle work until the query is passed. | 527 // pump idle work until the query is passed. |
| 516 if (put_offset == state_after_last_flush_.get_offset && | 528 if (put_offset == state_after_last_flush_.get_offset && |
| 517 (gpu_scheduler_->HasMoreIdleWork() || | 529 (gpu_scheduler_->HasMoreIdleWork() || |
| 518 gpu_scheduler_->HasPendingQueries())) { | 530 gpu_scheduler_->HasPendingQueries())) { |
| 519 ScheduleDelayedWorkOnGpuThread(); | 531 ScheduleDelayedWorkOnGpuThread(); |
| 520 } | 532 } |
| 521 } | 533 } |
| 522 | 534 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 546 void InProcessCommandBuffer::Flush(int32 put_offset) { | 558 void InProcessCommandBuffer::Flush(int32 put_offset) { |
| 547 CheckSequencedThread(); | 559 CheckSequencedThread(); |
| 548 if (last_state_.error != gpu::error::kNoError) | 560 if (last_state_.error != gpu::error::kNoError) |
| 549 return; | 561 return; |
| 550 | 562 |
| 551 if (last_put_offset_ == put_offset) | 563 if (last_put_offset_ == put_offset) |
| 552 return; | 564 return; |
| 553 | 565 |
| 554 SyncPointManager* sync_manager = service_->sync_point_manager(); | 566 SyncPointManager* sync_manager = service_->sync_point_manager(); |
| 555 const uint32_t order_num = | 567 const uint32_t order_num = |
| 556 sync_point_client_state_->GenerateUnprocessedOrderNumber(sync_manager); | 568 sync_point_order_data_->GenerateUnprocessedOrderNumber(sync_manager); |
| 557 last_put_offset_ = put_offset; | 569 last_put_offset_ = put_offset; |
| 558 base::Closure task = base::Bind(&InProcessCommandBuffer::FlushOnGpuThread, | 570 base::Closure task = base::Bind(&InProcessCommandBuffer::FlushOnGpuThread, |
| 559 gpu_thread_weak_ptr_, | 571 gpu_thread_weak_ptr_, |
| 560 put_offset, | 572 put_offset, |
| 561 order_num); | 573 order_num); |
| 562 QueueTask(task); | 574 QueueTask(task); |
| 575 |
| 576 flushed_fence_sync_release_ = next_fence_sync_release_ - 1; |
| 563 } | 577 } |
| 564 | 578 |
| 565 void InProcessCommandBuffer::OrderingBarrier(int32 put_offset) { | 579 void InProcessCommandBuffer::OrderingBarrier(int32 put_offset) { |
| 566 Flush(put_offset); | 580 Flush(put_offset); |
| 567 } | 581 } |
| 568 | 582 |
| 569 void InProcessCommandBuffer::WaitForTokenInRange(int32 start, int32 end) { | 583 void InProcessCommandBuffer::WaitForTokenInRange(int32 start, int32 end) { |
| 570 CheckSequencedThread(); | 584 CheckSequencedThread(); |
| 571 while (!InRange(start, end, GetLastToken()) && | 585 while (!InRange(start, end, GetLastToken()) && |
| 572 last_state_.error == gpu::error::kNoError) | 586 last_state_.error == gpu::error::kNoError) |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 | 805 |
| 792 void InProcessCommandBuffer::RetireSyncPointOnGpuThread(uint32 sync_point) { | 806 void InProcessCommandBuffer::RetireSyncPointOnGpuThread(uint32 sync_point) { |
| 793 gles2::MailboxManager* mailbox_manager = | 807 gles2::MailboxManager* mailbox_manager = |
| 794 decoder_->GetContextGroup()->mailbox_manager(); | 808 decoder_->GetContextGroup()->mailbox_manager(); |
| 795 if (mailbox_manager->UsesSync()) { | 809 if (mailbox_manager->UsesSync()) { |
| 796 bool make_current_success = false; | 810 bool make_current_success = false; |
| 797 { | 811 { |
| 798 base::AutoLock lock(command_buffer_lock_); | 812 base::AutoLock lock(command_buffer_lock_); |
| 799 make_current_success = MakeCurrent(); | 813 make_current_success = MakeCurrent(); |
| 800 } | 814 } |
| 801 if (make_current_success) | 815 if (make_current_success) { |
| 802 mailbox_manager->PushTextureUpdates(sync_point); | 816 // Old sync points are global and do not have a command buffer ID, |
| 817 // We can simply use the GPUIO namespace with 0 for the command buffer ID |
| 818 // (under normal circumstances 0 is invalid so will not be used) until |
| 819 // the old sync points are replaced. |
| 820 gles2::SyncToken sync_token = {gpu::CommandBufferNamespace::GPU_IO, 0, |
| 821 sync_point}; |
| 822 mailbox_manager->PushTextureUpdates(sync_token); |
| 823 } |
| 803 } | 824 } |
| 804 service_->sync_point_manager()->RetireSyncPoint(sync_point); | 825 service_->sync_point_manager()->RetireSyncPoint(sync_point); |
| 805 } | 826 } |
| 806 | 827 |
| 807 void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point, | 828 void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point, |
| 808 const base::Closure& callback) { | 829 const base::Closure& callback) { |
| 809 CheckSequencedThread(); | 830 CheckSequencedThread(); |
| 810 QueueTask(base::Bind(&InProcessCommandBuffer::SignalSyncPointOnGpuThread, | 831 QueueTask(base::Bind(&InProcessCommandBuffer::SignalSyncPointOnGpuThread, |
| 811 base::Unretained(this), | 832 base::Unretained(this), |
| 812 sync_point, | 833 sync_point, |
| 813 WrapCallback(callback))); | 834 WrapCallback(callback))); |
| 814 } | 835 } |
| 815 | 836 |
| 816 bool InProcessCommandBuffer::WaitSyncPointOnGpuThread(unsigned sync_point) { | 837 bool InProcessCommandBuffer::WaitSyncPointOnGpuThread(unsigned sync_point) { |
| 817 service_->sync_point_manager()->WaitSyncPoint(sync_point); | 838 service_->sync_point_manager()->WaitSyncPoint(sync_point); |
| 818 gles2::MailboxManager* mailbox_manager = | 839 gles2::MailboxManager* mailbox_manager = |
| 819 decoder_->GetContextGroup()->mailbox_manager(); | 840 decoder_->GetContextGroup()->mailbox_manager(); |
| 820 mailbox_manager->PullTextureUpdates(sync_point); | 841 // Old sync points are global and do not have a command buffer ID, |
| 842 // We can simply use the GPUIO namespace with 0 for the command buffer ID |
| 843 // (under normal circumstances 0 is invalid so will not be used) until |
| 844 // the old sync points are replaced. |
| 845 gles2::SyncToken sync_token = {gpu::CommandBufferNamespace::GPU_IO, 0, |
| 846 sync_point}; |
| 847 mailbox_manager->PullTextureUpdates(sync_token); |
| 821 return true; | 848 return true; |
| 822 } | 849 } |
| 823 | 850 |
| 851 void InProcessCommandBuffer::FenceSyncReleaseOnGpuThread(uint64_t release) { |
| 852 DCHECK(!sync_point_client_->client_state()->IsFenceSyncReleased(release)); |
| 853 gles2::MailboxManager* mailbox_manager = |
| 854 decoder_->GetContextGroup()->mailbox_manager(); |
| 855 if (mailbox_manager->UsesSync()) { |
| 856 bool make_current_success = false; |
| 857 { |
| 858 base::AutoLock lock(command_buffer_lock_); |
| 859 make_current_success = MakeCurrent(); |
| 860 } |
| 861 if (make_current_success) { |
| 862 gles2::SyncToken sync_token = {GetNamespaceID(), GetCommandBufferID(), |
| 863 release}; |
| 864 mailbox_manager->PushTextureUpdates(sync_token); |
| 865 } |
| 866 } |
| 867 |
| 868 sync_point_client_->ReleaseFenceSync(release); |
| 869 } |
| 870 |
| 871 bool InProcessCommandBuffer::WaitFenceSyncOnGpuThread( |
| 872 gpu::CommandBufferNamespace namespace_id, |
| 873 uint64_t command_buffer_id, |
| 874 uint64_t release) { |
| 875 gpu::SyncPointManager* sync_point_manager = service_->sync_point_manager(); |
| 876 DCHECK(sync_point_manager); |
| 877 |
| 878 scoped_refptr<gpu::SyncPointClientState> release_state = |
| 879 sync_point_manager->GetSyncPointClientState(namespace_id, |
| 880 command_buffer_id); |
| 881 |
| 882 if (!release_state) |
| 883 return true; |
| 884 |
| 885 if (!release_state->IsFenceSyncReleased(release)) { |
| 886 // Use waitable event which is signalled when the release fence is released. |
| 887 sync_point_client_->Wait( |
| 888 release_state.get(), release, |
| 889 base::Bind(&base::WaitableEvent::Signal, |
| 890 base::Unretained(&fence_sync_wait_event_))); |
| 891 fence_sync_wait_event_.Wait(); |
| 892 } |
| 893 |
| 894 gles2::MailboxManager* mailbox_manager = |
| 895 decoder_->GetContextGroup()->mailbox_manager(); |
| 896 gles2::SyncToken sync_token = {namespace_id, command_buffer_id, release}; |
| 897 mailbox_manager->PullTextureUpdates(sync_token); |
| 898 return true; |
| 899 } |
| 900 |
| 824 void InProcessCommandBuffer::SignalSyncPointOnGpuThread( | 901 void InProcessCommandBuffer::SignalSyncPointOnGpuThread( |
| 825 unsigned sync_point, | 902 unsigned sync_point, |
| 826 const base::Closure& callback) { | 903 const base::Closure& callback) { |
| 827 service_->sync_point_manager()->AddSyncPointCallback(sync_point, callback); | 904 service_->sync_point_manager()->AddSyncPointCallback(sync_point, callback); |
| 828 } | 905 } |
| 829 | 906 |
| 830 void InProcessCommandBuffer::SignalQuery(unsigned query_id, | 907 void InProcessCommandBuffer::SignalQuery(unsigned query_id, |
| 831 const base::Closure& callback) { | 908 const base::Closure& callback) { |
| 832 CheckSequencedThread(); | 909 CheckSequencedThread(); |
| 833 QueueTask(base::Bind(&InProcessCommandBuffer::SignalQueryOnGpuThread, | 910 QueueTask(base::Bind(&InProcessCommandBuffer::SignalQueryOnGpuThread, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 } | 951 } |
| 875 | 952 |
| 876 CommandBufferNamespace InProcessCommandBuffer::GetNamespaceID() const { | 953 CommandBufferNamespace InProcessCommandBuffer::GetNamespaceID() const { |
| 877 return CommandBufferNamespace::IN_PROCESS; | 954 return CommandBufferNamespace::IN_PROCESS; |
| 878 } | 955 } |
| 879 | 956 |
| 880 uint64_t InProcessCommandBuffer::GetCommandBufferID() const { | 957 uint64_t InProcessCommandBuffer::GetCommandBufferID() const { |
| 881 return command_buffer_id_; | 958 return command_buffer_id_; |
| 882 } | 959 } |
| 883 | 960 |
| 961 uint64_t InProcessCommandBuffer::GenerateFenceSyncRelease() { |
| 962 return next_fence_sync_release_++; |
| 963 } |
| 964 |
| 965 bool InProcessCommandBuffer::IsFenceSyncRelease(uint64_t release) { |
| 966 return release != 0 && release < next_fence_sync_release_; |
| 967 } |
| 968 |
| 969 bool InProcessCommandBuffer::IsFenceSyncFlushed(uint64_t release) { |
| 970 return release <= flushed_fence_sync_release_; |
| 971 } |
| 972 |
| 884 uint32 InProcessCommandBuffer::CreateStreamTextureOnGpuThread( | 973 uint32 InProcessCommandBuffer::CreateStreamTextureOnGpuThread( |
| 885 uint32 client_texture_id) { | 974 uint32 client_texture_id) { |
| 886 #if defined(OS_ANDROID) | 975 #if defined(OS_ANDROID) |
| 887 return stream_texture_manager_->CreateStreamTexture( | 976 return stream_texture_manager_->CreateStreamTexture( |
| 888 client_texture_id, decoder_->GetContextGroup()->texture_manager()); | 977 client_texture_id, decoder_->GetContextGroup()->texture_manager()); |
| 889 #else | 978 #else |
| 890 return 0; | 979 return 0; |
| 891 #endif | 980 #endif |
| 892 } | 981 } |
| 893 | 982 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 framebuffer_completeness_cache_ = | 1077 framebuffer_completeness_cache_ = |
| 989 new gpu::gles2::FramebufferCompletenessCache; | 1078 new gpu::gles2::FramebufferCompletenessCache; |
| 990 return framebuffer_completeness_cache_; | 1079 return framebuffer_completeness_cache_; |
| 991 } | 1080 } |
| 992 | 1081 |
| 993 SyncPointManager* GpuInProcessThread::sync_point_manager() { | 1082 SyncPointManager* GpuInProcessThread::sync_point_manager() { |
| 994 return sync_point_manager_; | 1083 return sync_point_manager_; |
| 995 } | 1084 } |
| 996 | 1085 |
| 997 } // namespace gpu | 1086 } // namespace gpu |
| OLD | NEW |