OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
| 7 #include "base/debug/trace_event.h" |
7 #include "base/process_util.h" | 8 #include "base/process_util.h" |
8 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "content/common/child_thread.h" | 11 #include "content/common/child_thread.h" |
11 #include "content/common/gpu_messages.h" | |
12 #include "content/common/gpu/gpu_channel.h" | 12 #include "content/common/gpu/gpu_channel.h" |
13 #include "content/common/gpu/gpu_channel_manager.h" | 13 #include "content/common/gpu/gpu_channel_manager.h" |
14 #include "content/common/gpu/gpu_command_buffer_stub.h" | 14 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 15 #include "content/common/gpu_messages.h" |
15 #include "content/gpu/gpu_watchdog_thread.h" | 16 #include "content/gpu/gpu_watchdog_thread.h" |
16 #include "gpu/command_buffer/common/constants.h" | 17 #include "gpu/command_buffer/common/constants.h" |
17 #include "gpu/common/gpu_trace_event.h" | |
18 #include "ui/gfx/gl/gl_context.h" | 18 #include "ui/gfx/gl/gl_context.h" |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 #include "base/win/wrapped_window_proc.h" | 21 #include "base/win/wrapped_window_proc.h" |
22 #endif | 22 #endif |
23 | 23 |
24 using gpu::Buffer; | 24 using gpu::Buffer; |
25 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #define kCompositorWindowOwner L"CompositorWindowOwner" | 27 #define kCompositorWindowOwner L"CompositorWindowOwner" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 transfer_buffer); | 368 transfer_buffer); |
369 *size = buffer.size; | 369 *size = buffer.size; |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 void GpuCommandBufferStub::OnResizeOffscreenFrameBuffer(const gfx::Size& size) { | 373 void GpuCommandBufferStub::OnResizeOffscreenFrameBuffer(const gfx::Size& size) { |
374 scheduler_->ResizeOffscreenFrameBuffer(size); | 374 scheduler_->ResizeOffscreenFrameBuffer(size); |
375 } | 375 } |
376 | 376 |
377 void GpuCommandBufferStub::OnSwapBuffers() { | 377 void GpuCommandBufferStub::OnSwapBuffers() { |
378 GPU_TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSwapBuffers"); | 378 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSwapBuffers"); |
379 Send(new GpuCommandBufferMsg_SwapBuffers(route_id_)); | 379 Send(new GpuCommandBufferMsg_SwapBuffers(route_id_)); |
380 } | 380 } |
381 | 381 |
382 #if defined(OS_MACOSX) | 382 #if defined(OS_MACOSX) |
383 void GpuCommandBufferStub::OnSetWindowSize(const gfx::Size& size) { | 383 void GpuCommandBufferStub::OnSetWindowSize(const gfx::Size& size) { |
384 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 384 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
385 // Try using the IOSurface version first. | 385 // Try using the IOSurface version first. |
386 uint64 new_backing_store = scheduler_->SetWindowSizeForIOSurface(size); | 386 uint64 new_backing_store = scheduler_->SetWindowSizeForIOSurface(size); |
387 if (new_backing_store) { | 387 if (new_backing_store) { |
388 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params params; | 388 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params params; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 #elif defined(OS_WIN) | 437 #elif defined(OS_WIN) |
438 HWND hwnd = static_cast<HWND>(compositor_window_); | 438 HWND hwnd = static_cast<HWND>(compositor_window_); |
439 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | | 439 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | |
440 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; | 440 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
441 SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags); | 441 SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags); |
442 #endif // defined(OS_LINUX) | 442 #endif // defined(OS_LINUX) |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 #endif // defined(ENABLE_GPU) | 446 #endif // defined(ENABLE_GPU) |
OLD | NEW |