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

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

Issue 2774373002: Use MojoCompositorFrameSink in RendererCompositorFrameSink (Closed)
Patch Set: addressed comments 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
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 <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 .ToRECT(); 883 .ToRECT();
884 ::ClipCursor(&window_rect); 884 ::ClipCursor(&window_rect);
885 } 885 }
886 886
887 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { 887 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() {
888 legacy_render_widget_host_HWND_ = NULL; 888 legacy_render_widget_host_HWND_ = NULL;
889 legacy_window_destroyed_ = true; 889 legacy_window_destroyed_ = true;
890 } 890 }
891 #endif 891 #endif
892 892
893 void RenderWidgetHostViewAura::DidCreateNewRendererCompositorFrameSink() { 893 void RenderWidgetHostViewAura::DidCreateNewRendererCompositorFrameSink(
894 if (delegated_frame_host_) 894 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink) {
895 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(); 895 renderer_compositor_frame_sink_ = renderer_compositor_frame_sink;
896 if (delegated_frame_host_) {
897 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(
898 renderer_compositor_frame_sink_);
899 }
896 } 900 }
897 901
898 void RenderWidgetHostViewAura::SubmitCompositorFrame( 902 void RenderWidgetHostViewAura::SubmitCompositorFrame(
899 const cc::LocalSurfaceId& local_surface_id, 903 const cc::LocalSurfaceId& local_surface_id,
900 cc::CompositorFrame frame) { 904 cc::CompositorFrame frame) {
901 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); 905 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame");
902 906
903 // Override the background color to the current compositor background. 907 // Override the background color to the current compositor background.
904 // This allows us to, when navigating to a new page, transfer this color to 908 // This allows us to, when navigating to a new page, transfer this color to
905 // that page. This allows us to pass this background color to new views on 909 // that page. This allows us to pass this background color to new views on
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 cc::FrameSinkId frame_sink_id = 1928 cc::FrameSinkId frame_sink_id =
1925 host_->AllocateFrameSinkId(is_guest_view_hack_); 1929 host_->AllocateFrameSinkId(is_guest_view_hack_);
1926 1930
1927 // Tests may set |delegated_frame_host_client_|. 1931 // Tests may set |delegated_frame_host_client_|.
1928 if (!delegated_frame_host_client_) { 1932 if (!delegated_frame_host_client_) {
1929 delegated_frame_host_client_ = 1933 delegated_frame_host_client_ =
1930 base::MakeUnique<DelegatedFrameHostClientAura>(this); 1934 base::MakeUnique<DelegatedFrameHostClientAura>(this);
1931 } 1935 }
1932 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>( 1936 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>(
1933 frame_sink_id, delegated_frame_host_client_.get()); 1937 frame_sink_id, delegated_frame_host_client_.get());
1938 if (renderer_compositor_frame_sink_) {
1939 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(
1940 renderer_compositor_frame_sink_);
1941 }
1934 UpdateNeedsBeginFramesInternal(); 1942 UpdateNeedsBeginFramesInternal();
1935 1943
1936 // Let the page-level input event router know about our surface ID 1944 // Let the page-level input event router know about our surface ID
1937 // namespace for surface-based hit testing. 1945 // namespace for surface-based hit testing.
1938 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { 1946 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
1939 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner( 1947 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(
1940 GetFrameSinkId(), this); 1948 GetFrameSinkId(), this);
1941 } 1949 }
1942 } 1950 }
1943 1951
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 } 2370 }
2363 2371
2364 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { 2372 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() {
2365 if (!delegated_frame_host_) 2373 if (!delegated_frame_host_)
2366 return; 2374 return;
2367 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || 2375 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ ||
2368 needs_flush_input_); 2376 needs_flush_input_);
2369 } 2377 }
2370 2378
2371 } // namespace content 2379 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698