| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ | 5 #ifndef GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ |
| 6 #define GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ | 6 #define GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Called when a new frame is available for the SurfaceTexture. | 74 // Called when a new frame is available for the SurfaceTexture. |
| 75 void OnFrameAvailable(); | 75 void OnFrameAvailable(); |
| 76 | 76 |
| 77 // IPC::Listener implementation: | 77 // IPC::Listener implementation: |
| 78 bool OnMessageReceived(const IPC::Message& message) override; | 78 bool OnMessageReceived(const IPC::Message& message) override; |
| 79 | 79 |
| 80 // IPC message handlers: | 80 // IPC message handlers: |
| 81 void OnStartListening(); | 81 void OnStartListening(); |
| 82 void OnEstablishPeer(int32_t primary_id, int32_t secondary_id); | 82 void OnEstablishPeer(int32_t primary_id, int32_t secondary_id); |
| 83 void OnRegisterStreamTexture(int32_t surface_texture_id); |
| 83 void OnSetSize(const gfx::Size& size) { size_ = size; } | 84 void OnSetSize(const gfx::Size& size) { size_ = size; } |
| 84 | 85 |
| 85 scoped_refptr<gl::SurfaceTexture> surface_texture_; | 86 scoped_refptr<gl::SurfaceTexture> surface_texture_; |
| 86 | 87 |
| 87 // Current transform matrix of the surface texture. | 88 // Current transform matrix of the surface texture. |
| 88 float current_matrix_[16]; | 89 float current_matrix_[16]; |
| 89 | 90 |
| 90 // Current size of the surface texture. | 91 // Current size of the surface texture. |
| 91 gfx::Size size_; | 92 gfx::Size size_; |
| 92 | 93 |
| 93 // Whether a new frame is available that we should update to. | 94 // Whether a new frame is available that we should update to. |
| 94 bool has_pending_frame_; | 95 bool has_pending_frame_; |
| 95 | 96 |
| 96 GpuCommandBufferStub* owner_stub_; | 97 GpuCommandBufferStub* owner_stub_; |
| 97 int32_t route_id_; | 98 int32_t route_id_; |
| 98 bool has_listener_; | 99 bool has_listener_; |
| 99 uint32_t texture_id_; | 100 uint32_t texture_id_; |
| 100 | 101 |
| 101 unsigned framebuffer_; | 102 unsigned framebuffer_; |
| 102 unsigned vertex_shader_; | 103 unsigned vertex_shader_; |
| 103 unsigned fragment_shader_; | 104 unsigned fragment_shader_; |
| 104 unsigned program_; | 105 unsigned program_; |
| 105 unsigned vertex_buffer_; | 106 unsigned vertex_buffer_; |
| 106 int u_xform_location_; | 107 int u_xform_location_; |
| 107 | 108 |
| 109 int registered_surface_texture_id; |
| 110 |
| 108 base::WeakPtrFactory<StreamTexture> weak_factory_; | 111 base::WeakPtrFactory<StreamTexture> weak_factory_; |
| 109 DISALLOW_COPY_AND_ASSIGN(StreamTexture); | 112 DISALLOW_COPY_AND_ASSIGN(StreamTexture); |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 } // namespace gpu | 115 } // namespace gpu |
| 113 | 116 |
| 114 #endif // GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ | 117 #endif // GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ |
| OLD | NEW |