Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 23796002: cc: Implement deadine scheduling disabled by default (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedReadback4
Patch Set: Enable by default on Aura Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/aura/compositor_resize_lock.h" 23 #include "content/browser/aura/compositor_resize_lock.h"
23 #include "content/browser/renderer_host/backing_store_aura.h" 24 #include "content/browser/renderer_host/backing_store_aura.h"
24 #include "content/browser/renderer_host/dip_util.h" 25 #include "content/browser/renderer_host/dip_util.h"
25 #include "content/browser/renderer_host/overscroll_controller.h" 26 #include "content/browser/renderer_host/overscroll_controller.h"
26 #include "content/browser/renderer_host/render_view_host_delegate.h" 27 #include "content/browser/renderer_host/render_view_host_delegate.h"
27 #include "content/browser/renderer_host/render_widget_host_impl.h" 28 #include "content/browser/renderer_host/render_widget_host_impl.h"
28 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h" 29 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h"
29 #include "content/browser/renderer_host/ui_events_helper.h" 30 #include "content/browser/renderer_host/ui_events_helper.h"
(...skipping 2943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 // should display a renderer frame. 2974 // should display a renderer frame.
2974 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { 2975 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) {
2975 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; 2976 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME;
2976 } 2977 }
2977 } 2978 }
2978 2979
2979 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( 2980 void RenderWidgetHostViewAura::OnUpdateVSyncParameters(
2980 ui::Compositor* compositor, 2981 ui::Compositor* compositor,
2981 base::TimeTicks timebase, 2982 base::TimeTicks timebase,
2982 base::TimeDelta interval) { 2983 base::TimeDelta interval) {
2983 if (IsShowing() && !last_draw_ended_.is_null()) 2984 if (IsShowing()) {
2984 host_->UpdateVSyncParameters(last_draw_ended_, interval); 2985 if (compositor->layer_tree_settings().deadline_scheduling_enabled) {
2986 // The deadline scheduler has logic to stagger the draws of the
2987 // Renderer and Browser built-in, so send it an accurate timebase.
2988 host_->UpdateVSyncParameters(timebase, interval);
2989 } else if (!last_draw_ended_.is_null()) {
2990 // For the non-deadline scheduler, we send the Renderer an offset
2991 // vsync timebase to avoid its draws racing the Browser's draws.
2992 host_->UpdateVSyncParameters(last_draw_ended_, interval);
2993 }
2994 }
2985 } 2995 }
2986 2996
2987 //////////////////////////////////////////////////////////////////////////////// 2997 ////////////////////////////////////////////////////////////////////////////////
2988 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: 2998 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation:
2989 2999
2990 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { 3000 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) {
2991 if (!host_) 3001 if (!host_)
2992 return; 3002 return;
2993 3003
2994 host_->AccessibilitySetFocus(acc_obj_id); 3004 host_->AccessibilitySetFocus(acc_obj_id);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
3287 RenderWidgetHost* widget) { 3297 RenderWidgetHost* widget) {
3288 return new RenderWidgetHostViewAura(widget); 3298 return new RenderWidgetHostViewAura(widget);
3289 } 3299 }
3290 3300
3291 // static 3301 // static
3292 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3302 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3293 GetScreenInfoForWindow(results, NULL); 3303 GetScreenInfoForWindow(results, NULL);
3294 } 3304 }
3295 3305
3296 } // namespace content 3306 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698