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 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CONTENT_COMMON_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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Identifies the various GpuCommandBufferStubs in the GPU process belonging | 62 // Identifies the various GpuCommandBufferStubs in the GPU process belonging |
63 // to the same renderer process. | 63 // to the same renderer process. |
64 int32 route_id() const { return route_id_; } | 64 int32 route_id() const { return route_id_; } |
65 | 65 |
66 #if defined(OS_WIN) | 66 #if defined(OS_WIN) |
67 // Called only by the compositor window's window proc | 67 // Called only by the compositor window's window proc |
68 void OnCompositorWindowPainted(); | 68 void OnCompositorWindowPainted(); |
69 #endif // defined(OS_WIN) | 69 #endif // defined(OS_WIN) |
70 | 70 |
| 71 void ViewResized(); |
| 72 |
71 #if defined(OS_MACOSX) | 73 #if defined(OS_MACOSX) |
72 // Called only by the GpuChannel. | 74 // Called only by the GpuChannel. |
73 void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count); | 75 void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count); |
74 #endif // defined(OS_MACOSX) | 76 #endif // defined(OS_MACOSX) |
75 | 77 |
76 private: | 78 private: |
77 // Message handlers: | 79 // Message handlers: |
78 void OnInitialize(base::SharedMemoryHandle ring_buffer, | 80 void OnInitialize(base::SharedMemoryHandle ring_buffer, |
79 int32 size, | 81 int32 size, |
80 bool* result); | 82 bool* result); |
(...skipping 13 matching lines...) Expand all Loading... |
94 void OnResizeOffscreenFrameBuffer(const gfx::Size& size); | 96 void OnResizeOffscreenFrameBuffer(const gfx::Size& size); |
95 | 97 |
96 void OnSwapBuffers(); | 98 void OnSwapBuffers(); |
97 void OnCommandProcessed(); | 99 void OnCommandProcessed(); |
98 | 100 |
99 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
100 void OnSetWindowSize(const gfx::Size& size); | 102 void OnSetWindowSize(const gfx::Size& size); |
101 void SwapBuffersCallback(); | 103 void SwapBuffersCallback(); |
102 #endif // defined(OS_MACOSX) | 104 #endif // defined(OS_MACOSX) |
103 | 105 |
104 #if defined(OS_WIN) | |
105 bool CreateCompositorWindow(); | |
106 #endif // defined(OS_WIN) | |
107 | |
108 void ResizeCallback(gfx::Size size); | 106 void ResizeCallback(gfx::Size size); |
109 | 107 |
110 // The lifetime of objects of this class is managed by a GpuChannel. The | 108 // The lifetime of objects of this class is managed by a GpuChannel. The |
111 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they | 109 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they |
112 // are destroyed. So a raw pointer is safe. | 110 // are destroyed. So a raw pointer is safe. |
113 GpuChannel* channel_; | 111 GpuChannel* channel_; |
114 | 112 |
115 gfx::PluginWindowHandle handle_; | 113 gfx::PluginWindowHandle handle_; |
116 base::WeakPtr<GpuCommandBufferStub> parent_; | 114 base::WeakPtr<GpuCommandBufferStub> parent_; |
117 gfx::Size initial_size_; | 115 gfx::Size initial_size_; |
118 gpu::gles2::DisallowedExtensions disallowed_extensions_; | 116 gpu::gles2::DisallowedExtensions disallowed_extensions_; |
119 std::string allowed_extensions_; | 117 std::string allowed_extensions_; |
120 std::vector<int32> requested_attribs_; | 118 std::vector<int32> requested_attribs_; |
121 uint32 parent_texture_id_; | 119 uint32 parent_texture_id_; |
122 int32 route_id_; | 120 int32 route_id_; |
123 | 121 |
124 #if defined(OS_WIN) | |
125 HWND compositor_window_; | |
126 #endif // defined(OS_WIN) | |
127 | |
128 // The following two fields are used on Mac OS X to identify the window | 122 // The following two fields are used on Mac OS X to identify the window |
129 // for the rendering results on the browser side. | 123 // for the rendering results on the browser side. |
130 int32 renderer_id_; | 124 int32 renderer_id_; |
131 int32 render_view_id_; | 125 int32 render_view_id_; |
132 | 126 |
133 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 127 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
134 scoped_ptr<gpu::GpuScheduler> scheduler_; | 128 scoped_ptr<gpu::GpuScheduler> scheduler_; |
135 GpuWatchdog* watchdog_; | 129 GpuWatchdog* watchdog_; |
136 | 130 |
137 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 131 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
138 }; | 132 }; |
139 | 133 |
140 #endif // defined(ENABLE_GPU) | 134 #endif // defined(ENABLE_GPU) |
141 | 135 |
142 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 136 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |