| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_ |
| 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_ | 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // This class can be created only on the main thread, but then becomes pinned | 64 // This class can be created only on the main thread, but then becomes pinned |
| 65 // to a fixed thread when BindToClient is called. | 65 // to a fixed thread when BindToClient is called. |
| 66 class SynchronousCompositorFrameSink | 66 class SynchronousCompositorFrameSink |
| 67 : NON_EXPORTED_BASE(public cc::CompositorFrameSink), | 67 : NON_EXPORTED_BASE(public cc::CompositorFrameSink), |
| 68 public cc::CompositorFrameSinkSupportClient { | 68 public cc::CompositorFrameSinkSupportClient { |
| 69 public: | 69 public: |
| 70 SynchronousCompositorFrameSink( | 70 SynchronousCompositorFrameSink( |
| 71 scoped_refptr<cc::ContextProvider> context_provider, | 71 scoped_refptr<cc::ContextProvider> context_provider, |
| 72 scoped_refptr<cc::ContextProvider> worker_context_provider, | 72 scoped_refptr<cc::ContextProvider> worker_context_provider, |
| 73 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 73 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 74 cc::SharedBitmapManager* shared_bitmap_manager, |
| 74 int routing_id, | 75 int routing_id, |
| 75 uint32_t compositor_frame_sink_id, | 76 uint32_t compositor_frame_sink_id, |
| 76 std::unique_ptr<cc::BeginFrameSource> begin_frame_source, | 77 std::unique_ptr<cc::BeginFrameSource> begin_frame_source, |
| 77 SynchronousCompositorRegistry* registry, | 78 SynchronousCompositorRegistry* registry, |
| 78 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue); | 79 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue); |
| 79 ~SynchronousCompositorFrameSink() override; | 80 ~SynchronousCompositorFrameSink() override; |
| 80 | 81 |
| 81 void SetSyncClient(SynchronousCompositorFrameSinkClient* compositor); | 82 void SetSyncClient(SynchronousCompositorFrameSinkClient* compositor); |
| 82 bool OnMessageReceived(const IPC::Message& message); | 83 bool OnMessageReceived(const IPC::Message& message); |
| 83 | 84 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 113 void FallbackTickFired(); | 114 void FallbackTickFired(); |
| 114 | 115 |
| 115 // IPC handlers. | 116 // IPC handlers. |
| 116 void SetMemoryPolicy(size_t bytes_limit); | 117 void SetMemoryPolicy(size_t bytes_limit); |
| 117 void OnReclaimResources(uint32_t compositor_frame_sink_id, | 118 void OnReclaimResources(uint32_t compositor_frame_sink_id, |
| 118 const cc::ReturnedResourceArray& resources); | 119 const cc::ReturnedResourceArray& resources); |
| 119 | 120 |
| 120 const int routing_id_; | 121 const int routing_id_; |
| 121 const uint32_t compositor_frame_sink_id_; | 122 const uint32_t compositor_frame_sink_id_; |
| 122 SynchronousCompositorRegistry* const registry_; // Not owned. | 123 SynchronousCompositorRegistry* const registry_; // Not owned. |
| 124 cc::SharedBitmapManager* const shared_bitmap_manager_; // Not owned. |
| 123 IPC::Sender* const sender_; // Not owned. | 125 IPC::Sender* const sender_; // Not owned. |
| 124 | 126 |
| 125 // Not owned. | 127 // Not owned. |
| 126 SynchronousCompositorFrameSinkClient* sync_client_ = nullptr; | 128 SynchronousCompositorFrameSinkClient* sync_client_ = nullptr; |
| 127 | 129 |
| 128 // Only valid (non-NULL) during a DemandDrawSw() call. | 130 // Only valid (non-NULL) during a DemandDrawSw() call. |
| 129 SkCanvas* current_sw_canvas_ = nullptr; | 131 SkCanvas* current_sw_canvas_ = nullptr; |
| 130 | 132 |
| 131 cc::ManagedMemoryPolicy memory_policy_; | 133 cc::ManagedMemoryPolicy memory_policy_; |
| 132 bool in_software_draw_ = false; | 134 bool in_software_draw_ = false; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 gfx::Rect sw_viewport_for_current_draw_; | 167 gfx::Rect sw_viewport_for_current_draw_; |
| 166 | 168 |
| 167 base::ThreadChecker thread_checker_; | 169 base::ThreadChecker thread_checker_; |
| 168 | 170 |
| 169 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorFrameSink); | 171 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorFrameSink); |
| 170 }; | 172 }; |
| 171 | 173 |
| 172 } // namespace content | 174 } // namespace content |
| 173 | 175 |
| 174 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_ | 176 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |