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_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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 .ToRECT(); | 867 .ToRECT(); |
868 ::ClipCursor(&window_rect); | 868 ::ClipCursor(&window_rect); |
869 } | 869 } |
870 | 870 |
871 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { | 871 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { |
872 legacy_render_widget_host_HWND_ = NULL; | 872 legacy_render_widget_host_HWND_ = NULL; |
873 legacy_window_destroyed_ = true; | 873 legacy_window_destroyed_ = true; |
874 } | 874 } |
875 #endif | 875 #endif |
876 | 876 |
877 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 877 void RenderWidgetHostViewAura::DidCreateNewRendererCompositorFrameSink() { |
878 uint32_t compositor_frame_sink_id, | 878 if (delegated_frame_host_) |
| 879 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(); |
| 880 } |
| 881 |
| 882 void RenderWidgetHostViewAura::SubmitCompositorFrame( |
879 const cc::LocalSurfaceId& local_surface_id, | 883 const cc::LocalSurfaceId& local_surface_id, |
880 cc::CompositorFrame frame) { | 884 cc::CompositorFrame frame) { |
881 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); | 885 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); |
882 | 886 |
883 // Override the background color to the current compositor background. | 887 // Override the background color to the current compositor background. |
884 // This allows us to, when navigating to a new page, transfer this color to | 888 // This allows us to, when navigating to a new page, transfer this color to |
885 // that page. This allows us to pass this background color to new views on | 889 // that page. This allows us to pass this background color to new views on |
886 // navigation. | 890 // navigation. |
887 SetBackgroundColor(frame.metadata.root_background_color); | 891 SetBackgroundColor(frame.metadata.root_background_color); |
888 | 892 |
(...skipping 10 matching lines...) Expand all Loading... |
899 start_edge_top.Scale(viewportToDIPScale); | 903 start_edge_top.Scale(viewportToDIPScale); |
900 start_edge_bottom.Scale(viewportToDIPScale); | 904 start_edge_bottom.Scale(viewportToDIPScale); |
901 end_edge_top.Scale(viewportToDIPScale); | 905 end_edge_top.Scale(viewportToDIPScale); |
902 end_edge_bottom.Scale(viewportToDIPScale); | 906 end_edge_bottom.Scale(viewportToDIPScale); |
903 | 907 |
904 selection.start.SetEdge(start_edge_top, start_edge_bottom); | 908 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
905 selection.end.SetEdge(end_edge_top, end_edge_bottom); | 909 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
906 } | 910 } |
907 | 911 |
908 if (delegated_frame_host_) { | 912 if (delegated_frame_host_) { |
909 delegated_frame_host_->SwapDelegatedFrame( | 913 delegated_frame_host_->SubmitCompositorFrame(local_surface_id, |
910 compositor_frame_sink_id, local_surface_id, std::move(frame)); | 914 std::move(frame)); |
911 } | 915 } |
912 selection_controller_->OnSelectionBoundsChanged(selection.start, | 916 selection_controller_->OnSelectionBoundsChanged(selection.start, |
913 selection.end); | 917 selection.end); |
914 } | 918 } |
915 | 919 |
916 void RenderWidgetHostViewAura::OnBeginFrameDidNotSwap( | 920 void RenderWidgetHostViewAura::OnBeginFrameDidNotSwap( |
917 const cc::BeginFrameAck& ack) { | 921 const cc::BeginFrameAck& ack) { |
918 delegated_frame_host_->BeginFrameDidNotSwap(ack); | 922 delegated_frame_host_->BeginFrameDidNotSwap(ack); |
919 } | 923 } |
920 | 924 |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 } | 2346 } |
2343 | 2347 |
2344 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { | 2348 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { |
2345 if (!delegated_frame_host_) | 2349 if (!delegated_frame_host_) |
2346 return; | 2350 return; |
2347 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || | 2351 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || |
2348 needs_flush_input_); | 2352 needs_flush_input_); |
2349 } | 2353 } |
2350 | 2354 |
2351 } // namespace content | 2355 } // namespace content |
OLD | NEW |