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

Side by Side Diff: ui/android/window_android.cc

Issue 2778223005: Plumb activation time to main (Closed)
Patch Set: update another BeginMainFrame::Create reference Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/android/window_android.h" 5 #include "ui/android/window_android.h"
6 6
7 #include "base/android/context_utils.h" 7 #include "base/android/context_utils.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (observer_count_ <= 0) 95 if (observer_count_ <= 0)
96 window_->SetNeedsBeginFrames(false); 96 window_->SetNeedsBeginFrames(false);
97 } 97 }
98 98
99 void WindowAndroid::WindowBeginFrameSource::OnVSync( 99 void WindowAndroid::WindowBeginFrameSource::OnVSync(
100 base::TimeTicks frame_time, 100 base::TimeTicks frame_time,
101 base::TimeDelta vsync_period) { 101 base::TimeDelta vsync_period) {
102 // frame time is in the past, so give the next vsync period as the deadline. 102 // frame time is in the past, so give the next vsync period as the deadline.
103 base::TimeTicks deadline = frame_time + vsync_period; 103 base::TimeTicks deadline = frame_time + vsync_period;
104 last_begin_frame_args_ = cc::BeginFrameArgs::Create( 104 last_begin_frame_args_ = cc::BeginFrameArgs::Create(
105 BEGINFRAME_FROM_HERE, source_id(), next_sequence_number_, frame_time, 105 BEGINFRAME_FROM_HERE, source_id(), next_sequence_number_, 0, frame_time,
Ted C 2017/04/18 23:11:06 should this be kDefaultSourceFrameNumber instead o
panicker 2017/04/19 17:22:09 Done.
106 deadline, vsync_period, cc::BeginFrameArgs::NORMAL); 106 deadline, vsync_period, cc::BeginFrameArgs::NORMAL);
107 DCHECK(last_begin_frame_args_.IsValid()); 107 DCHECK(last_begin_frame_args_.IsValid());
108 next_sequence_number_++; 108 next_sequence_number_++;
109 109
110 for (auto& obs : observers_) 110 for (auto& obs : observers_)
111 obs.OnBeginFrame(last_begin_frame_args_); 111 obs.OnBeginFrame(last_begin_frame_args_);
112 } 112 }
113 113
114 void WindowAndroid::WindowBeginFrameSource::OnPauseChanged(bool paused) { 114 void WindowAndroid::WindowBeginFrameSource::OnPauseChanged(bool paused) {
115 paused_ = paused; 115 paused_ = paused;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // ---------------------------------------------------------------------------- 281 // ----------------------------------------------------------------------------
282 // Native JNI methods 282 // Native JNI methods
283 // ---------------------------------------------------------------------------- 283 // ----------------------------------------------------------------------------
284 284
285 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj, int sdk_display_id) { 285 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj, int sdk_display_id) {
286 WindowAndroid* window = new WindowAndroid(env, obj, sdk_display_id); 286 WindowAndroid* window = new WindowAndroid(env, obj, sdk_display_id);
287 return reinterpret_cast<intptr_t>(window); 287 return reinterpret_cast<intptr_t>(window);
288 } 288 }
289 289
290 } // namespace ui 290 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698