| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/nonce.h" |
| 14 #include "gpu/command_buffer/service/gl_stream_texture_image.h" | 15 #include "gpu/command_buffer/service/gl_stream_texture_image.h" |
| 15 #include "gpu/ipc/service/gpu_command_buffer_stub.h" | 16 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
| 16 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
| 17 #include "ui/gl/android/surface_texture.h" | 18 #include "ui/gl/android/surface_texture.h" |
| 18 #include "ui/gl/gl_image.h" | 19 #include "ui/gl/gl_image.h" |
| 19 | 20 |
| 20 namespace ui { | 21 namespace ui { |
| 21 class ScopedMakeCurrent; | 22 class ScopedMakeCurrent; |
| 22 } | 23 } |
| 23 | 24 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 74 |
| 74 // Called when a new frame is available for the SurfaceTexture. | 75 // Called when a new frame is available for the SurfaceTexture. |
| 75 void OnFrameAvailable(); | 76 void OnFrameAvailable(); |
| 76 | 77 |
| 77 // IPC::Listener implementation: | 78 // IPC::Listener implementation: |
| 78 bool OnMessageReceived(const IPC::Message& message) override; | 79 bool OnMessageReceived(const IPC::Message& message) override; |
| 79 | 80 |
| 80 // IPC message handlers: | 81 // IPC message handlers: |
| 81 void OnStartListening(); | 82 void OnStartListening(); |
| 82 void OnEstablishPeer(int32_t primary_id, int32_t secondary_id); | 83 void OnEstablishPeer(int32_t primary_id, int32_t secondary_id); |
| 84 void OnForwardForSurfaceRequest(base::Nonce request_token); |
| 83 void OnSetSize(const gfx::Size& size) { size_ = size; } | 85 void OnSetSize(const gfx::Size& size) { size_ = size; } |
| 84 | 86 |
| 85 scoped_refptr<gl::SurfaceTexture> surface_texture_; | 87 scoped_refptr<gl::SurfaceTexture> surface_texture_; |
| 86 | 88 |
| 87 // Current transform matrix of the surface texture. | 89 // Current transform matrix of the surface texture. |
| 88 float current_matrix_[16]; | 90 float current_matrix_[16]; |
| 89 | 91 |
| 90 // Current size of the surface texture. | 92 // Current size of the surface texture. |
| 91 gfx::Size size_; | 93 gfx::Size size_; |
| 92 | 94 |
| 93 // Whether a new frame is available that we should update to. | 95 // Whether a new frame is available that we should update to. |
| 94 bool has_pending_frame_; | 96 bool has_pending_frame_; |
| 95 | 97 |
| 96 GpuCommandBufferStub* owner_stub_; | 98 GpuCommandBufferStub* owner_stub_; |
| 97 int32_t route_id_; | 99 int32_t route_id_; |
| 98 bool has_listener_; | 100 bool has_listener_; |
| 99 uint32_t texture_id_; | 101 uint32_t texture_id_; |
| 100 | 102 |
| 101 base::WeakPtrFactory<StreamTexture> weak_factory_; | 103 base::WeakPtrFactory<StreamTexture> weak_factory_; |
| 102 DISALLOW_COPY_AND_ASSIGN(StreamTexture); | 104 DISALLOW_COPY_AND_ASSIGN(StreamTexture); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace gpu | 107 } // namespace gpu |
| 106 | 108 |
| 107 #endif // GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ | 109 #endif // GPU_IPC_SERVICE_STREAM_TEXTURE_ANDROID_H_ |
| OLD | NEW |