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 20 matching lines...) Expand all Loading... |
31 GLES2Decoder* decoder = owner_stub->decoder(); | 31 GLES2Decoder* decoder = owner_stub->decoder(); |
32 TextureManager* texture_manager = | 32 TextureManager* texture_manager = |
33 decoder->GetContextGroup()->texture_manager(); | 33 decoder->GetContextGroup()->texture_manager(); |
34 TextureRef* texture = texture_manager->GetTexture(client_texture_id); | 34 TextureRef* texture = texture_manager->GetTexture(client_texture_id); |
35 | 35 |
36 if (texture && (!texture->texture()->target() || | 36 if (texture && (!texture->texture()->target() || |
37 texture->texture()->target() == GL_TEXTURE_EXTERNAL_OES)) { | 37 texture->texture()->target() == GL_TEXTURE_EXTERNAL_OES)) { |
38 | 38 |
39 // TODO: Ideally a valid image id was returned to the client so that | 39 // TODO: Ideally a valid image id was returned to the client so that |
40 // it could then call glBindTexImage2D() for doing the following. | 40 // it could then call glBindTexImage2D() for doing the following. |
41 scoped_refptr<gfx::GLImage> gl_image( | 41 scoped_refptr<gl::GLImage> gl_image( |
42 new StreamTexture(owner_stub, stream_id, texture->service_id())); | 42 new StreamTexture(owner_stub, stream_id, texture->service_id())); |
43 gfx::Size size = gl_image->GetSize(); | 43 gfx::Size size = gl_image->GetSize(); |
44 texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES); | 44 texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES); |
45 texture_manager->SetLevelInfo(texture, GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA, | 45 texture_manager->SetLevelInfo(texture, GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA, |
46 size.width(), size.height(), 1, 0, GL_RGBA, | 46 size.width(), size.height(), 1, 0, GL_RGBA, |
47 GL_UNSIGNED_BYTE, gfx::Rect(size)); | 47 GL_UNSIGNED_BYTE, gfx::Rect(size)); |
48 texture_manager->SetLevelImage(texture, GL_TEXTURE_EXTERNAL_OES, 0, | 48 texture_manager->SetLevelImage(texture, GL_TEXTURE_EXTERNAL_OES, 0, |
49 gl_image.get(), | 49 gl_image.get(), |
50 gpu::gles2::Texture::UNBOUND); | 50 gpu::gles2::Texture::UNBOUND); |
51 return true; | 51 return true; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 return false; | 242 return false; |
243 } | 243 } |
244 | 244 |
245 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 245 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
246 uint64_t process_tracing_id, | 246 uint64_t process_tracing_id, |
247 const std::string& dump_name) { | 247 const std::string& dump_name) { |
248 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 | 248 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 |
249 } | 249 } |
250 | 250 |
251 } // namespace content | 251 } // namespace content |
OLD | NEW |