| 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 "content/common/gpu/stream_texture_android.h" | 5 #include "content/common/gpu/stream_texture_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/common/android/surface_texture_peer.h" | 8 #include "content/common/android/surface_texture_peer.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image); | 58 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image); |
| 59 return route_id; | 59 return route_id; |
| 60 } | 60 } |
| 61 | 61 |
| 62 return 0; | 62 return 0; |
| 63 } | 63 } |
| 64 | 64 |
| 65 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, | 65 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, |
| 66 int32 route_id, | 66 int32 route_id, |
| 67 uint32 texture_id) | 67 uint32 texture_id) |
| 68 : surface_texture_(new gfx::SurfaceTexture(texture_id)), | 68 : surface_texture_(gfx::SurfaceTexture::Create(texture_id)), |
| 69 size_(0, 0), | 69 size_(0, 0), |
| 70 has_valid_frame_(false), | 70 has_valid_frame_(false), |
| 71 has_pending_frame_(false), | 71 has_pending_frame_(false), |
| 72 owner_stub_(owner_stub), | 72 owner_stub_(owner_stub), |
| 73 route_id_(route_id), | 73 route_id_(route_id), |
| 74 has_listener_(false), | 74 has_listener_(false), |
| 75 weak_factory_(this) { | 75 weak_factory_(this) { |
| 76 owner_stub->AddDestructionObserver(this); | 76 owner_stub->AddDestructionObserver(this); |
| 77 memset(current_matrix_, 0, sizeof(current_matrix_)); | 77 memset(current_matrix_, 0, sizeof(current_matrix_)); |
| 78 owner_stub->channel()->AddRoute(route_id, this); | 78 owner_stub->channel()->AddRoute(route_id, this); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 if (!owner_stub_) | 189 if (!owner_stub_) |
| 190 return; | 190 return; |
| 191 | 191 |
| 192 base::ProcessHandle process = owner_stub_->channel()->renderer_pid(); | 192 base::ProcessHandle process = owner_stub_->channel()->renderer_pid(); |
| 193 | 193 |
| 194 SurfaceTexturePeer::GetInstance()->EstablishSurfaceTexturePeer( | 194 SurfaceTexturePeer::GetInstance()->EstablishSurfaceTexturePeer( |
| 195 process, surface_texture_, primary_id, secondary_id); | 195 process, surface_texture_, primary_id, secondary_id); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace content | 198 } // namespace content |
| OLD | NEW |