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 // Transport texture is a mechanism to share a texture between renderer process | 5 // Transport texture is a mechanism to share a texture between renderer process |
6 // and GPU process. This is useful when a texture is used in the renderer | 6 // and GPU process. This is useful when a texture is used in the renderer |
7 // process but updated in the GPU process. | 7 // process but updated in the GPU process. |
8 // | 8 // |
9 // BACKGROUND INFORMATION | 9 // BACKGROUND INFORMATION |
10 // | 10 // |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // | 144 // |
145 // Note that this method doesn't generate any textures, it simply return | 145 // Note that this method doesn't generate any textures, it simply return |
146 // the list of textures generated. | 146 // the list of textures generated. |
147 void GetTextures(TextureUpdateCallback* callback, | 147 void GetTextures(TextureUpdateCallback* callback, |
148 std::vector<int>* textures); | 148 std::vector<int>* textures); |
149 | 149 |
150 // Return the peer ID of TransportTexture in the GPU process. | 150 // Return the peer ID of TransportTexture in the GPU process. |
151 int GetPeerId(); | 151 int GetPeerId(); |
152 | 152 |
153 // IPC::Channel::Listener. | 153 // IPC::Channel::Listener. |
154 virtual void OnChannelConnected(int32 peer_pid); | 154 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
155 virtual void OnChannelError(); | 155 virtual void OnChannelError() OVERRIDE; |
156 virtual bool OnMessageReceived(const IPC::Message& message); | 156 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
157 | 157 |
158 private: | 158 private: |
159 // Released all textures generated. | 159 // Released all textures generated. |
160 void ReleaseTexturesInternal(); | 160 void ReleaseTexturesInternal(); |
161 | 161 |
162 // Send the texture IDs to the GPU process. This will copy the set of | 162 // Send the texture IDs to the GPU process. This will copy the set of |
163 // texture IDs. | 163 // texture IDs. |
164 void SendTexturesInternal(const std::vector<int>& textures); | 164 void SendTexturesInternal(const std::vector<int>& textures); |
165 | 165 |
166 // Send the destroy message to the GPU process. | 166 // Send the destroy message to the GPU process. |
(...skipping 21 matching lines...) Expand all Loading... |
188 // A list of textures generated. | 188 // A list of textures generated. |
189 std::vector<int> textures_; | 189 std::vector<int> textures_; |
190 | 190 |
191 // Callback when a texture is updated. | 191 // Callback when a texture is updated. |
192 scoped_ptr<TextureUpdateCallback> update_callback_; | 192 scoped_ptr<TextureUpdateCallback> update_callback_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(TransportTextureHost); | 194 DISALLOW_COPY_AND_ASSIGN(TransportTextureHost); |
195 }; | 195 }; |
196 | 196 |
197 #endif // CONTENT_RENDERER_GPU_TRANSPORT_TEXTURE_HOST_H_ | 197 #endif // CONTENT_RENDERER_GPU_TRANSPORT_TEXTURE_HOST_H_ |
OLD | NEW |