| 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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "cc/output/compositor_frame.h" | 15 #include "cc/output/compositor_frame.h" |
| 16 #include "cc/output/compositor_frame_ack.h" | 16 #include "cc/output/compositor_frame_ack.h" |
| 17 #include "cc/output/copy_output_request.h" | 17 #include "cc/output/copy_output_request.h" |
| 18 #include "cc/output/copy_output_result.h" | 18 #include "cc/output/copy_output_result.h" |
| 19 #include "cc/resources/texture_mailbox.h" | 19 #include "cc/resources/texture_mailbox.h" |
| 20 #include "cc/trees/layer_tree_settings.h" |
| 20 #include "content/browser/accessibility/browser_accessibility_manager.h" | 21 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 21 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 22 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 22 #include "content/browser/renderer_host/backing_store_aura.h" | 23 #include "content/browser/renderer_host/backing_store_aura.h" |
| 23 #include "content/browser/renderer_host/dip_util.h" | 24 #include "content/browser/renderer_host/dip_util.h" |
| 24 #include "content/browser/renderer_host/overscroll_controller.h" | 25 #include "content/browser/renderer_host/overscroll_controller.h" |
| 25 #include "content/browser/renderer_host/render_view_host_delegate.h" | 26 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 26 #include "content/browser/renderer_host/render_widget_host_impl.h" | 27 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 27 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h" | 28 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h" |
| 28 #include "content/browser/renderer_host/ui_events_helper.h" | 29 #include "content/browser/renderer_host/ui_events_helper.h" |
| 29 #include "content/browser/renderer_host/web_input_event_aura.h" | 30 #include "content/browser/renderer_host/web_input_event_aura.h" |
| (...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2988 // should display a renderer frame. | 2989 // should display a renderer frame. |
| 2989 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { | 2990 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { |
| 2990 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; | 2991 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; |
| 2991 } | 2992 } |
| 2992 } | 2993 } |
| 2993 | 2994 |
| 2994 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( | 2995 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( |
| 2995 ui::Compositor* compositor, | 2996 ui::Compositor* compositor, |
| 2996 base::TimeTicks timebase, | 2997 base::TimeTicks timebase, |
| 2997 base::TimeDelta interval) { | 2998 base::TimeDelta interval) { |
| 2998 if (IsShowing() && !last_draw_ended_.is_null()) | 2999 if (IsShowing()) { |
| 2999 host_->UpdateVSyncParameters(last_draw_ended_, interval); | 3000 if (compositor->layer_tree_settings().deadline_scheduling_enabled) { |
| 3001 // The deadline scheduler has logic to stagger the draws of the |
| 3002 // Renderer and Browser built-in, so send it an accurate timebase. |
| 3003 host_->UpdateVSyncParameters(timebase, interval); |
| 3004 } else if (!last_draw_ended_.is_null()) { |
| 3005 // For the non-deadline scheduler, we send the Renderer an offset |
| 3006 // vsync timebase to avoid its draws racing the Browser's draws. |
| 3007 host_->UpdateVSyncParameters(last_draw_ended_, interval); |
| 3008 } |
| 3009 } |
| 3000 } | 3010 } |
| 3001 | 3011 |
| 3002 //////////////////////////////////////////////////////////////////////////////// | 3012 //////////////////////////////////////////////////////////////////////////////// |
| 3003 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: | 3013 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: |
| 3004 | 3014 |
| 3005 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { | 3015 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { |
| 3006 if (!host_) | 3016 if (!host_) |
| 3007 return; | 3017 return; |
| 3008 | 3018 |
| 3009 host_->AccessibilitySetFocus(acc_obj_id); | 3019 host_->AccessibilitySetFocus(acc_obj_id); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3302 RenderWidgetHost* widget) { | 3312 RenderWidgetHost* widget) { |
| 3303 return new RenderWidgetHostViewAura(widget); | 3313 return new RenderWidgetHostViewAura(widget); |
| 3304 } | 3314 } |
| 3305 | 3315 |
| 3306 // static | 3316 // static |
| 3307 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3317 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3308 GetScreenInfoForWindow(results, NULL); | 3318 GetScreenInfoForWindow(results, NULL); |
| 3309 } | 3319 } |
| 3310 | 3320 |
| 3311 } // namespace content | 3321 } // namespace content |
| OLD | NEW |