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

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

Issue 2774373002: Use MojoCompositorFrameSink in RendererCompositorFrameSink (Closed)
Patch Set: Rebased, dedup IPC 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 cc::FrameSinkId frame_sink_id = 1935 cc::FrameSinkId frame_sink_id =
1932 host_->AllocateFrameSinkId(is_guest_view_hack_); 1936 host_->AllocateFrameSinkId(is_guest_view_hack_);
1933 1937
1934 // Tests may set |delegated_frame_host_client_|. 1938 // Tests may set |delegated_frame_host_client_|.
1935 if (!delegated_frame_host_client_) { 1939 if (!delegated_frame_host_client_) {
1936 delegated_frame_host_client_ = 1940 delegated_frame_host_client_ =
1937 base::MakeUnique<DelegatedFrameHostClientAura>(this); 1941 base::MakeUnique<DelegatedFrameHostClientAura>(this);
1938 } 1942 }
1939 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>( 1943 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>(
1940 frame_sink_id, delegated_frame_host_client_.get()); 1944 frame_sink_id, delegated_frame_host_client_.get());
1945 if (renderer_compositor_frame_sink_) {
1946 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(
1947 renderer_compositor_frame_sink_);
1948 }
1941 UpdateNeedsBeginFramesInternal(); 1949 UpdateNeedsBeginFramesInternal();
1942 1950
1943 // Let the page-level input event router know about our surface ID 1951 // Let the page-level input event router know about our surface ID
1944 // namespace for surface-based hit testing. 1952 // namespace for surface-based hit testing.
1945 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { 1953 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
1946 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner( 1954 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(
1947 GetFrameSinkId(), this); 1955 GetFrameSinkId(), this);
1948 } 1956 }
1949 } 1957 }
1950 1958
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2369 } 2377 }
2370 2378
2371 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { 2379 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() {
2372 if (!delegated_frame_host_) 2380 if (!delegated_frame_host_)
2373 return; 2381 return;
2374 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || 2382 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ ||
2375 needs_flush_input_); 2383 needs_flush_input_);
2376 } 2384 }
2377 2385
2378 } // namespace content 2386 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698