OLD | NEW |
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" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 : surface_texture_(gl::SurfaceTexture::Create(texture_id)), | 61 : surface_texture_(gl::SurfaceTexture::Create(texture_id)), |
62 size_(0, 0), | 62 size_(0, 0), |
63 has_pending_frame_(false), | 63 has_pending_frame_(false), |
64 owner_stub_(owner_stub), | 64 owner_stub_(owner_stub), |
65 route_id_(route_id), | 65 route_id_(route_id), |
66 has_listener_(false), | 66 has_listener_(false), |
67 texture_id_(texture_id), | 67 texture_id_(texture_id), |
68 weak_factory_(this) { | 68 weak_factory_(this) { |
69 owner_stub->AddDestructionObserver(this); | 69 owner_stub->AddDestructionObserver(this); |
70 memset(current_matrix_, 0, sizeof(current_matrix_)); | 70 memset(current_matrix_, 0, sizeof(current_matrix_)); |
71 owner_stub->channel()->AddRoute(route_id, owner_stub->stream_id(), this); | 71 owner_stub->channel()->AddRoute(route_id, owner_stub->sequence_id(), this); |
72 surface_texture_->SetFrameAvailableCallback(base::Bind( | 72 surface_texture_->SetFrameAvailableCallback(base::Bind( |
73 &StreamTexture::OnFrameAvailable, weak_factory_.GetWeakPtr())); | 73 &StreamTexture::OnFrameAvailable, weak_factory_.GetWeakPtr())); |
74 } | 74 } |
75 | 75 |
76 StreamTexture::~StreamTexture() { | 76 StreamTexture::~StreamTexture() { |
77 if (owner_stub_) { | 77 if (owner_stub_) { |
78 owner_stub_->RemoveDestructionObserver(this); | 78 owner_stub_->RemoveDestructionObserver(this); |
79 owner_stub_->channel()->RemoveRoute(route_id_); | 79 owner_stub_->channel()->RemoveRoute(route_id_); |
80 } | 80 } |
81 } | 81 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 return false; | 244 return false; |
245 } | 245 } |
246 | 246 |
247 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 247 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
248 uint64_t process_tracing_id, | 248 uint64_t process_tracing_id, |
249 const std::string& dump_name) { | 249 const std::string& dump_name) { |
250 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 | 250 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 |
251 } | 251 } |
252 | 252 |
253 } // namespace gpu | 253 } // namespace gpu |
OLD | NEW |