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

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: Fix context lost race conditions 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/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 2925 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 // should display a renderer frame. 2956 // should display a renderer frame.
2956 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { 2957 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) {
2957 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; 2958 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME;
2958 } 2959 }
2959 } 2960 }
2960 2961
2961 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( 2962 void RenderWidgetHostViewAura::OnUpdateVSyncParameters(
2962 ui::Compositor* compositor, 2963 ui::Compositor* compositor,
2963 base::TimeTicks timebase, 2964 base::TimeTicks timebase,
2964 base::TimeDelta interval) { 2965 base::TimeDelta interval) {
2965 if (IsShowing() && !last_draw_ended_.is_null()) 2966 if (IsShowing()) {
2966 host_->UpdateVSyncParameters(last_draw_ended_, interval); 2967 if (compositor->layer_tree_settings().deadline_scheduling_enabled) {
2968 // The deadline scheduler has logic to stagger the draws of the
2969 // Renderer and Browser built-in, so send it an accurate timebase.
2970 host_->UpdateVSyncParameters(timebase, interval);
2971 } else if (!last_draw_ended_.is_null()) {
2972 // For the non-deadline scheduler, we send the Renderer an offset
2973 // vsync timebase to avoid its draws racing the Browser's draws.
2974 host_->UpdateVSyncParameters(last_draw_ended_, interval);
2975 }
2976 }
2967 } 2977 }
2968 2978
2969 //////////////////////////////////////////////////////////////////////////////// 2979 ////////////////////////////////////////////////////////////////////////////////
2970 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: 2980 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation:
2971 2981
2972 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { 2982 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) {
2973 if (!host_) 2983 if (!host_)
2974 return; 2984 return;
2975 2985
2976 host_->AccessibilitySetFocus(acc_obj_id); 2986 host_->AccessibilitySetFocus(acc_obj_id);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 RenderWidgetHost* widget) { 3279 RenderWidgetHost* widget) {
3270 return new RenderWidgetHostViewAura(widget); 3280 return new RenderWidgetHostViewAura(widget);
3271 } 3281 }
3272 3282
3273 // static 3283 // static
3274 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3284 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3275 GetScreenInfoForWindow(results, NULL); 3285 GetScreenInfoForWindow(results, NULL);
3276 } 3286 }
3277 3287
3278 } // namespace content 3288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698