Chromium Code Reviews| 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 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(); |
|
piman
2017/03/28 23:07:46
delegated_frame_host_ may be null.
Saman Sami
2017/03/28 23:36:30
Done.
| |
| 879 } | |
| 880 | |
| 881 void RenderWidgetHostViewAura::SubmitCompositorFrame( | |
| 879 const cc::LocalSurfaceId& local_surface_id, | 882 const cc::LocalSurfaceId& local_surface_id, |
| 880 cc::CompositorFrame frame) { | 883 cc::CompositorFrame frame) { |
| 881 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); | 884 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); |
| 882 | 885 |
| 883 // Override the background color to the current compositor background. | 886 // Override the background color to the current compositor background. |
| 884 // This allows us to, when navigating to a new page, transfer this color to | 887 // 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 | 888 // that page. This allows us to pass this background color to new views on |
| 886 // navigation. | 889 // navigation. |
| 887 SetBackgroundColor(frame.metadata.root_background_color); | 890 SetBackgroundColor(frame.metadata.root_background_color); |
| 888 | 891 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 899 start_edge_top.Scale(viewportToDIPScale); | 902 start_edge_top.Scale(viewportToDIPScale); |
| 900 start_edge_bottom.Scale(viewportToDIPScale); | 903 start_edge_bottom.Scale(viewportToDIPScale); |
| 901 end_edge_top.Scale(viewportToDIPScale); | 904 end_edge_top.Scale(viewportToDIPScale); |
| 902 end_edge_bottom.Scale(viewportToDIPScale); | 905 end_edge_bottom.Scale(viewportToDIPScale); |
| 903 | 906 |
| 904 selection.start.SetEdge(start_edge_top, start_edge_bottom); | 907 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
| 905 selection.end.SetEdge(end_edge_top, end_edge_bottom); | 908 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
| 906 } | 909 } |
| 907 | 910 |
| 908 if (delegated_frame_host_) { | 911 if (delegated_frame_host_) { |
| 909 delegated_frame_host_->SwapDelegatedFrame( | 912 delegated_frame_host_->SubmitCompositorFrame(local_surface_id, |
| 910 compositor_frame_sink_id, local_surface_id, std::move(frame)); | 913 std::move(frame)); |
| 911 } | 914 } |
| 912 selection_controller_->OnSelectionBoundsChanged(selection.start, | 915 selection_controller_->OnSelectionBoundsChanged(selection.start, |
| 913 selection.end); | 916 selection.end); |
| 914 } | 917 } |
| 915 | 918 |
| 916 void RenderWidgetHostViewAura::OnBeginFrameDidNotSwap( | 919 void RenderWidgetHostViewAura::OnBeginFrameDidNotSwap( |
| 917 const cc::BeginFrameAck& ack) { | 920 const cc::BeginFrameAck& ack) { |
| 918 delegated_frame_host_->BeginFrameDidNotSwap(ack); | 921 delegated_frame_host_->BeginFrameDidNotSwap(ack); |
| 919 } | 922 } |
| 920 | 923 |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2342 } | 2345 } |
| 2343 | 2346 |
| 2344 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { | 2347 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { |
| 2345 if (!delegated_frame_host_) | 2348 if (!delegated_frame_host_) |
| 2346 return; | 2349 return; |
| 2347 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || | 2350 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || |
| 2348 needs_flush_input_); | 2351 needs_flush_input_); |
| 2349 } | 2352 } |
| 2350 | 2353 |
| 2351 } // namespace content | 2354 } // namespace content |
| OLD | NEW |