OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/debug/trace_event_synthetic_delay.h" | 10 #include "base/debug/trace_event_synthetic_delay.h" |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 } | 1199 } |
1200 | 1200 |
1201 void RenderWidget::didBecomeReadyForAdditionalInput() { | 1201 void RenderWidget::didBecomeReadyForAdditionalInput() { |
1202 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); | 1202 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); |
1203 FlushPendingInputEventAck(); | 1203 FlushPendingInputEventAck(); |
1204 } | 1204 } |
1205 | 1205 |
1206 void RenderWidget::DidCommitCompositorFrame() { | 1206 void RenderWidget::DidCommitCompositorFrame() { |
1207 FOR_EACH_OBSERVER(RenderFrameImpl, swapped_out_frames_, | 1207 FOR_EACH_OBSERVER(RenderFrameImpl, swapped_out_frames_, |
1208 DidCommitCompositorFrame()); | 1208 DidCommitCompositorFrame()); |
| 1209 #if defined(VIDEO_HOLE) |
| 1210 // Not using FOR_EACH_OBSERVER because |swapped_out_frames_| and |
| 1211 // |video_hole_frames_| may have common frames. |
| 1212 if (!video_hole_frames_.might_have_observers()) |
| 1213 return; |
| 1214 ObserverListBase<RenderFrameImpl>::Iterator iter(video_hole_frames_); |
| 1215 RenderFrameImpl* frame; |
| 1216 while ((frame = iter.GetNext()) != NULL) { |
| 1217 // Prevent duplicate notification of DidCommitCompositorFrame(). |
| 1218 if (!swapped_out_frames_.HasObserver(frame)) |
| 1219 frame->DidCommitCompositorFrame(); |
| 1220 } |
| 1221 #endif // defined(VIDEO_HOLE) |
1209 } | 1222 } |
1210 | 1223 |
1211 void RenderWidget::didCommitAndDrawCompositorFrame() { | 1224 void RenderWidget::didCommitAndDrawCompositorFrame() { |
1212 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); | 1225 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); |
1213 // Accelerated FPS tick for performance tests. See | 1226 // Accelerated FPS tick for performance tests. See |
1214 // tab_capture_performancetest.cc. NOTE: Tests may break if this event is | 1227 // tab_capture_performancetest.cc. NOTE: Tests may break if this event is |
1215 // renamed or moved. | 1228 // renamed or moved. |
1216 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickGPU", | 1229 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickGPU", |
1217 TRACE_EVENT_SCOPE_THREAD); | 1230 TRACE_EVENT_SCOPE_THREAD); |
1218 // Notify subclasses that we initiated the paint operation. | 1231 // Notify subclasses that we initiated the paint operation. |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 } | 2086 } |
2074 | 2087 |
2075 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2088 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2076 swapped_out_frames_.AddObserver(frame); | 2089 swapped_out_frames_.AddObserver(frame); |
2077 } | 2090 } |
2078 | 2091 |
2079 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2092 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2080 swapped_out_frames_.RemoveObserver(frame); | 2093 swapped_out_frames_.RemoveObserver(frame); |
2081 } | 2094 } |
2082 | 2095 |
| 2096 #if defined(VIDEO_HOLE) |
| 2097 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2098 video_hole_frames_.AddObserver(frame); |
| 2099 } |
| 2100 |
| 2101 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2102 video_hole_frames_.RemoveObserver(frame); |
| 2103 } |
| 2104 #endif // defined(VIDEO_HOLE) |
| 2105 |
2083 } // namespace content | 2106 } // namespace content |
OLD | NEW |