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

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

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

Powered by Google App Engine
This is Rietveld 408576698