| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "cc/output/compositor_frame.h" | 14 #include "cc/output/compositor_frame.h" |
| 15 #include "cc/output/compositor_frame_ack.h" | 15 #include "cc/output/compositor_frame_ack.h" |
| 16 #include "cc/output/copy_output_request.h" | 16 #include "cc/output/copy_output_request.h" |
| 17 #include "cc/output/copy_output_result.h" | 17 #include "cc/output/copy_output_result.h" |
| 18 #include "cc/resources/texture_mailbox.h" | 18 #include "cc/resources/texture_mailbox.h" |
| 19 #include "cc/trees/layer_tree_settings.h" |
| 19 #include "content/browser/accessibility/browser_accessibility_manager.h" | 20 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 20 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 21 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 21 #include "content/browser/renderer_host/backing_store_aura.h" | 22 #include "content/browser/renderer_host/backing_store_aura.h" |
| 22 #include "content/browser/renderer_host/dip_util.h" | 23 #include "content/browser/renderer_host/dip_util.h" |
| 23 #include "content/browser/renderer_host/overscroll_controller.h" | 24 #include "content/browser/renderer_host/overscroll_controller.h" |
| 24 #include "content/browser/renderer_host/render_view_host_delegate.h" | 25 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 25 #include "content/browser/renderer_host/render_widget_host_impl.h" | 26 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 26 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h" | 27 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h" |
| 27 #include "content/browser/renderer_host/ui_events_helper.h" | 28 #include "content/browser/renderer_host/ui_events_helper.h" |
| 28 #include "content/browser/renderer_host/web_input_event_aura.h" | 29 #include "content/browser/renderer_host/web_input_event_aura.h" |
| (...skipping 2915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2944 // should display a renderer frame. | 2945 // should display a renderer frame. |
| 2945 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { | 2946 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { |
| 2946 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; | 2947 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; |
| 2947 } | 2948 } |
| 2948 } | 2949 } |
| 2949 | 2950 |
| 2950 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( | 2951 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( |
| 2951 ui::Compositor* compositor, | 2952 ui::Compositor* compositor, |
| 2952 base::TimeTicks timebase, | 2953 base::TimeTicks timebase, |
| 2953 base::TimeDelta interval) { | 2954 base::TimeDelta interval) { |
| 2954 if (IsShowing() && !last_draw_ended_.is_null()) | 2955 if (IsShowing()) { |
| 2955 host_->UpdateVSyncParameters(last_draw_ended_, interval); | 2956 if (compositor->layer_tree_settings().deadline_scheduling_enabled) { |
| 2957 // The deadline scheduler has logic to stagger the draws of the |
| 2958 // Renderer and Browser built-in, so send it an accurate timebase. |
| 2959 host_->UpdateVSyncParameters(timebase, interval); |
| 2960 } else if (!last_draw_ended_.is_null()) { |
| 2961 // For the non-deadline scheduler, we send the Renderer an offset |
| 2962 // vsync timebase to avoid its draws racing the Browser's draws. |
| 2963 host_->UpdateVSyncParameters(last_draw_ended_, interval); |
| 2964 } |
| 2965 } |
| 2956 } | 2966 } |
| 2957 | 2967 |
| 2958 //////////////////////////////////////////////////////////////////////////////// | 2968 //////////////////////////////////////////////////////////////////////////////// |
| 2959 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: | 2969 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: |
| 2960 | 2970 |
| 2961 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { | 2971 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { |
| 2962 if (!host_) | 2972 if (!host_) |
| 2963 return; | 2973 return; |
| 2964 | 2974 |
| 2965 host_->AccessibilitySetFocus(acc_obj_id); | 2975 host_->AccessibilitySetFocus(acc_obj_id); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 RenderWidgetHost* widget) { | 3268 RenderWidgetHost* widget) { |
| 3259 return new RenderWidgetHostViewAura(widget); | 3269 return new RenderWidgetHostViewAura(widget); |
| 3260 } | 3270 } |
| 3261 | 3271 |
| 3262 // static | 3272 // static |
| 3263 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3273 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3264 GetScreenInfoForWindow(results, NULL); | 3274 GetScreenInfoForWindow(results, NULL); |
| 3265 } | 3275 } |
| 3266 | 3276 |
| 3267 } // namespace content | 3277 } // namespace content |
| OLD | NEW |