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

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

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Add an --enable-deadline-scheduler commandline flag. Created 7 years, 4 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/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 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after
2928 // should display a renderer frame. 2929 // should display a renderer frame.
2929 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { 2930 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) {
2930 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; 2931 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME;
2931 } 2932 }
2932 } 2933 }
2933 2934
2934 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( 2935 void RenderWidgetHostViewAura::OnUpdateVSyncParameters(
2935 ui::Compositor* compositor, 2936 ui::Compositor* compositor,
2936 base::TimeTicks timebase, 2937 base::TimeTicks timebase,
2937 base::TimeDelta interval) { 2938 base::TimeDelta interval) {
2938 if (IsShowing() && !last_draw_ended_.is_null()) 2939 if (IsShowing()) {
2939 host_->UpdateVSyncParameters(last_draw_ended_, interval); 2940 if (compositor->layer_tree_settings().deadline_scheduling_enabled) {
brianderson 2013/08/20 02:03:01 piman: Is this an acceptable hack until we add rea
2941 // The deadline scheduler has logic to stagger the draws of the
2942 // Renderer and Browser built-in, so send it an accurate timebase.
2943 host_->UpdateVSyncParameters(timebase, interval);
2944 } else if (!last_draw_ended_.is_null()) {
2945 // For the non-deadline scheduler, we send the Renderer an offset
2946 // vsync timebase to avoid its draws racing the Browser's draws.
2947 host_->UpdateVSyncParameters(last_draw_ended_, interval);
2948 }
2949 }
2940 } 2950 }
2941 2951
2942 //////////////////////////////////////////////////////////////////////////////// 2952 ////////////////////////////////////////////////////////////////////////////////
2943 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: 2953 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation:
2944 2954
2945 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { 2955 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) {
2946 if (!host_) 2956 if (!host_)
2947 return; 2957 return;
2948 2958
2949 host_->AccessibilitySetFocus(acc_obj_id); 2959 host_->AccessibilitySetFocus(acc_obj_id);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
3242 RenderWidgetHost* widget) { 3252 RenderWidgetHost* widget) {
3243 return new RenderWidgetHostViewAura(widget); 3253 return new RenderWidgetHostViewAura(widget);
3244 } 3254 }
3245 3255
3246 // static 3256 // static
3247 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3257 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3248 GetScreenInfoForWindow(results, NULL); 3258 GetScreenInfoForWindow(results, NULL);
3249 } 3259 }
3250 3260
3251 } // namespace content 3261 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698