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_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 float top_controls_delta) override; | 150 float top_controls_delta) override; |
151 void RequestNewOutputSurface() override; | 151 void RequestNewOutputSurface() override; |
152 void DidInitializeOutputSurface() override; | 152 void DidInitializeOutputSurface() override; |
153 void DidFailToInitializeOutputSurface() override; | 153 void DidFailToInitializeOutputSurface() override; |
154 void WillCommit() override; | 154 void WillCommit() override; |
155 void DidCommit() override; | 155 void DidCommit() override; |
156 void DidCommitAndDrawFrame() override; | 156 void DidCommitAndDrawFrame() override; |
157 void DidCompleteSwapBuffers() override; | 157 void DidCompleteSwapBuffers() override; |
158 void DidCompletePageScaleAnimation() override; | 158 void DidCompletePageScaleAnimation() override; |
159 void RateLimitSharedMainThreadContext() override; | 159 void RateLimitSharedMainThreadContext() override; |
| 160 void RecordFrameTimingEvents( |
| 161 scoped_ptr<cc::FrameTimingTracker::CompositeTimingSet> composite_events, |
| 162 scoped_ptr<cc::FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
| 163 override; |
160 | 164 |
161 // cc::LayerTreeHostSingleThreadClient implementation. | 165 // cc::LayerTreeHostSingleThreadClient implementation. |
162 void ScheduleAnimation() override; | 166 void ScheduleAnimation() override; |
163 void DidPostSwapBuffers() override; | 167 void DidPostSwapBuffers() override; |
164 void DidAbortSwapBuffers() override; | 168 void DidAbortSwapBuffers() override; |
165 | 169 |
166 enum { | 170 enum { |
167 OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK = 4, | 171 OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK = 4, |
168 MAX_OUTPUT_SURFACE_RETRIES = 5, | 172 MAX_OUTPUT_SURFACE_RETRIES = 5, |
169 }; | 173 }; |
170 | 174 |
171 protected: | 175 protected: |
172 RenderWidgetCompositor(RenderWidget* widget, | 176 RenderWidgetCompositor(RenderWidget* widget, |
173 CompositorDependencies* compositor_deps); | 177 CompositorDependencies* compositor_deps); |
174 | 178 |
175 void Initialize(); | 179 void Initialize(); |
176 cc::LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 180 cc::LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
177 | 181 |
178 private: | 182 private: |
179 void ScheduleCommit(); | 183 void ScheduleCommit(); |
180 bool CommitIsSynchronous() const; | 184 bool CommitIsSynchronous() const; |
181 void SynchronousCommit(); | 185 void SynchronousCommit(); |
182 | 186 |
183 int num_failed_recreate_attempts_; | 187 int num_failed_recreate_attempts_; |
184 RenderWidget* widget_; | 188 RenderWidget* widget_; |
185 CompositorDependencies* compositor_deps_; | 189 CompositorDependencies* compositor_deps_; |
186 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 190 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
187 | 191 |
188 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; | 192 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; |
189 scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; | 193 scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; |
190 | 194 |
191 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; | 195 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; |
192 }; | 196 }; |
193 | 197 |
194 } // namespace content | 198 } // namespace content |
195 | 199 |
196 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 200 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
OLD | NEW |