| 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 <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 8 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 9 #include "content/common/android/surface_texture_peer.h" | 12 #include "content/common/android/surface_texture_peer.h" |
| 10 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
| 11 #include "ipc/ipc_message.h" | 14 #include "ipc/ipc_message.h" |
| 12 | 15 |
| 13 namespace gfx { | 16 namespace gfx { |
| 14 class Size; | 17 class Size; |
| 15 } | 18 } |
| 16 | 19 |
| 17 struct GpuStreamTextureMsg_MatrixChanged_Params; | 20 struct GpuStreamTextureMsg_MatrixChanged_Params; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 | 31 |
| 29 // Listener class that is listening to the stream texture updates. It is | 32 // Listener class that is listening to the stream texture updates. It is |
| 30 // implemented by StreamTextureProxyImpl. | 33 // implemented by StreamTextureProxyImpl. |
| 31 class Listener { | 34 class Listener { |
| 32 public: | 35 public: |
| 33 virtual void OnFrameAvailable() = 0; | 36 virtual void OnFrameAvailable() = 0; |
| 34 virtual void OnMatrixChanged(const float mtx[16]) = 0; | 37 virtual void OnMatrixChanged(const float mtx[16]) = 0; |
| 35 virtual ~Listener() {} | 38 virtual ~Listener() {} |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 bool BindToCurrentThread(int32 stream_id, Listener* listener); | 41 bool BindToCurrentThread(int32_t stream_id, Listener* listener); |
| 39 | 42 |
| 40 // IPC::Channel::Listener implementation: | 43 // IPC::Channel::Listener implementation: |
| 41 bool OnMessageReceived(const IPC::Message& message) override; | 44 bool OnMessageReceived(const IPC::Message& message) override; |
| 42 void OnChannelError() override; | 45 void OnChannelError() override; |
| 43 | 46 |
| 44 private: | 47 private: |
| 45 // Message handlers: | 48 // Message handlers: |
| 46 void OnFrameAvailable(); | 49 void OnFrameAvailable(); |
| 47 void OnMatrixChanged(const GpuStreamTextureMsg_MatrixChanged_Params& param); | 50 void OnMatrixChanged(const GpuStreamTextureMsg_MatrixChanged_Params& param); |
| 48 | 51 |
| 49 int stream_id_; | 52 int stream_id_; |
| 50 Listener* listener_; | 53 Listener* listener_; |
| 51 scoped_refptr<GpuChannelHost> channel_; | 54 scoped_refptr<GpuChannelHost> channel_; |
| 52 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_; | 55 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_; |
| 53 | 56 |
| 54 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost); | 57 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace content | 60 } // namespace content |
| 58 | 61 |
| 59 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 62 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
| OLD | NEW |