| 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_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 if (args.source_id == latest_confirmed_begin_frame_source_id_) | 2079 if (args.source_id == latest_confirmed_begin_frame_source_id_) |
| 2080 confirmed = latest_confirmed_begin_frame_sequence_number_; | 2080 confirmed = latest_confirmed_begin_frame_sequence_number_; |
| 2081 OnBeginFrameDidNotSwap(cc::BeginFrameAck( | 2081 OnBeginFrameDidNotSwap(cc::BeginFrameAck( |
| 2082 args.source_id, args.sequence_number, confirmed, false)); | 2082 args.source_id, args.sequence_number, confirmed, false)); |
| 2083 return; | 2083 return; |
| 2084 } | 2084 } |
| 2085 | 2085 |
| 2086 // Update |last_begin_frame_args_| before handling | 2086 // Update |last_begin_frame_args_| before handling |
| 2087 // |outstanding_begin_frame_requests_| to prevent the BeginFrameSource from | 2087 // |outstanding_begin_frame_requests_| to prevent the BeginFrameSource from |
| 2088 // sending the same MISSED args in infinite recursion. This may otherwise | 2088 // sending the same MISSED args in infinite recursion. This may otherwise |
| 2089 // happen if |host_->FlushInput()| causes a synchronous OnSetNeedsFlushInput() | 2089 // happen if |host_->OnBeginFrame()| causes a synchronous |
| 2090 // which can lead to |begin_frame_source_->AddObserver()| and OnBeginFrame(). | 2090 // OnSetNeedsFlushInput() which can lead to |
| 2091 // By setting |last_begin_frame_args_|, we indicate to the source not to send | 2091 // |begin_frame_source_->AddObserver()| and OnBeginFrame(). By setting |
| 2092 // the same args during |AddObserver()| again. | 2092 // |last_begin_frame_args_|, we indicate to the source not to send the same |
| 2093 // args during |AddObserver()| again. |
| 2093 last_begin_frame_args_ = args; | 2094 last_begin_frame_args_ = args; |
| 2094 | 2095 |
| 2095 if (outstanding_begin_frame_requests_ & FLUSH_INPUT) { | 2096 if (outstanding_begin_frame_requests_ & FLUSH_INPUT) { |
| 2096 ClearBeginFrameRequest(FLUSH_INPUT); | 2097 ClearBeginFrameRequest(FLUSH_INPUT); |
| 2097 host_->FlushInput(); | 2098 host_->OnBeginFrame(); |
| 2098 } | 2099 } |
| 2099 | 2100 |
| 2100 if ((outstanding_begin_frame_requests_ & BEGIN_FRAME) || | 2101 if ((outstanding_begin_frame_requests_ & BEGIN_FRAME) || |
| 2101 (outstanding_begin_frame_requests_ & PERSISTENT_BEGIN_FRAME)) { | 2102 (outstanding_begin_frame_requests_ & PERSISTENT_BEGIN_FRAME)) { |
| 2102 ClearBeginFrameRequest(BEGIN_FRAME); | 2103 ClearBeginFrameRequest(BEGIN_FRAME); |
| 2103 SendBeginFrame(args); | 2104 SendBeginFrame(args); |
| 2104 } else { | 2105 } else { |
| 2105 OnBeginFrameDidNotSwap(cc::BeginFrameAck( | 2106 OnBeginFrameDidNotSwap(cc::BeginFrameAck( |
| 2106 args.source_id, args.sequence_number, args.sequence_number, false)); | 2107 args.source_id, args.sequence_number, args.sequence_number, false)); |
| 2107 } | 2108 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2223 | 2224 |
| 2224 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2225 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 2225 if (!compositor) | 2226 if (!compositor) |
| 2226 return; | 2227 return; |
| 2227 | 2228 |
| 2228 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2229 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2229 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2230 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
| 2230 } | 2231 } |
| 2231 | 2232 |
| 2232 } // namespace content | 2233 } // namespace content |
| OLD | NEW |