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

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

Issue 2036023002: Rewire Android WebView's compositor changed signal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 weak_ptr_factory_.GetWeakPtr(), 1133 weak_ptr_factory_.GetWeakPtr(),
1134 last_frame_info_->output_surface_id); 1134 last_frame_info_->output_surface_id);
1135 1135
1136 ack_callbacks_.push(ack_callback); 1136 ack_callbacks_.push(ack_callback);
1137 } 1137 }
1138 1138
1139 last_frame_info_.reset( 1139 last_frame_info_.reset(
1140 new LastFrameInfo(output_surface_id, std::move(frame))); 1140 new LastFrameInfo(output_surface_id, std::move(frame)));
1141 } 1141 }
1142 1142
1143 SynchronousCompositorHost*
1144 RenderWidgetHostViewAndroid::GetSynchronousCompositor() {
1145 return sync_compositor_.get();
1146 }
1147
1148 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( 1143 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata(
1149 const cc::CompositorFrameMetadata& frame_metadata) { 1144 const cc::CompositorFrameMetadata& frame_metadata) {
1150 if (!content_view_core_) 1145 if (!content_view_core_)
1151 return; 1146 return;
1152 1147
1153 // This is a subset of OnSwapCompositorFrame() used in the synchronous 1148 // This is a subset of OnSwapCompositorFrame() used in the synchronous
1154 // compositor flow. 1149 // compositor flow.
1155 OnFrameMetadataUpdated(frame_metadata); 1150 OnFrameMetadataUpdated(frame_metadata);
1156 1151
1157 // DevTools ScreenCast support for Android WebView. 1152 // DevTools ScreenCast support for Android WebView.
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 1782
1788 if (!overscroll_controller_ && 1783 if (!overscroll_controller_ &&
1789 content_view_core_->GetWindowAndroid()->GetCompositor()) { 1784 content_view_core_->GetWindowAndroid()->GetCompositor()) {
1790 overscroll_controller_ = CreateOverscrollController(content_view_core_); 1785 overscroll_controller_ = CreateOverscrollController(content_view_core_);
1791 } 1786 }
1792 1787
1793 if (!sync_compositor_) { 1788 if (!sync_compositor_) {
1794 sync_compositor_ = SynchronousCompositorHost::Create( 1789 sync_compositor_ = SynchronousCompositorHost::Create(
1795 this, content_view_core_->GetWebContents()); 1790 this, content_view_core_->GetWebContents());
1796 } 1791 }
1797 if (sync_compositor_)
1798 sync_compositor_->DidBecomeCurrent();
1799 } 1792 }
1800 1793
1801 void RenderWidgetHostViewAndroid::RunAckCallbacks( 1794 void RenderWidgetHostViewAndroid::RunAckCallbacks(
1802 cc::SurfaceDrawStatus status) { 1795 cc::SurfaceDrawStatus status) {
1803 while (!ack_callbacks_.empty()) { 1796 while (!ack_callbacks_.empty()) {
1804 ack_callbacks_.front().Run(); 1797 ack_callbacks_.front().Run();
1805 ack_callbacks_.pop(); 1798 ack_callbacks_.pop();
1806 } 1799 }
1807 } 1800 }
1808 1801
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 case ui::MotionEvent::ACTION_UP: 2039 case ui::MotionEvent::ACTION_UP:
2047 case ui::MotionEvent::ACTION_POINTER_UP: 2040 case ui::MotionEvent::ACTION_POINTER_UP:
2048 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 2041 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
2049 delta.InMicroseconds(), 1, 1000000, 50); 2042 delta.InMicroseconds(), 1, 1000000, 50);
2050 default: 2043 default:
2051 return; 2044 return;
2052 } 2045 }
2053 } 2046 }
2054 2047
2055 } // namespace content 2048 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698