| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This clasis used together with TansportTextureHost in the renderer process | 5 // This clasis used together with TansportTextureHost in the renderer process |
| 6 // to provide a mechanism for an object in the GPU process to create textures | 6 // to provide a mechanism for an object in the GPU process to create textures |
| 7 // and be used in the renderer process. | 7 // and be used in the renderer process. |
| 8 // | 8 // |
| 9 // See content/gpu/transport_texture_host.h for usage and details. | 9 // See content/gpu/transport_texture_host.h for usage and details. |
| 10 | 10 |
| 11 #ifndef CONTENT_COMMON_GPU_TRANSPORT_TEXTURE_H_ | 11 #ifndef CONTENT_COMMON_GPU_TRANSPORT_TEXTURE_H_ |
| 12 #define CONTENT_COMMON_GPU_TRANSPORT_TEXTURE_H_ | 12 #define CONTENT_COMMON_GPU_TRANSPORT_TEXTURE_H_ |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 #include <map> | 15 #include <map> |
| 16 | 16 |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/task.h" | 19 #include "base/task.h" |
| 20 #include "ipc/ipc_channel.h" | 20 #include "ipc/ipc_channel.h" |
| 21 | 21 |
| 22 class GpuChannel; | 22 class GpuChannel; |
| 23 | 23 |
| 24 namespace gpu { | 24 namespace gpu { |
| 25 namespace gles2 { | 25 namespace gles2 { |
| 26 class GLES2Decoder; | 26 class GLES2Decoder; |
| 27 } // namespace gles2 | 27 } // namespace gles2 |
| 28 } // namespace gpu | 28 } // namespace gpu |
| 29 | 29 |
| 30 class TransportTexture : public IPC::Channel::Listener { | 30 class TransportTexture : public IPC::Channel::Listener { |
| 31 public: | 31 public: |
| 32 enum Format { | 32 enum Format { |
| 33 RGBA, // GL_RGBA | 33 RGBA, // GL_RGBA |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // |channel| is the owner of this object. | 36 // |channel| is the owner of this object. |
| 37 // |sender| is used to send send IPC messages. | 37 // |sender| is used to send send IPC messages. |
| 38 // |decoder| is the decoder for GLES2 command buffer, used to convert texture | 38 // |decoder| is the decoder for GLES2 command buffer, used to convert texture |
| 39 // IDs. | 39 // IDs. |
| 40 // |host_id| is ID of TransportTextureHost in Renderer process. | 40 // |host_id| is ID of TransportTextureHost in Renderer process. |
| 41 // |id| is ID of this object in GpuChannel. | 41 // |id| is ID of this object in GpuChannel. |
| 42 TransportTexture(GpuChannel* channel, | 42 TransportTexture(GpuChannel* channel, |
| 43 IPC::Message::Sender* sender, | 43 IPC::Message::Sender* sender, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Task that gets called when textures are generated. | 89 // Task that gets called when textures are generated. |
| 90 scoped_ptr<Task> create_task_; | 90 scoped_ptr<Task> create_task_; |
| 91 | 91 |
| 92 // Mapping between service (GPU) IDs to client (Renderer) IDs. | 92 // Mapping between service (GPU) IDs to client (Renderer) IDs. |
| 93 TextureMap texture_map_; | 93 TextureMap texture_map_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(TransportTexture); | 95 DISALLOW_COPY_AND_ASSIGN(TransportTexture); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 #endif // CONTENT_COMMON_GPU_TRANSPORT_TEXTURE_H_ | 98 #endif // CONTENT_COMMON_GPU_TRANSPORT_TEXTURE_H_ |
| OLD | NEW |