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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 legacy_render_widget_host_HWND_ = NULL; | 1054 legacy_render_widget_host_HWND_ = NULL; |
1055 legacy_window_destroyed_ = true; | 1055 legacy_window_destroyed_ = true; |
1056 } | 1056 } |
1057 #endif | 1057 #endif |
1058 | 1058 |
1059 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 1059 void RenderWidgetHostViewAura::OnSwapCompositorFrame( |
1060 uint32_t output_surface_id, | 1060 uint32_t output_surface_id, |
1061 std::unique_ptr<cc::CompositorFrame> frame) { | 1061 std::unique_ptr<cc::CompositorFrame> frame) { |
1062 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); | 1062 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); |
1063 | 1063 |
| 1064 // Override the background color to the current compositor background. |
| 1065 // This allows us to, when navigating to a new page, transfer this color |
| 1066 // (via code in ContentsWebView) between the current RenderWidgetHost and |
| 1067 // the new one, avoiding a flash of the theme color in between. |
| 1068 // See crbug.com/470669. |
| 1069 // Setting the page's background color here should also have better quality |
| 1070 // output in cases when the window's root layer peeks out from the content |
| 1071 // layers. |
| 1072 SetBackgroundColor(frame->metadata.root_background_color); |
| 1073 |
1064 last_scroll_offset_ = frame->metadata.root_scroll_offset; | 1074 last_scroll_offset_ = frame->metadata.root_scroll_offset; |
1065 if (!frame->delegated_frame_data) | 1075 if (!frame->delegated_frame_data) |
1066 return; | 1076 return; |
1067 | 1077 |
1068 cc::ViewportSelection selection = frame->metadata.selection; | 1078 cc::ViewportSelection selection = frame->metadata.selection; |
1069 if (IsUseZoomForDSFEnabled()) { | 1079 if (IsUseZoomForDSFEnabled()) { |
1070 float viewportToDIPScale = 1.0f / current_device_scale_factor_; | 1080 float viewportToDIPScale = 1.0f / current_device_scale_factor_; |
1071 selection.start.edge_top.Scale(viewportToDIPScale); | 1081 selection.start.edge_top.Scale(viewportToDIPScale); |
1072 selection.start.edge_bottom.Scale(viewportToDIPScale); | 1082 selection.start.edge_bottom.Scale(viewportToDIPScale); |
1073 selection.end.edge_top.Scale(viewportToDIPScale); | 1083 selection.end.edge_top.Scale(viewportToDIPScale); |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2955 | 2965 |
2956 //////////////////////////////////////////////////////////////////////////////// | 2966 //////////////////////////////////////////////////////////////////////////////// |
2957 // RenderWidgetHostViewBase, public: | 2967 // RenderWidgetHostViewBase, public: |
2958 | 2968 |
2959 // static | 2969 // static |
2960 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2970 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2961 GetScreenInfoForWindow(results, NULL); | 2971 GetScreenInfoForWindow(results, NULL); |
2962 } | 2972 } |
2963 | 2973 |
2964 } // namespace content | 2974 } // namespace content |
OLD | NEW |