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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 634313002: Add mouse input forwarding to gpu service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix memleak in test Created 6 years 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 (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
11 #include <queue> 11 #include <queue>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/debug/trace_event.h" 16 #include "base/debug/trace_event.h"
17 #include "base/message_loop/message_loop_proxy.h" 17 #include "base/message_loop/message_loop_proxy.h"
18 #include "base/stl_util.h" 18 #include "base/stl_util.h"
19 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
20 #include "base/timer/timer.h" 20 #include "base/timer/timer.h"
21 #include "content/common/gpu/devtools_gpu_agent.h" 21 #include "content/common/gpu/devtools_gpu_agent.h"
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/service/gpu_scheduler.h" 28 #include "gpu/command_buffer/service/gpu_scheduler.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/mailbox_manager_impl.h" 30 #include "gpu/command_buffer/service/mailbox_manager_impl.h"
30 #include "gpu/command_buffer/service/sync_point_manager.h" 31 #include "gpu/command_buffer/service/sync_point_manager.h"
31 #include "ipc/ipc_channel.h" 32 #include "ipc/ipc_channel.h"
32 #include "ipc/message_filter.h" 33 #include "ipc/message_filter.h"
33 #include "ui/gl/gl_context.h" 34 #include "ui/gl/gl_context.h"
34 #include "ui/gl/gl_image_shared_memory.h" 35 #include "ui/gl/gl_image_shared_memory.h"
35 #include "ui/gl/gl_surface.h" 36 #include "ui/gl/gl_surface.h"
36 37
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 false, 445 false,
445 shutdown_event); 446 shutdown_event);
446 447
447 filter_ = 448 filter_ =
448 new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(), 449 new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(),
449 gpu_channel_manager_->sync_point_manager(), 450 gpu_channel_manager_->sync_point_manager(),
450 base::MessageLoopProxy::current(), 451 base::MessageLoopProxy::current(),
451 allow_future_sync_points_); 452 allow_future_sync_points_);
452 io_message_loop_ = io_message_loop; 453 io_message_loop_ = io_message_loop;
453 channel_->AddFilter(filter_.get()); 454 channel_->AddFilter(filter_.get());
455 pending_valuebuffer_state_ = new gpu::ValueStateMap();
454 456
455 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this)); 457 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this));
456 } 458 }
457 459
458 std::string GpuChannel::GetChannelName() { 460 std::string GpuChannel::GetChannelName() {
459 return channel_id_; 461 return channel_id_;
460 } 462 }
461 463
462 #if defined(OS_POSIX) 464 #if defined(OS_POSIX)
463 base::ScopedFD GpuChannel::TakeRendererFileDescriptor() { 465 base::ScopedFD GpuChannel::TakeRendererFileDescriptor() {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 bool use_virtualized_gl_context = false; 574 bool use_virtualized_gl_context = false;
573 #if defined(OS_MACOSX) 575 #if defined(OS_MACOSX)
574 use_virtualized_gl_context = true; 576 use_virtualized_gl_context = true;
575 #endif 577 #endif
576 578
577 scoped_ptr<GpuCommandBufferStub> stub( 579 scoped_ptr<GpuCommandBufferStub> stub(
578 new GpuCommandBufferStub(this, 580 new GpuCommandBufferStub(this,
579 share_group, 581 share_group,
580 window, 582 window,
581 mailbox_manager_.get(), 583 mailbox_manager_.get(),
584 pending_valuebuffer_state_.get(),
582 gfx::Size(), 585 gfx::Size(),
583 disallowed_features_, 586 disallowed_features_,
584 init_params.attribs, 587 init_params.attribs,
585 init_params.gpu_preference, 588 init_params.gpu_preference,
586 use_virtualized_gl_context, 589 use_virtualized_gl_context,
587 route_id, 590 route_id,
588 surface_id, 591 surface_id,
589 watchdog_, 592 watchdog_,
590 software_, 593 software_,
591 init_params.active_url)); 594 init_params.active_url));
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 int32 route_id, 733 int32 route_id,
731 bool* succeeded) { 734 bool* succeeded) {
732 TRACE_EVENT0("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer"); 735 TRACE_EVENT0("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer");
733 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); 736 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id);
734 737
735 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( 738 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
736 this, 739 this,
737 share_group, 740 share_group,
738 gfx::GLSurfaceHandle(), 741 gfx::GLSurfaceHandle(),
739 mailbox_manager_.get(), 742 mailbox_manager_.get(),
743 pending_valuebuffer_state_.get(),
740 size, 744 size,
741 disallowed_features_, 745 disallowed_features_,
742 init_params.attribs, 746 init_params.attribs,
743 init_params.gpu_preference, 747 init_params.gpu_preference,
744 false, 748 false,
745 route_id, 749 route_id,
746 0, 750 0,
747 watchdog_, 751 watchdog_,
748 software_, 752 software_,
749 init_params.active_url)); 753 init_params.active_url));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 ->AsImageFactory() 849 ->AsImageFactory()
846 ->CreateImageForGpuMemoryBuffer(handle, 850 ->CreateImageForGpuMemoryBuffer(handle,
847 size, 851 size,
848 format, 852 format,
849 internalformat, 853 internalformat,
850 client_id_); 854 client_id_);
851 } 855 }
852 } 856 }
853 } 857 }
854 858
859 void GpuChannel::HandleUpdateValueState(
860 unsigned int target, const gpu::ValueState& state) {
861 pending_valuebuffer_state_->UpdateState(target, state);
862 }
863
855 } // namespace content 864 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698