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_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
6 #define CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void OnMessageReceived(const IPC::Message& message); | 44 virtual void OnMessageReceived(const IPC::Message& message); |
45 | 45 |
46 // IPC::Message::Sender implementation: | 46 // IPC::Message::Sender implementation: |
47 virtual bool Send(IPC::Message* msg); | 47 virtual bool Send(IPC::Message* msg); |
48 | 48 |
49 // Get the GLContext associated with this object. | 49 // Get the GLContext associated with this object. |
50 gpu::GPUProcessor* processor() const { return processor_.get(); } | 50 gpu::GPUProcessor* processor() const { return processor_.get(); } |
51 | 51 |
52 int32 route_id() const { return route_id_; } | 52 int32 route_id() const { return route_id_; } |
53 | 53 |
| 54 #if defined(OS_WIN) |
| 55 void OnCompositorWindowPainted(); |
| 56 #endif |
| 57 |
54 private: | 58 private: |
55 // Message handlers: | 59 // Message handlers: |
56 void OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer); | 60 void OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer); |
57 void OnGetState(gpu::CommandBuffer::State* state); | 61 void OnGetState(gpu::CommandBuffer::State* state); |
58 void OnAsyncGetState(); | 62 void OnAsyncGetState(); |
59 void OnFlush(int32 put_offset, gpu::CommandBuffer::State* state); | 63 void OnFlush(int32 put_offset, gpu::CommandBuffer::State* state); |
60 void OnAsyncFlush(int32 put_offset); | 64 void OnAsyncFlush(int32 put_offset); |
61 void OnCreateTransferBuffer(int32 size, int32* id); | 65 void OnCreateTransferBuffer(int32 size, int32* id); |
62 void OnDestroyTransferBuffer(int32 id); | 66 void OnDestroyTransferBuffer(int32 id); |
63 void OnGetTransferBuffer(int32 id, | 67 void OnGetTransferBuffer(int32 id, |
64 base::SharedMemoryHandle* transfer_buffer, | 68 base::SharedMemoryHandle* transfer_buffer, |
65 uint32* size); | 69 uint32* size); |
66 void OnResizeOffscreenFrameBuffer(const gfx::Size& size); | 70 void OnResizeOffscreenFrameBuffer(const gfx::Size& size); |
67 | 71 |
68 void OnSwapBuffers(); | 72 void OnSwapBuffers(); |
69 | 73 |
70 #if defined(OS_MACOSX) | 74 #if defined(OS_MACOSX) |
71 void OnSetWindowSize(const gfx::Size& size); | 75 void OnSetWindowSize(const gfx::Size& size); |
72 void SwapBuffersCallback(); | 76 void SwapBuffersCallback(); |
| 77 #elif defined(OS_WIN) |
| 78 void CreateCompositorWindow(); |
| 79 HWND compositor_window_; |
73 #endif | 80 #endif |
74 | 81 |
75 // The lifetime of objects of this class is managed by a GpuChannel. The | 82 // The lifetime of objects of this class is managed by a GpuChannel. The |
76 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they | 83 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they |
77 // are destroyed. So a raw pointer is safe. | 84 // are destroyed. So a raw pointer is safe. |
78 GpuChannel* channel_; | 85 GpuChannel* channel_; |
79 | 86 |
80 gfx::PluginWindowHandle handle_; | 87 gfx::PluginWindowHandle handle_; |
81 base::WeakPtr<GpuCommandBufferStub> parent_; | 88 base::WeakPtr<GpuCommandBufferStub> parent_; |
82 gfx::Size initial_size_; | 89 gfx::Size initial_size_; |
83 std::string allowed_extensions_; | 90 std::string allowed_extensions_; |
84 std::vector<int32> requested_attribs_; | 91 std::vector<int32> requested_attribs_; |
85 uint32 parent_texture_id_; | 92 uint32 parent_texture_id_; |
86 int32 route_id_; | 93 int32 route_id_; |
87 | 94 |
88 // The following two fields are used on Mac OS X to identify the window | 95 // The following two fields are used on Mac OS X to identify the window |
89 // for the rendering results on the browser side. | 96 // for the rendering results on the browser side. |
90 int32 renderer_id_; | 97 int32 renderer_id_; |
91 int32 render_view_id_; | 98 int32 render_view_id_; |
92 | 99 |
93 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 100 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
94 scoped_ptr<gpu::GPUProcessor> processor_; | 101 scoped_ptr<gpu::GPUProcessor> processor_; |
95 | 102 |
96 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 103 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
97 }; | 104 }; |
98 | 105 |
99 #endif // ENABLE_GPU | 106 #endif // ENABLE_GPU |
100 | 107 |
101 #endif // CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 108 #endif // CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |