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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 closing_(false), | 376 closing_(false), |
377 is_swapped_out_(swapped_out), | 377 is_swapped_out_(swapped_out), |
378 input_method_is_active_(false), | 378 input_method_is_active_(false), |
379 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 379 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
380 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), | 380 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
381 can_compose_inline_(true), | 381 can_compose_inline_(true), |
382 popup_type_(popup_type), | 382 popup_type_(popup_type), |
383 pending_window_rect_count_(0), | 383 pending_window_rect_count_(0), |
384 suppress_next_char_events_(false), | 384 suppress_next_char_events_(false), |
385 is_accelerated_compositing_active_(false), | 385 is_accelerated_compositing_active_(false), |
386 was_accelerated_compositing_ever_active_(false), | |
387 animation_update_pending_(false), | 386 animation_update_pending_(false), |
388 invalidation_task_posted_(false), | 387 invalidation_task_posted_(false), |
389 screen_info_(screen_info), | 388 screen_info_(screen_info), |
390 device_scale_factor_(screen_info_.deviceScaleFactor), | 389 device_scale_factor_(screen_info_.deviceScaleFactor), |
391 is_threaded_compositing_enabled_(false), | 390 is_threaded_compositing_enabled_(false), |
392 next_output_surface_id_(0), | 391 next_output_surface_id_(0), |
393 #if defined(OS_ANDROID) | 392 #if defined(OS_ANDROID) |
394 text_field_is_dirty_(false), | 393 text_field_is_dirty_(false), |
395 outstanding_ime_acks_(0), | 394 outstanding_ime_acks_(0), |
396 body_background_color_(SK_ColorWHITE), | 395 body_background_color_(SK_ColorWHITE), |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 // OnSwapBuffersComplete. So send a dummy message that will unblock the | 1261 // OnSwapBuffersComplete. So send a dummy message that will unblock the |
1263 // browser's UI thread. This is not necessary on Mac, because SwapBuffers | 1262 // browser's UI thread. This is not necessary on Mac, because SwapBuffers |
1264 // now unblocks GetBackingStore on Mac. | 1263 // now unblocks GetBackingStore on Mac. |
1265 Send(new ViewHostMsg_UpdateIsDelayed(routing_id_)); | 1264 Send(new ViewHostMsg_UpdateIsDelayed(routing_id_)); |
1266 } | 1265 } |
1267 #endif | 1266 #endif |
1268 | 1267 |
1269 is_accelerated_compositing_active_ = true; | 1268 is_accelerated_compositing_active_ = true; |
1270 Send(new ViewHostMsg_DidActivateAcceleratedCompositing( | 1269 Send(new ViewHostMsg_DidActivateAcceleratedCompositing( |
1271 routing_id_, is_accelerated_compositing_active_)); | 1270 routing_id_, is_accelerated_compositing_active_)); |
1272 | 1271 webwidget_->enterForceCompositingMode(true); |
1273 if (!was_accelerated_compositing_ever_active_) { | |
1274 was_accelerated_compositing_ever_active_ = true; | |
1275 webwidget_->enterForceCompositingMode(true); | |
1276 } | |
1277 } | 1272 } |
1278 | 1273 |
1279 void RenderWidget::didDeactivateCompositor() { | 1274 void RenderWidget::didDeactivateCompositor() { |
1280 TRACE_EVENT0("gpu", "RenderWidget::didDeactivateCompositor"); | 1275 TRACE_EVENT0("gpu", "RenderWidget::didDeactivateCompositor"); |
1281 | 1276 |
1282 is_accelerated_compositing_active_ = false; | 1277 is_accelerated_compositing_active_ = false; |
1283 Send(new ViewHostMsg_DidActivateAcceleratedCompositing( | 1278 Send(new ViewHostMsg_DidActivateAcceleratedCompositing( |
1284 routing_id_, is_accelerated_compositing_active_)); | 1279 routing_id_, is_accelerated_compositing_active_)); |
1285 } | 1280 } |
1286 | 1281 |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 | 2221 |
2227 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2222 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2228 swapped_out_frames_.AddObserver(frame); | 2223 swapped_out_frames_.AddObserver(frame); |
2229 } | 2224 } |
2230 | 2225 |
2231 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2226 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2232 swapped_out_frames_.RemoveObserver(frame); | 2227 swapped_out_frames_.RemoveObserver(frame); |
2233 } | 2228 } |
2234 | 2229 |
2235 } // namespace content | 2230 } // namespace content |
OLD | NEW |