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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 if (texture && (!texture->texture()->target() || | 35 if (texture && (!texture->texture()->target() || |
36 texture->texture()->target() == GL_TEXTURE_EXTERNAL_OES)) { | 36 texture->texture()->target() == GL_TEXTURE_EXTERNAL_OES)) { |
37 | 37 |
38 // TODO: Ideally a valid image id was returned to the client so that | 38 // TODO: Ideally a valid image id was returned to the client so that |
39 // it could then call glBindTexImage2D() for doing the following. | 39 // it could then call glBindTexImage2D() for doing the following. |
40 scoped_refptr<gfx::GLImage> gl_image( | 40 scoped_refptr<gfx::GLImage> gl_image( |
41 new StreamTexture(owner_stub, stream_id, texture->service_id())); | 41 new StreamTexture(owner_stub, stream_id, texture->service_id())); |
42 gfx::Size size = gl_image->GetSize(); | 42 gfx::Size size = gl_image->GetSize(); |
43 texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES); | 43 texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES); |
44 texture_manager->SetLevelInfo(texture, | 44 texture_manager->SetLevelInfo(texture, GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA, |
45 GL_TEXTURE_EXTERNAL_OES, | 45 size.width(), size.height(), 1, 0, GL_RGBA, |
46 0, | 46 GL_UNSIGNED_BYTE, gfx::Rect(size)); |
47 GL_RGBA, | |
48 size.width(), | |
49 size.height(), | |
50 1, | |
51 0, | |
52 GL_RGBA, | |
53 GL_UNSIGNED_BYTE, | |
54 true); | |
55 texture_manager->SetLevelImage( | 47 texture_manager->SetLevelImage( |
56 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get()); | 48 texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get()); |
57 return true; | 49 return true; |
58 } | 50 } |
59 | 51 |
60 return false; | 52 return false; |
61 } | 53 } |
62 | 54 |
63 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, | 55 StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub, |
64 int32 route_id, | 56 int32 route_id, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 bool StreamTexture::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 207 bool StreamTexture::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
216 int z_order, | 208 int z_order, |
217 gfx::OverlayTransform transform, | 209 gfx::OverlayTransform transform, |
218 const gfx::Rect& bounds_rect, | 210 const gfx::Rect& bounds_rect, |
219 const gfx::RectF& crop_rect) { | 211 const gfx::RectF& crop_rect) { |
220 NOTREACHED(); | 212 NOTREACHED(); |
221 return false; | 213 return false; |
222 } | 214 } |
223 | 215 |
224 } // namespace content | 216 } // namespace content |
OLD | NEW |