OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
6 #define CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 6 #define CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "content/common/android/surface_texture_peer.h" | 9 #include "content/common/android/surface_texture_peer.h" |
10 #include "ipc/ipc_listener.h" | 10 #include "ipc/ipc_listener.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 virtual void OnFrameAvailable() = 0; | 35 virtual void OnFrameAvailable() = 0; |
36 virtual void OnMatrixChanged(const float mtx[16]) = 0; | 36 virtual void OnMatrixChanged(const float mtx[16]) = 0; |
37 virtual ~Listener() {} | 37 virtual ~Listener() {} |
38 }; | 38 }; |
39 | 39 |
40 void SetListener(Listener* listener) { listener_ = listener; } | 40 void SetListener(Listener* listener) { listener_ = listener; } |
41 | 41 |
42 // Request the GPU process to create the surface texture and forward it | 42 // Request the GPU process to create the surface texture and forward it |
43 // to the renderer process. | 43 // to the renderer process. |
44 void EstablishPeer(SurfaceTexturePeer::SurfaceTextureTarget type, | 44 void EstablishPeer(int32 primary_id, int32 secondary_id); |
45 int32 primary_id, int32 secondary_id); | |
46 | 45 |
47 // IPC::Channel::Listener implementation: | 46 // IPC::Channel::Listener implementation: |
48 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 47 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
49 virtual void OnChannelError() OVERRIDE; | 48 virtual void OnChannelError() OVERRIDE; |
50 | 49 |
51 private: | 50 private: |
52 // Message handlers: | 51 // Message handlers: |
53 void OnFrameAvailable(); | 52 void OnFrameAvailable(); |
54 void OnMatrixChanged(const GpuStreamTextureMsg_MatrixChanged_Params& param); | 53 void OnMatrixChanged(const GpuStreamTextureMsg_MatrixChanged_Params& param); |
55 | 54 |
56 int route_id_; | 55 int route_id_; |
57 int stream_id_; | 56 int stream_id_; |
58 Listener* listener_; | 57 Listener* listener_; |
59 scoped_refptr<GpuChannelHost> channel_; | 58 scoped_refptr<GpuChannelHost> channel_; |
60 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_; | 59 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_; |
61 | 60 |
62 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost); | 61 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost); |
63 }; | 62 }; |
64 | 63 |
65 } // namespace content | 64 } // namespace content |
66 | 65 |
67 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 66 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
OLD | NEW |