OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/common/gpu/gpu_channel_manager.h" | 22 #include "content/common/gpu/gpu_channel_manager.h" |
23 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 23 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
24 #include "content/common/gpu/gpu_messages.h" | 24 #include "content/common/gpu/gpu_messages.h" |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 #include "gpu/command_buffer/common/mailbox.h" | 26 #include "gpu/command_buffer/common/mailbox.h" |
27 #include "gpu/command_buffer/common/value_state.h" | 27 #include "gpu/command_buffer/common/value_state.h" |
28 #include "gpu/command_buffer/service/gpu_scheduler.h" | 28 #include "gpu/command_buffer/service/gpu_scheduler.h" |
29 #include "gpu/command_buffer/service/image_factory.h" | 29 #include "gpu/command_buffer/service/image_factory.h" |
30 #include "gpu/command_buffer/service/mailbox_manager_impl.h" | 30 #include "gpu/command_buffer/service/mailbox_manager_impl.h" |
31 #include "gpu/command_buffer/service/sync_point_manager.h" | 31 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 32 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
32 #include "ipc/ipc_channel.h" | 33 #include "ipc/ipc_channel.h" |
33 #include "ipc/message_filter.h" | 34 #include "ipc/message_filter.h" |
34 #include "ui/gl/gl_context.h" | 35 #include "ui/gl/gl_context.h" |
35 #include "ui/gl/gl_image_shared_memory.h" | 36 #include "ui/gl/gl_image_shared_memory.h" |
36 #include "ui/gl/gl_surface.h" | 37 #include "ui/gl/gl_surface.h" |
37 | 38 |
38 #if defined(OS_POSIX) | 39 #if defined(OS_POSIX) |
39 #include "ipc/ipc_channel_posix.h" | 40 #include "ipc/ipc_channel_posix.h" |
40 #endif | 41 #endif |
41 | 42 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 bool a_stub_is_descheduled_; | 397 bool a_stub_is_descheduled_; |
397 | 398 |
398 // True if this channel can create future sync points. | 399 // True if this channel can create future sync points. |
399 bool future_sync_points_; | 400 bool future_sync_points_; |
400 }; | 401 }; |
401 | 402 |
402 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, | 403 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, |
403 GpuWatchdog* watchdog, | 404 GpuWatchdog* watchdog, |
404 gfx::GLShareGroup* share_group, | 405 gfx::GLShareGroup* share_group, |
405 gpu::gles2::MailboxManager* mailbox, | 406 gpu::gles2::MailboxManager* mailbox, |
| 407 gpu::gles2::SubscriptionRefSet* subscription_ref_set, |
406 int client_id, | 408 int client_id, |
407 bool software, | 409 bool software, |
408 bool allow_future_sync_points) | 410 bool allow_future_sync_points) |
409 : gpu_channel_manager_(gpu_channel_manager), | 411 : gpu_channel_manager_(gpu_channel_manager), |
410 messages_processed_(0), | 412 messages_processed_(0), |
411 client_id_(client_id), | 413 client_id_(client_id), |
412 share_group_(share_group ? share_group : new gfx::GLShareGroup), | 414 share_group_(share_group ? share_group : new gfx::GLShareGroup), |
413 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManagerImpl), | 415 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManagerImpl), |
| 416 subscription_ref_set_(subscription_ref_set), |
414 watchdog_(watchdog), | 417 watchdog_(watchdog), |
415 software_(software), | 418 software_(software), |
416 handle_messages_scheduled_(false), | 419 handle_messages_scheduled_(false), |
417 currently_processing_message_(NULL), | 420 currently_processing_message_(NULL), |
418 num_stubs_descheduled_(0), | 421 num_stubs_descheduled_(0), |
419 allow_future_sync_points_(allow_future_sync_points), | 422 allow_future_sync_points_(allow_future_sync_points), |
420 weak_factory_(this) { | 423 weak_factory_(this) { |
421 DCHECK(gpu_channel_manager); | 424 DCHECK(gpu_channel_manager); |
422 DCHECK(client_id); | 425 DCHECK(client_id); |
423 | 426 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 bool use_virtualized_gl_context = false; | 577 bool use_virtualized_gl_context = false; |
575 #if defined(OS_MACOSX) | 578 #if defined(OS_MACOSX) |
576 use_virtualized_gl_context = true; | 579 use_virtualized_gl_context = true; |
577 #endif | 580 #endif |
578 | 581 |
579 scoped_ptr<GpuCommandBufferStub> stub( | 582 scoped_ptr<GpuCommandBufferStub> stub( |
580 new GpuCommandBufferStub(this, | 583 new GpuCommandBufferStub(this, |
581 share_group, | 584 share_group, |
582 window, | 585 window, |
583 mailbox_manager_.get(), | 586 mailbox_manager_.get(), |
| 587 subscription_ref_set_.get(), |
584 pending_valuebuffer_state_.get(), | 588 pending_valuebuffer_state_.get(), |
585 gfx::Size(), | 589 gfx::Size(), |
586 disallowed_features_, | 590 disallowed_features_, |
587 init_params.attribs, | 591 init_params.attribs, |
588 init_params.gpu_preference, | 592 init_params.gpu_preference, |
589 use_virtualized_gl_context, | 593 use_virtualized_gl_context, |
590 route_id, | 594 route_id, |
591 surface_id, | 595 surface_id, |
592 watchdog_, | 596 watchdog_, |
593 software_, | 597 software_, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 int32 route_id, | 737 int32 route_id, |
734 bool* succeeded) { | 738 bool* succeeded) { |
735 TRACE_EVENT0("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer"); | 739 TRACE_EVENT0("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer"); |
736 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); | 740 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); |
737 | 741 |
738 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 742 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
739 this, | 743 this, |
740 share_group, | 744 share_group, |
741 gfx::GLSurfaceHandle(), | 745 gfx::GLSurfaceHandle(), |
742 mailbox_manager_.get(), | 746 mailbox_manager_.get(), |
| 747 subscription_ref_set_.get(), |
743 pending_valuebuffer_state_.get(), | 748 pending_valuebuffer_state_.get(), |
744 size, | 749 size, |
745 disallowed_features_, | 750 disallowed_features_, |
746 init_params.attribs, | 751 init_params.attribs, |
747 init_params.gpu_preference, | 752 init_params.gpu_preference, |
748 false, | 753 false, |
749 route_id, | 754 route_id, |
750 0, | 755 0, |
751 watchdog_, | 756 watchdog_, |
752 software_, | 757 software_, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 } | 860 } |
856 } | 861 } |
857 } | 862 } |
858 | 863 |
859 void GpuChannel::HandleUpdateValueState( | 864 void GpuChannel::HandleUpdateValueState( |
860 unsigned int target, const gpu::ValueState& state) { | 865 unsigned int target, const gpu::ValueState& state) { |
861 pending_valuebuffer_state_->UpdateState(target, state); | 866 pending_valuebuffer_state_->UpdateState(target, state); |
862 } | 867 } |
863 | 868 |
864 } // namespace content | 869 } // namespace content |
OLD | NEW |