| 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 #include "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyingVideoSurfaceAck, | 619 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyingVideoSurfaceAck, |
| 620 OnDestroyingVideoSurfaceAck) | 620 OnDestroyingVideoSurfaceAck) |
| 621 #endif | 621 #endif |
| 622 IPC_MESSAGE_HANDLER(GpuHostMsg_DidCreateOffscreenContext, | 622 IPC_MESSAGE_HANDLER(GpuHostMsg_DidCreateOffscreenContext, |
| 623 OnDidCreateOffscreenContext) | 623 OnDidCreateOffscreenContext) |
| 624 IPC_MESSAGE_HANDLER(GpuHostMsg_DidLoseContext, OnDidLoseContext) | 624 IPC_MESSAGE_HANDLER(GpuHostMsg_DidLoseContext, OnDidLoseContext) |
| 625 IPC_MESSAGE_HANDLER(GpuHostMsg_DidDestroyOffscreenContext, | 625 IPC_MESSAGE_HANDLER(GpuHostMsg_DidDestroyOffscreenContext, |
| 626 OnDidDestroyOffscreenContext) | 626 OnDidDestroyOffscreenContext) |
| 627 IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryUmaStats, | 627 IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryUmaStats, |
| 628 OnGpuMemoryUmaStatsReceived) | 628 OnGpuMemoryUmaStatsReceived) |
| 629 #if defined(OS_MACOSX) | |
| 630 IPC_MESSAGE_HANDLER_GENERIC(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | |
| 631 OnAcceleratedSurfaceBuffersSwapped(message)) | |
| 632 #endif | |
| 633 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyChannel, OnDestroyChannel) | 629 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyChannel, OnDestroyChannel) |
| 634 IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader, OnCacheShader) | 630 IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader, OnCacheShader) |
| 635 #if defined(OS_WIN) | 631 #if defined(OS_WIN) |
| 636 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow, | 632 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow, |
| 637 OnAcceleratedSurfaceCreatedChildWindow) | 633 OnAcceleratedSurfaceCreatedChildWindow) |
| 638 #endif | 634 #endif |
| 639 | 635 |
| 640 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) | 636 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) |
| 641 IPC_END_MESSAGE_MAP() | 637 IPC_END_MESSAGE_MAP() |
| 642 | 638 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 urls_with_live_offscreen_contexts_.erase(url); | 904 urls_with_live_offscreen_contexts_.erase(url); |
| 909 } | 905 } |
| 910 | 906 |
| 911 void GpuProcessHost::OnGpuMemoryUmaStatsReceived( | 907 void GpuProcessHost::OnGpuMemoryUmaStatsReceived( |
| 912 const gpu::GPUMemoryUmaStats& stats) { | 908 const gpu::GPUMemoryUmaStats& stats) { |
| 913 TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryUmaStatsReceived"); | 909 TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryUmaStatsReceived"); |
| 914 uma_memory_stats_received_ = true; | 910 uma_memory_stats_received_ = true; |
| 915 uma_memory_stats_ = stats; | 911 uma_memory_stats_ = stats; |
| 916 } | 912 } |
| 917 | 913 |
| 918 #if defined(OS_MACOSX) | |
| 919 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( | |
| 920 const IPC::Message& message) { | |
| 921 RenderWidgetResizeHelper::PostGpuProcessMsg(host_id_, message); | |
| 922 } | |
| 923 #endif | |
| 924 | |
| 925 void GpuProcessHost::OnProcessLaunched() { | 914 void GpuProcessHost::OnProcessLaunched() { |
| 926 UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime", | 915 UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime", |
| 927 base::TimeTicks::Now() - init_start_time_); | 916 base::TimeTicks::Now() - init_start_time_); |
| 928 } | 917 } |
| 929 | 918 |
| 930 void GpuProcessHost::OnProcessLaunchFailed(int error_code) { | 919 void GpuProcessHost::OnProcessLaunchFailed(int error_code) { |
| 931 // TODO(wfh): do something more useful with this error code. | 920 // TODO(wfh): do something more useful with this error code. |
| 932 RecordProcessCrash(); | 921 RecordProcessCrash(); |
| 933 } | 922 } |
| 934 | 923 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1175 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1187 ClientIdToShaderCacheMap::iterator iter = | 1176 ClientIdToShaderCacheMap::iterator iter = |
| 1188 client_id_to_shader_cache_.find(client_id); | 1177 client_id_to_shader_cache_.find(client_id); |
| 1189 // If the cache doesn't exist then this is an off the record profile. | 1178 // If the cache doesn't exist then this is an off the record profile. |
| 1190 if (iter == client_id_to_shader_cache_.end()) | 1179 if (iter == client_id_to_shader_cache_.end()) |
| 1191 return; | 1180 return; |
| 1192 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1181 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1193 } | 1182 } |
| 1194 | 1183 |
| 1195 } // namespace content | 1184 } // namespace content |
| OLD | NEW |