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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 0, | 46 0, |
47 GL_RGBA, | 47 GL_RGBA, |
48 size.width(), | 48 size.width(), |
49 size.height(), | 49 size.height(), |
50 1, | 50 1, |
51 0, | 51 0, |
52 GL_RGBA, | 52 GL_RGBA, |
53 GL_UNSIGNED_BYTE, | 53 GL_UNSIGNED_BYTE, |
54 true); | 54 true); |
55 texture_manager->SetLevelImage( | 55 texture_manager->SetLevelImage( |
56 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image); | 56 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get()); |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 return false; | 60 return false; |
61 } | 61 } |
62 | 62 |
63 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, | 63 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, |
64 int32 route_id, | 64 int32 route_id, |
65 uint32 texture_id) | 65 uint32 texture_id) |
66 : surface_texture_(gfx::SurfaceTexture::Create(texture_id)), | 66 : surface_texture_(gfx::SurfaceTexture::Create(texture_id)), |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 if (scoped_make_current.get()) { | 124 if (scoped_make_current.get()) { |
125 // UpdateTexImage() implies glBindTexture(). | 125 // UpdateTexImage() implies glBindTexture(). |
126 // The cmd decoder takes care of restoring the binding for this GLImage as | 126 // The cmd decoder takes care of restoring the binding for this GLImage as |
127 // far as the current context is concerned, but if we temporarily change | 127 // far as the current context is concerned, but if we temporarily change |
128 // it, we have to keep the state intact in *that* context also. | 128 // it, we have to keep the state intact in *that* context also. |
129 const gpu::gles2::ContextState* state = | 129 const gpu::gles2::ContextState* state = |
130 owner_stub_->decoder()->GetContextState(); | 130 owner_stub_->decoder()->GetContextState(); |
131 const gpu::gles2::TextureUnit& active_unit = | 131 const gpu::gles2::TextureUnit& active_unit = |
132 state->texture_units[state->active_texture_unit]; | 132 state->texture_units[state->active_texture_unit]; |
133 glBindTexture(GL_TEXTURE_EXTERNAL_OES, | 133 glBindTexture(GL_TEXTURE_EXTERNAL_OES, |
134 active_unit.bound_texture_external_oes | 134 active_unit.bound_texture_external_oes.get() |
135 ? active_unit.bound_texture_external_oes->service_id() | 135 ? active_unit.bound_texture_external_oes->service_id() |
136 : 0); | 136 : 0); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 if (has_listener_ && has_valid_frame_) { | 140 if (has_listener_ && has_valid_frame_) { |
141 float mtx[16]; | 141 float mtx[16]; |
142 surface_texture_->GetTransformMatrix(mtx); | 142 surface_texture_->GetTransformMatrix(mtx); |
143 | 143 |
144 // Only query the matrix once we have bound a valid frame. | 144 // Only query the matrix once we have bound a valid frame. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 bool StreamTexture::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 209 bool StreamTexture::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
210 int z_order, | 210 int z_order, |
211 gfx::OverlayTransform transform, | 211 gfx::OverlayTransform transform, |
212 const gfx::Rect& bounds_rect, | 212 const gfx::Rect& bounds_rect, |
213 const gfx::RectF& crop_rect) { | 213 const gfx::RectF& crop_rect) { |
214 NOTREACHED(); | 214 NOTREACHED(); |
215 return false; | 215 return false; |
216 } | 216 } |
217 | 217 |
218 } // namespace content | 218 } // namespace content |
OLD | NEW |