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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: IsEmpty + rebase Created 4 years, 1 month 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 legacy_window_destroyed_ = true; 900 legacy_window_destroyed_ = true;
901 } 901 }
902 #endif 902 #endif
903 903
904 void RenderWidgetHostViewAura::OnSwapCompositorFrame( 904 void RenderWidgetHostViewAura::OnSwapCompositorFrame(
905 uint32_t compositor_frame_sink_id, 905 uint32_t compositor_frame_sink_id,
906 cc::CompositorFrame frame) { 906 cc::CompositorFrame frame) {
907 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); 907 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame");
908 908
909 last_scroll_offset_ = frame.metadata.root_scroll_offset; 909 last_scroll_offset_ = frame.metadata.root_scroll_offset;
910 if (!frame.delegated_frame_data)
911 return;
912 910
913 cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection; 911 cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection;
914 if (IsUseZoomForDSFEnabled()) { 912 if (IsUseZoomForDSFEnabled()) {
915 float viewportToDIPScale = 1.0f / current_device_scale_factor_; 913 float viewportToDIPScale = 1.0f / current_device_scale_factor_;
916 gfx::PointF start_edge_top = selection.start.edge_top(); 914 gfx::PointF start_edge_top = selection.start.edge_top();
917 gfx::PointF start_edge_bottom = selection.start.edge_bottom(); 915 gfx::PointF start_edge_bottom = selection.start.edge_bottom();
918 gfx::PointF end_edge_top = selection.end.edge_top(); 916 gfx::PointF end_edge_top = selection.end.edge_top();
919 gfx::PointF end_edge_bottom = selection.end.edge_bottom(); 917 gfx::PointF end_edge_bottom = selection.end.edge_bottom();
920 918
921 start_edge_top.Scale(viewportToDIPScale); 919 start_edge_top.Scale(viewportToDIPScale);
922 start_edge_bottom.Scale(viewportToDIPScale); 920 start_edge_bottom.Scale(viewportToDIPScale);
923 end_edge_top.Scale(viewportToDIPScale); 921 end_edge_top.Scale(viewportToDIPScale);
924 end_edge_bottom.Scale(viewportToDIPScale); 922 end_edge_bottom.Scale(viewportToDIPScale);
925 923
926 selection.start.SetEdge(start_edge_top, start_edge_bottom); 924 selection.start.SetEdge(start_edge_top, start_edge_bottom);
927 selection.end.SetEdge(end_edge_top, end_edge_bottom); 925 selection.end.SetEdge(end_edge_top, end_edge_bottom);
928 } 926 }
929 927
930 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, 928 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id,
danakj 2016/10/27 23:06:57 This will dcheck that the frame isnt empty, which
Saman Sami 2016/10/28 16:47:36 Done.
931 std::move(frame)); 929 std::move(frame));
932 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, 930 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control,
933 selection.start, selection.end); 931 selection.start, selection.end);
934 } 932 }
935 933
936 void RenderWidgetHostViewAura::ClearCompositorFrame() { 934 void RenderWidgetHostViewAura::ClearCompositorFrame() {
937 delegated_frame_host_->ClearDelegatedFrame(); 935 delegated_frame_host_->ClearDelegatedFrame();
938 } 936 }
939 937
940 void RenderWidgetHostViewAura::DidStopFlinging() { 938 void RenderWidgetHostViewAura::DidStopFlinging() {
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 2378
2381 void RenderWidgetHostViewAura::SetPopupChild( 2379 void RenderWidgetHostViewAura::SetPopupChild(
2382 RenderWidgetHostViewAura* popup_child_host_view) { 2380 RenderWidgetHostViewAura* popup_child_host_view) {
2383 popup_child_host_view_ = popup_child_host_view; 2381 popup_child_host_view_ = popup_child_host_view;
2384 event_handler_->SetPopupChild( 2382 event_handler_->SetPopupChild(
2385 popup_child_host_view, 2383 popup_child_host_view,
2386 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2384 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2387 } 2385 }
2388 2386
2389 } // namespace content 2387 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698