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