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

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: Use web_contents_ 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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 weak_ptr_factory_.GetWeakPtr(), 1130 weak_ptr_factory_.GetWeakPtr(),
1131 last_frame_info_->output_surface_id); 1131 last_frame_info_->output_surface_id);
1132 1132
1133 ack_callbacks_.push(ack_callback); 1133 ack_callbacks_.push(ack_callback);
1134 } 1134 }
1135 1135
1136 last_frame_info_.reset( 1136 last_frame_info_.reset(
1137 new LastFrameInfo(output_surface_id, std::move(frame))); 1137 new LastFrameInfo(output_surface_id, std::move(frame)));
1138 } 1138 }
1139 1139
1140 SynchronousCompositorHost*
1141 RenderWidgetHostViewAndroid::GetSynchronousCompositor() {
1142 return sync_compositor_.get();
1143 }
1144
1145 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( 1140 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata(
1146 const cc::CompositorFrameMetadata& frame_metadata) { 1141 const cc::CompositorFrameMetadata& frame_metadata) {
1147 if (!content_view_core_) 1142 if (!content_view_core_)
1148 return; 1143 return;
1149 1144
1150 // This is a subset of OnSwapCompositorFrame() used in the synchronous 1145 // This is a subset of OnSwapCompositorFrame() used in the synchronous
1151 // compositor flow. 1146 // compositor flow.
1152 OnFrameMetadataUpdated(frame_metadata); 1147 OnFrameMetadataUpdated(frame_metadata);
1153 1148
1154 // DevTools ScreenCast support for Android WebView. 1149 // DevTools ScreenCast support for Android WebView.
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 1770
1776 if (!overscroll_controller_ && 1771 if (!overscroll_controller_ &&
1777 content_view_core_->GetWindowAndroid()->GetCompositor()) { 1772 content_view_core_->GetWindowAndroid()->GetCompositor()) {
1778 overscroll_controller_ = CreateOverscrollController(content_view_core_); 1773 overscroll_controller_ = CreateOverscrollController(content_view_core_);
1779 } 1774 }
1780 1775
1781 if (!sync_compositor_) { 1776 if (!sync_compositor_) {
1782 sync_compositor_ = SynchronousCompositorHost::Create( 1777 sync_compositor_ = SynchronousCompositorHost::Create(
1783 this, content_view_core_->GetWebContents()); 1778 this, content_view_core_->GetWebContents());
1784 } 1779 }
1785 if (sync_compositor_)
1786 sync_compositor_->DidBecomeCurrent();
1787 } 1780 }
1788 1781
1789 void RenderWidgetHostViewAndroid::RunAckCallbacks( 1782 void RenderWidgetHostViewAndroid::RunAckCallbacks(
1790 cc::SurfaceDrawStatus status) { 1783 cc::SurfaceDrawStatus status) {
1791 while (!ack_callbacks_.empty()) { 1784 while (!ack_callbacks_.empty()) {
1792 ack_callbacks_.front().Run(); 1785 ack_callbacks_.front().Run();
1793 ack_callbacks_.pop(); 1786 ack_callbacks_.pop();
1794 } 1787 }
1795 } 1788 }
1796 1789
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 case ui::MotionEvent::ACTION_UP: 2028 case ui::MotionEvent::ACTION_UP:
2036 case ui::MotionEvent::ACTION_POINTER_UP: 2029 case ui::MotionEvent::ACTION_POINTER_UP:
2037 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 2030 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
2038 delta.InMicroseconds(), 1, 1000000, 50); 2031 delta.InMicroseconds(), 1, 1000000, 50);
2039 default: 2032 default:
2040 return; 2033 return;
2041 } 2034 }
2042 } 2035 }
2043 2036
2044 } // namespace content 2037 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698