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

Side by Side Diff: gpu/ipc/service/stream_texture_android.cc

Issue 2420083004: Delete SurfaceTexturePeer (Closed)
Patch Set: Fix missed references Created 3 years, 10 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
« no previous file with comments | « gpu/ipc/service/stream_texture_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "gpu/ipc/service/stream_texture_android.h" 5 #include "gpu/ipc/service/stream_texture_android.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "gpu/command_buffer/service/context_group.h" 10 #include "gpu/command_buffer/service/context_group.h"
11 #include "gpu/command_buffer/service/context_state.h" 11 #include "gpu/command_buffer/service/context_state.h"
12 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 12 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
13 #include "gpu/command_buffer/service/texture_manager.h" 13 #include "gpu/command_buffer/service/texture_manager.h"
14 #include "gpu/ipc/common/android/scoped_surface_request_conduit.h" 14 #include "gpu/ipc/common/android/scoped_surface_request_conduit.h"
15 #include "gpu/ipc/common/android/surface_texture_peer.h"
16 #include "gpu/ipc/common/gpu_messages.h" 15 #include "gpu/ipc/common/gpu_messages.h"
17 #include "gpu/ipc/service/gpu_channel.h" 16 #include "gpu/ipc/service/gpu_channel.h"
18 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
19 #include "ui/gl/gl_context.h" 18 #include "ui/gl/gl_context.h"
20 #include "ui/gl/scoped_make_current.h" 19 #include "ui/gl/scoped_make_current.h"
21 20
22 namespace gpu { 21 namespace gpu {
23 22
24 using gles2::ContextGroup; 23 using gles2::ContextGroup;
25 using gles2::GLES2Decoder; 24 using gles2::GLES2Decoder;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 unsigned StreamTexture::GetInternalFormat() { 190 unsigned StreamTexture::GetInternalFormat() {
192 return GL_RGBA; 191 return GL_RGBA;
193 } 192 }
194 193
195 bool StreamTexture::OnMessageReceived(const IPC::Message& message) { 194 bool StreamTexture::OnMessageReceived(const IPC::Message& message) {
196 bool handled = true; 195 bool handled = true;
197 IPC_BEGIN_MESSAGE_MAP(StreamTexture, message) 196 IPC_BEGIN_MESSAGE_MAP(StreamTexture, message)
198 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_StartListening, OnStartListening) 197 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_StartListening, OnStartListening)
199 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_ForwardForSurfaceRequest, 198 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_ForwardForSurfaceRequest,
200 OnForwardForSurfaceRequest) 199 OnForwardForSurfaceRequest)
201 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_EstablishPeer, OnEstablishPeer)
202 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_SetSize, OnSetSize) 200 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_SetSize, OnSetSize)
203 IPC_MESSAGE_UNHANDLED(handled = false) 201 IPC_MESSAGE_UNHANDLED(handled = false)
204 IPC_END_MESSAGE_MAP() 202 IPC_END_MESSAGE_MAP()
205 203
206 DCHECK(handled); 204 DCHECK(handled);
207 return handled; 205 return handled;
208 } 206 }
209 207
210 void StreamTexture::OnStartListening() { 208 void StreamTexture::OnStartListening() {
211 DCHECK(!has_listener_); 209 DCHECK(!has_listener_);
212 has_listener_ = true; 210 has_listener_ = true;
213 } 211 }
214 212
215 void StreamTexture::OnEstablishPeer(int32_t primary_id, int32_t secondary_id) {
216 if (!owner_stub_)
217 return;
218
219 base::ProcessHandle process = owner_stub_->channel()->GetClientPID();
220
221 SurfaceTexturePeer::GetInstance()->EstablishSurfaceTexturePeer(
222 process, surface_texture_, primary_id, secondary_id);
223 }
224
225 void StreamTexture::OnForwardForSurfaceRequest( 213 void StreamTexture::OnForwardForSurfaceRequest(
226 const base::UnguessableToken& request_token) { 214 const base::UnguessableToken& request_token) {
227 if (!owner_stub_) 215 if (!owner_stub_)
228 return; 216 return;
229 217
230 ScopedSurfaceRequestConduit::GetInstance() 218 ScopedSurfaceRequestConduit::GetInstance()
231 ->ForwardSurfaceTextureForSurfaceRequest(request_token, 219 ->ForwardSurfaceTextureForSurfaceRequest(request_token,
232 surface_texture_.get()); 220 surface_texture_.get());
233 } 221 }
234 222
(...skipping 21 matching lines...) Expand all
256 return false; 244 return false;
257 } 245 }
258 246
259 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 247 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
260 uint64_t process_tracing_id, 248 uint64_t process_tracing_id,
261 const std::string& dump_name) { 249 const std::string& dump_name) {
262 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 250 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914
263 } 251 }
264 252
265 } // namespace gpu 253 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/stream_texture_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698