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