| 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 CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ | 5 #ifndef CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ |
| 6 #define CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ | 6 #define CONTENT_COMMON_GPU_STREAM_TEXTURE_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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const gfx::RectF& crop_rect) override; | 55 const gfx::RectF& crop_rect) override; |
| 56 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 56 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 57 uint64_t process_tracing_id, | 57 uint64_t process_tracing_id, |
| 58 const std::string& dump_name) override; | 58 const std::string& dump_name) override; |
| 59 | 59 |
| 60 // GpuCommandBufferStub::DestructionObserver implementation. | 60 // GpuCommandBufferStub::DestructionObserver implementation. |
| 61 void OnWillDestroyStub() override; | 61 void OnWillDestroyStub() override; |
| 62 | 62 |
| 63 scoped_ptr<ui::ScopedMakeCurrent> MakeStubCurrent(); | 63 scoped_ptr<ui::ScopedMakeCurrent> MakeStubCurrent(); |
| 64 | 64 |
| 65 void UpdateTexImage(); | |
| 66 | |
| 67 // Called when a new frame is available for the SurfaceTexture. | 65 // Called when a new frame is available for the SurfaceTexture. |
| 68 void OnFrameAvailable(); | 66 void OnFrameAvailable(); |
| 69 | 67 |
| 70 // IPC::Listener implementation: | 68 // IPC::Listener implementation: |
| 71 bool OnMessageReceived(const IPC::Message& message) override; | 69 bool OnMessageReceived(const IPC::Message& message) override; |
| 72 | 70 |
| 73 // IPC message handlers: | 71 // IPC message handlers: |
| 74 void OnStartListening(); | 72 void OnStartListening(); |
| 75 void OnEstablishPeer(int32_t primary_id, int32_t secondary_id); | 73 void OnEstablishPeer(int32_t primary_id, int32_t secondary_id); |
| 76 void OnSetSize(const gfx::Size& size) { size_ = size; } | 74 void OnSetSize(const gfx::Size& size) { size_ = size; } |
| 77 | 75 |
| 78 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 76 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
| 79 | 77 |
| 80 // Current transform matrix of the surface texture. | 78 // Current transform matrix of the surface texture. |
| 81 float current_matrix_[16]; | 79 float current_matrix_[16]; |
| 82 | 80 |
| 83 // Current size of the surface texture. | 81 // Current size of the surface texture. |
| 84 gfx::Size size_; | 82 gfx::Size size_; |
| 85 | 83 |
| 86 // Whether we ever bound a valid frame. | |
| 87 bool has_valid_frame_; | |
| 88 | |
| 89 // Whether a new frame is available that we should update to. | |
| 90 bool has_pending_frame_; | |
| 91 | |
| 92 GpuCommandBufferStub* owner_stub_; | 84 GpuCommandBufferStub* owner_stub_; |
| 93 int32_t route_id_; | 85 int32_t route_id_; |
| 94 bool has_listener_; | 86 bool has_listener_; |
| 95 uint32_t texture_id_; | 87 uint32_t texture_id_; |
| 96 | 88 |
| 97 unsigned framebuffer_; | 89 unsigned framebuffer_; |
| 98 unsigned vertex_shader_; | 90 unsigned vertex_shader_; |
| 99 unsigned fragment_shader_; | 91 unsigned fragment_shader_; |
| 100 unsigned program_; | 92 unsigned program_; |
| 101 unsigned vertex_buffer_; | 93 unsigned vertex_buffer_; |
| 102 int u_xform_location_; | 94 int u_xform_location_; |
| 103 | 95 |
| 104 base::WeakPtrFactory<StreamTexture> weak_factory_; | 96 base::WeakPtrFactory<StreamTexture> weak_factory_; |
| 105 DISALLOW_COPY_AND_ASSIGN(StreamTexture); | 97 DISALLOW_COPY_AND_ASSIGN(StreamTexture); |
| 106 }; | 98 }; |
| 107 | 99 |
| 108 } // namespace content | 100 } // namespace content |
| 109 | 101 |
| 110 #endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ | 102 #endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_ANDROID_H_ |
| OLD | NEW |