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 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 std::vector<int>* textures, Task* done_task); | 53 std::vector<int>* textures, Task* done_task); |
54 | 54 |
55 // Release all textures that have previously been allocated. | 55 // Release all textures that have previously been allocated. |
56 void ReleaseTextures(); | 56 void ReleaseTextures(); |
57 | 57 |
58 // Notify that the texture has been updated. Notification will be sent to the | 58 // Notify that the texture has been updated. Notification will be sent to the |
59 // renderer process. | 59 // renderer process. |
60 void TextureUpdated(int texture_id); | 60 void TextureUpdated(int texture_id); |
61 | 61 |
62 // IPC::Channel::Listener implementation. | 62 // IPC::Channel::Listener implementation. |
63 virtual void OnChannelConnected(int32 peer_pid); | 63 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
64 virtual void OnChannelError(); | 64 virtual void OnChannelError() OVERRIDE; |
65 virtual bool OnMessageReceived(const IPC::Message& msg); | 65 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
66 | 66 |
67 private: | 67 private: |
68 // Mapping from service (GPU) IDs to client (Renderer) IDs. | 68 // Mapping from service (GPU) IDs to client (Renderer) IDs. |
69 typedef std::map<int, int> TextureMap; | 69 typedef std::map<int, int> TextureMap; |
70 | 70 |
71 /////////////////////////////////////////////////////////////////////////// | 71 /////////////////////////////////////////////////////////////////////////// |
72 // IPC Message Handlers | 72 // IPC Message Handlers |
73 void OnDestroy(); | 73 void OnDestroy(); |
74 void OnTexturesCreated(const std::vector<int>& textures); | 74 void OnTexturesCreated(const std::vector<int>& textures); |
75 | 75 |
(...skipping 13 matching lines...) Expand all 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 |