| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_GPU_GPU_THREAD_H_ | 5 #ifndef CHROME_GPU_GPU_THREAD_H_ |
| 6 #define CHROME_GPU_GPU_THREAD_H_ | 6 #define CHROME_GPU_GPU_THREAD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/common/child_thread.h" | 13 #include "chrome/common/child_thread.h" |
| 14 #include "chrome/common/gpu_info.h" | 14 #include "chrome/common/gpu_info.h" |
| 15 #include "chrome/gpu/gpu_channel.h" | 15 #include "chrome/gpu/gpu_channel.h" |
| 16 #include "chrome/gpu/gpu_config.h" | 16 #include "chrome/gpu/gpu_config.h" |
| 17 #include "chrome/gpu/x_util.h" | 17 #include "chrome/gpu/x_util.h" |
| 18 #include "gfx/native_widget_types.h" | 18 #include "gfx/native_widget_types.h" |
| 19 | 19 |
| 20 namespace IPC { |
| 21 struct ChannelHandle; |
| 22 } |
| 23 |
| 20 class GpuThread : public ChildThread { | 24 class GpuThread : public ChildThread { |
| 21 public: | 25 public: |
| 22 GpuThread(); | 26 GpuThread(); |
| 23 ~GpuThread(); | 27 ~GpuThread(); |
| 24 | 28 |
| 25 void Init(const base::Time& process_start_time); | 29 void Init(const base::Time& process_start_time); |
| 26 | 30 |
| 27 // Remove the channel for a particular renderer. | 31 // Remove the channel for a particular renderer. |
| 28 void RemoveChannel(int renderer_id); | 32 void RemoveChannel(int renderer_id); |
| 29 | 33 |
| 30 private: | 34 private: |
| 31 // ChildThread overrides. | 35 // ChildThread overrides. |
| 32 virtual void OnControlMessageReceived(const IPC::Message& msg); | 36 virtual void OnControlMessageReceived(const IPC::Message& msg); |
| 33 | 37 |
| 34 // Message handlers. | 38 // Message handlers. |
| 35 void OnEstablishChannel(int renderer_id); | 39 void OnEstablishChannel(int renderer_id); |
| 40 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); |
| 36 void OnSynchronize(); | 41 void OnSynchronize(); |
| 37 void OnCollectGraphicsInfo(); | 42 void OnCollectGraphicsInfo(); |
| 38 #if defined(OS_MACOSX) | 43 #if defined(OS_MACOSX) |
| 39 void OnAcceleratedSurfaceBuffersSwappedACK( | 44 void OnAcceleratedSurfaceBuffersSwappedACK( |
| 40 int renderer_id, int32 route_id, uint64 swap_buffers_count); | 45 int renderer_id, int32 route_id, uint64 swap_buffers_count); |
| 41 #endif | 46 #endif |
| 42 void OnCrash(); | 47 void OnCrash(); |
| 43 void OnHang(); | 48 void OnHang(); |
| 44 | 49 |
| 45 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 46 static void CollectDxDiagnostics(GpuThread* thread); | 51 static void CollectDxDiagnostics(GpuThread* thread); |
| 47 static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); | 52 static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); |
| 48 #endif | 53 #endif |
| 49 | 54 |
| 50 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; | 55 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; |
| 51 GpuChannelMap gpu_channels_; | 56 GpuChannelMap gpu_channels_; |
| 52 | 57 |
| 53 // Information about the GPU, such as device and vendor ID. | 58 // Information about the GPU, such as device and vendor ID. |
| 54 GPUInfo gpu_info_; | 59 GPUInfo gpu_info_; |
| 55 | 60 |
| 56 DISALLOW_COPY_AND_ASSIGN(GpuThread); | 61 DISALLOW_COPY_AND_ASSIGN(GpuThread); |
| 57 }; | 62 }; |
| 58 | 63 |
| 59 #endif // CHROME_GPU_GPU_THREAD_H_ | 64 #endif // CHROME_GPU_GPU_THREAD_H_ |
| OLD | NEW |