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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 // round-trips to the browser's UI thread before finishing the frame, | 1269 // round-trips to the browser's UI thread before finishing the frame, |
1270 // causing deadlocks if we delay the UpdateRect until we receive the | 1270 // causing deadlocks if we delay the UpdateRect until we receive the |
1271 // OnSwapBuffersComplete. So send a dummy message that will unblock the | 1271 // OnSwapBuffersComplete. So send a dummy message that will unblock the |
1272 // browser's UI thread. This is not necessary on Mac, because SwapBuffers | 1272 // browser's UI thread. This is not necessary on Mac, because SwapBuffers |
1273 // now unblocks GetBackingStore on Mac. | 1273 // now unblocks GetBackingStore on Mac. |
1274 Send(new ViewHostMsg_UpdateIsDelayed(routing_id_)); | 1274 Send(new ViewHostMsg_UpdateIsDelayed(routing_id_)); |
1275 } | 1275 } |
1276 #endif | 1276 #endif |
1277 | 1277 |
1278 is_accelerated_compositing_active_ = true; | 1278 is_accelerated_compositing_active_ = true; |
1279 Send(new ViewHostMsg_DidActivateAcceleratedCompositing( | |
1280 routing_id_, is_accelerated_compositing_active_)); | |
1281 webwidget_->enterForceCompositingMode(true); | 1279 webwidget_->enterForceCompositingMode(true); |
1282 } | 1280 } |
1283 | 1281 |
1284 void RenderWidget::didDeactivateCompositor() { | 1282 void RenderWidget::didDeactivateCompositor() { |
1285 TRACE_EVENT0("gpu", "RenderWidget::didDeactivateCompositor"); | 1283 TRACE_EVENT0("gpu", "RenderWidget::didDeactivateCompositor"); |
1286 | 1284 |
1287 is_accelerated_compositing_active_ = false; | 1285 is_accelerated_compositing_active_ = false; |
1288 Send(new ViewHostMsg_DidActivateAcceleratedCompositing( | |
1289 routing_id_, is_accelerated_compositing_active_)); | |
1290 } | 1286 } |
1291 | 1287 |
1292 void RenderWidget::initializeLayerTreeView() { | 1288 void RenderWidget::initializeLayerTreeView() { |
1293 compositor_ = RenderWidgetCompositor::Create( | 1289 compositor_ = RenderWidgetCompositor::Create( |
1294 this, is_threaded_compositing_enabled_); | 1290 this, is_threaded_compositing_enabled_); |
1295 compositor_->setViewportSize(size_, physical_backing_size_); | 1291 compositor_->setViewportSize(size_, physical_backing_size_); |
1296 if (init_complete_) | 1292 if (init_complete_) |
1297 StartCompositor(); | 1293 StartCompositor(); |
1298 } | 1294 } |
1299 | 1295 |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 | 2230 |
2235 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2231 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2236 swapped_out_frames_.AddObserver(frame); | 2232 swapped_out_frames_.AddObserver(frame); |
2237 } | 2233 } |
2238 | 2234 |
2239 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2235 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2240 swapped_out_frames_.RemoveObserver(frame); | 2236 swapped_out_frames_.RemoveObserver(frame); |
2241 } | 2237 } |
2242 | 2238 |
2243 } // namespace content | 2239 } // namespace content |
OLD | NEW |