Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.h

Issue 7253052: Execute all GL commands up to the put offset reported by a flush. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 GpuWatchdog* watchdog); 44 GpuWatchdog* watchdog);
45 45
46 virtual ~GpuCommandBufferStub(); 46 virtual ~GpuCommandBufferStub();
47 47
48 // IPC::Channel::Listener implementation: 48 // IPC::Channel::Listener implementation:
49 virtual bool OnMessageReceived(const IPC::Message& message); 49 virtual bool OnMessageReceived(const IPC::Message& message);
50 50
51 // IPC::Message::Sender implementation: 51 // IPC::Message::Sender implementation:
52 virtual bool Send(IPC::Message* msg); 52 virtual bool Send(IPC::Message* msg);
53 53
54 // Whether this command buffer can currently handle IPC messages.
55 bool IsScheduled();
56
54 // Get the GLContext associated with this object. 57 // Get the GLContext associated with this object.
55 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } 58 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); }
56 59
57 // Identifies the renderer process. 60 // Identifies the renderer process.
58 int32 renderer_id() const { return renderer_id_; } 61 int32 renderer_id() const { return renderer_id_; }
59 62
60 // Identifies a particular renderer belonging to the same renderer process. 63 // Identifies a particular renderer belonging to the same renderer process.
61 int32 render_view_id() const { return render_view_id_; } 64 int32 render_view_id() const { return render_view_id_; }
62 65
63 // Identifies the various GpuCommandBufferStubs in the GPU process belonging 66 // Identifies the various GpuCommandBufferStubs in the GPU process belonging
(...skipping 16 matching lines...) Expand all
80 #if defined(TOUCH_UI) 83 #if defined(TOUCH_UI)
81 void AcceleratedSurfaceIOSurfaceSet(uint64 surface_id); 84 void AcceleratedSurfaceIOSurfaceSet(uint64 surface_id);
82 void AcceleratedSurfaceReleased(uint64 surface_id); 85 void AcceleratedSurfaceReleased(uint64 surface_id);
83 #endif // defined(TOUCH_UI) 86 #endif // defined(TOUCH_UI)
84 87
85 #if defined(OS_MACOSX) || defined(TOUCH_UI) 88 #if defined(OS_MACOSX) || defined(TOUCH_UI)
86 // Called only by the GpuChannel. 89 // Called only by the GpuChannel.
87 void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count); 90 void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count);
88 #endif // defined(OS_MACOSX) || defined(TOUCH_UI) 91 #endif // defined(OS_MACOSX) || defined(TOUCH_UI)
89 92
90 // Called when the command buffer was destroyed, and the stub should now
91 // unblock itself and handle pending messages.
92 void CommandBufferWasDestroyed();
93
94 // Register a callback to be Run() whenever the underlying scheduler receives 93 // Register a callback to be Run() whenever the underlying scheduler receives
95 // a set_token() call. The callback will be Run() with the just-set token as 94 // a set_token() call. The callback will be Run() with the just-set token as
96 // its only parameter. Multiple callbacks may be registered. 95 // its only parameter. Multiple callbacks may be registered.
97 void AddSetTokenCallback(const base::Callback<void(int32)>& callback); 96 void AddSetTokenCallback(const base::Callback<void(int32)>& callback);
98 97
99 private: 98 private:
100 // Message handlers: 99 // Message handlers:
101 void OnInitialize(base::SharedMemoryHandle ring_buffer, 100 void OnInitialize(base::SharedMemoryHandle ring_buffer,
102 int32 size, 101 int32 size,
103 IPC::Message* reply_message); 102 IPC::Message* reply_message);
(...skipping 16 matching lines...) Expand all
120 void OnDestroyTransferBuffer(int32 id, IPC::Message* reply_message); 119 void OnDestroyTransferBuffer(int32 id, IPC::Message* reply_message);
121 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message); 120 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message);
122 void OnResizeOffscreenFrameBuffer(const gfx::Size& size); 121 void OnResizeOffscreenFrameBuffer(const gfx::Size& size);
123 122
124 void OnCreateVideoDecoder(int32 decoder_host_id, 123 void OnCreateVideoDecoder(int32 decoder_host_id,
125 const std::vector<uint32>& configs); 124 const std::vector<uint32>& configs);
126 void OnDestroyVideoDecoder(); 125 void OnDestroyVideoDecoder();
127 126
128 void OnSwapBuffers(); 127 void OnSwapBuffers();
129 void OnCommandProcessed(); 128 void OnCommandProcessed();
130 void HandleDeferredMessages();
131 void OnScheduled();
132 void OnParseError(); 129 void OnParseError();
133 130
134 #if defined(OS_MACOSX) 131 #if defined(OS_MACOSX)
135 void OnSetWindowSize(const gfx::Size& size); 132 void OnSetWindowSize(const gfx::Size& size);
136 #endif // defined(OS_MACOSX) 133 #endif // defined(OS_MACOSX)
137 134
138 #if defined(OS_MACOSX) || defined(TOUCH_UI) 135 #if defined(OS_MACOSX) || defined(TOUCH_UI)
139 void SwapBuffersCallback(); 136 void SwapBuffersCallback();
140 #endif // defined(TOUCH_UI) 137 #endif // defined(TOUCH_UI)
141 138
(...skipping 16 matching lines...) Expand all
158 int32 route_id_; 155 int32 route_id_;
159 uint32 last_flush_count_; 156 uint32 last_flush_count_;
160 157
161 // The following two fields are used on Mac OS X to identify the window 158 // The following two fields are used on Mac OS X to identify the window
162 // for the rendering results on the browser side. 159 // for the rendering results on the browser side.
163 int32 renderer_id_; 160 int32 renderer_id_;
164 int32 render_view_id_; 161 int32 render_view_id_;
165 162
166 scoped_ptr<gpu::CommandBufferService> command_buffer_; 163 scoped_ptr<gpu::CommandBufferService> command_buffer_;
167 scoped_ptr<gpu::GpuScheduler> scheduler_; 164 scoped_ptr<gpu::GpuScheduler> scheduler_;
168 std::queue<IPC::Message*> deferred_messages_;
169 std::vector<base::Callback<void(int32)> > set_token_callbacks_; 165 std::vector<base::Callback<void(int32)> > set_token_callbacks_;
170 166
171 // SetParent may be called before Initialize, in which case we need to keep 167 // SetParent may be called before Initialize, in which case we need to keep
172 // around the parent stub, so that Initialize can set the parent correctly. 168 // around the parent stub, so that Initialize can set the parent correctly.
173 base::WeakPtr<GpuCommandBufferStub> parent_stub_for_initialization_; 169 base::WeakPtr<GpuCommandBufferStub> parent_stub_for_initialization_;
174 uint32 parent_texture_for_initialization_; 170 uint32 parent_texture_for_initialization_;
175 171
176 GpuWatchdog* watchdog_; 172 GpuWatchdog* watchdog_;
177 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_; 173 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_;
178 174
179 // The video decoder associated with this stub, if any. 175 // The video decoder associated with this stub, if any.
180 scoped_ptr<GpuVideoDecodeAccelerator> video_decoder_; 176 scoped_ptr<GpuVideoDecodeAccelerator> video_decoder_;
181 177
182 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 178 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
183 }; 179 };
184 180
185 #endif // defined(ENABLE_GPU) 181 #endif // defined(ENABLE_GPU)
186 182
187 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 183 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698