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_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/cancelable_callback.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
17 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
18 #include "cc/output/compositor_frame.h" | 19 #include "cc/output/compositor_frame.h" |
19 #include "cc/output/managed_memory_policy.h" | 20 #include "cc/output/managed_memory_policy.h" |
20 #include "cc/output/output_surface.h" | 21 #include "cc/output/output_surface.h" |
21 #include "ipc/ipc_message.h" | 22 #include "ipc/ipc_message.h" |
22 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 private: | 97 private: |
97 class SoftwareDevice; | 98 class SoftwareDevice; |
98 friend class SoftwareDevice; | 99 friend class SoftwareDevice; |
99 | 100 |
100 void InvokeComposite(const gfx::Transform& transform, | 101 void InvokeComposite(const gfx::Transform& transform, |
101 const gfx::Rect& viewport, | 102 const gfx::Rect& viewport, |
102 const gfx::Rect& clip, | 103 const gfx::Rect& clip, |
103 bool hardware_draw); | 104 bool hardware_draw); |
104 bool CalledOnValidThread() const; | 105 bool CalledOnValidThread() const; |
105 | 106 |
| 107 void CancelFallbackTick(); |
| 108 void FallbackTickFired(); |
| 109 |
106 const int routing_id_; | 110 const int routing_id_; |
107 SynchronousCompositorRegistry* const registry_; // unowned | 111 SynchronousCompositorRegistry* const registry_; // unowned |
108 bool registered_; | 112 bool registered_; |
109 | 113 |
110 // Not owned. | 114 // Not owned. |
111 SynchronousCompositorOutputSurfaceClient* sync_client_; | 115 SynchronousCompositorOutputSurfaceClient* sync_client_; |
112 | 116 |
113 // Only valid (non-NULL) during a DemandDrawSw() call. | 117 // Only valid (non-NULL) during a DemandDrawSw() call. |
114 SkCanvas* current_sw_canvas_; | 118 SkCanvas* current_sw_canvas_; |
115 | 119 |
116 cc::ManagedMemoryPolicy memory_policy_; | 120 cc::ManagedMemoryPolicy memory_policy_; |
117 bool did_swap_; | 121 bool did_swap_; |
118 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; | 122 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
119 | 123 |
| 124 base::CancelableClosure fallback_tick_; |
| 125 bool fallback_tick_pending_; |
| 126 bool fallback_tick_running_; |
| 127 |
120 base::ThreadChecker thread_checker_; | 128 base::ThreadChecker thread_checker_; |
121 | 129 |
122 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); | 130 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); |
123 }; | 131 }; |
124 | 132 |
125 } // namespace content | 133 } // namespace content |
126 | 134 |
127 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ | 135 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |