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

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

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // IPC::Channel::Listener implementation: 60 // IPC::Channel::Listener implementation:
61 virtual bool OnMessageReceived(const IPC::Message& message); 61 virtual bool OnMessageReceived(const IPC::Message& message);
62 62
63 // IPC::Message::Sender implementation: 63 // IPC::Message::Sender implementation:
64 virtual bool Send(IPC::Message* msg); 64 virtual bool Send(IPC::Message* msg);
65 65
66 // Whether this command buffer can currently handle IPC messages. 66 // Whether this command buffer can currently handle IPC messages.
67 bool IsScheduled(); 67 bool IsScheduled();
68 68
69 // Set the swap interval according to the command line.
70 void SetSwapInterval();
71
69 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } 72 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); }
70 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } 73 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); }
71 74
72 // Identifies the renderer process. 75 // Identifies the renderer process.
73 int32 renderer_id() const { return renderer_id_; } 76 int32 renderer_id() const { return renderer_id_; }
74 77
75 // Identifies a particular renderer belonging to the same renderer process. 78 // Identifies a particular renderer belonging to the same renderer process.
76 int32 render_view_id() const { return render_view_id_; } 79 int32 render_view_id() const { return render_view_id_; }
77 80
78 // Identifies the various GpuCommandBufferStubs in the GPU process belonging 81 // Identifies the various GpuCommandBufferStubs in the GPU process belonging
79 // to the same renderer process. 82 // to the same renderer process.
80 int32 route_id() const { return route_id_; } 83 int32 route_id() const { return route_id_; }
81 84
82 void ViewResized();
83
84 gfx::GpuPreference gpu_preference() { return gpu_preference_; } 85 gfx::GpuPreference gpu_preference() { return gpu_preference_; }
85 86
86 private: 87 private:
87 void Destroy(); 88 void Destroy();
88 89
89 // Cleans up and sends reply if OnInitialize failed. 90 // Cleans up and sends reply if OnInitialize failed.
90 void OnInitializeFailed(IPC::Message* reply_message); 91 void OnInitializeFailed(IPC::Message* reply_message);
91 92
92 // Message handlers: 93 // Message handlers:
93 void OnInitialize(base::SharedMemoryHandle ring_buffer, 94 void OnInitialize(base::SharedMemoryHandle ring_buffer,
(...skipping 17 matching lines...) Expand all
111 void OnDestroyTransferBuffer(int32 id, IPC::Message* reply_message); 112 void OnDestroyTransferBuffer(int32 id, IPC::Message* reply_message);
112 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message); 113 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message);
113 114
114 void OnCreateVideoDecoder( 115 void OnCreateVideoDecoder(
115 media::VideoDecodeAccelerator::Profile profile, 116 media::VideoDecodeAccelerator::Profile profile,
116 IPC::Message* reply_message); 117 IPC::Message* reply_message);
117 void OnDestroyVideoDecoder(int32 decoder_route_id); 118 void OnDestroyVideoDecoder(int32 decoder_route_id);
118 119
119 void OnSetSurfaceVisible(bool visible); 120 void OnSetSurfaceVisible(bool visible);
120 121
121 #if defined(OS_MACOSX)
122 void OnSwapBuffers();
123
124 // Returns the id of the current surface that is being rendered to
125 // (or 0 if no such surface has been created).
126 uint64 GetSurfaceId();
127 #endif
128
129 void OnCommandProcessed(); 122 void OnCommandProcessed();
130 void OnParseError(); 123 void OnParseError();
131 124
132 void OnResize(gfx::Size size);
133 void ReportState(); 125 void ReportState();
134 126
135 void SetSwapInterval();
136
137 // The lifetime of objects of this class is managed by a GpuChannel. The 127 // The lifetime of objects of this class is managed by a GpuChannel. The
138 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they 128 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they
139 // are destroyed. So a raw pointer is safe. 129 // are destroyed. So a raw pointer is safe.
140 GpuChannel* channel_; 130 GpuChannel* channel_;
141 131
142 // The group of contexts that share namespaces with this context. 132 // The group of contexts that share namespaces with this context.
143 scoped_refptr<gpu::gles2::ContextGroup> context_group_; 133 scoped_refptr<gpu::gles2::ContextGroup> context_group_;
144 134
145 gfx::PluginWindowHandle handle_; 135 gfx::PluginWindowHandle handle_;
146 gfx::Size initial_size_; 136 gfx::Size initial_size_;
(...skipping 28 matching lines...) Expand all
175 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; 165 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_;
176 166
177 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_; 167 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_;
178 168
179 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 169 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
180 }; 170 };
181 171
182 #endif // defined(ENABLE_GPU) 172 #endif // defined(ENABLE_GPU)
183 173
184 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 174 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel_manager.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698