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

Side by Side Diff: content/renderer/render_widget.cc

Issue 2337913003: Fork cc::OutputSurface into cc::CompositorFrameSink. (Closed)
Patch Set: cfsfork: android-vulkan Created 4 years, 3 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/feature_list.h" 13 #include "base/feature_list.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
17 #include "base/memory/singleton.h" 17 #include "base/memory/singleton.h"
18 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
19 #include "base/metrics/histogram_macros.h" 19 #include "base/metrics/histogram_macros.h"
20 #include "base/stl_util.h" 20 #include "base/stl_util.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/sys_info.h" 22 #include "base/sys_info.h"
23 #include "base/trace_event/trace_event.h" 23 #include "base/trace_event/trace_event.h"
24 #include "base/trace_event/trace_event_synthetic_delay.h" 24 #include "base/trace_event/trace_event_synthetic_delay.h"
25 #include "build/build_config.h" 25 #include "build/build_config.h"
26 #include "cc/output/compositor_frame_sink.h"
26 #include "cc/output/copy_output_request.h" 27 #include "cc/output/copy_output_request.h"
27 #include "cc/output/output_surface.h"
28 #include "cc/scheduler/begin_frame_source.h" 28 #include "cc/scheduler/begin_frame_source.h"
29 #include "content/common/content_switches_internal.h" 29 #include "content/common/content_switches_internal.h"
30 #include "content/common/input/synthetic_gesture_packet.h" 30 #include "content/common/input/synthetic_gesture_packet.h"
31 #include "content/common/input_messages.h" 31 #include "content/common/input_messages.h"
32 #include "content/common/swapped_out_messages.h" 32 #include "content/common/swapped_out_messages.h"
33 #include "content/common/text_input_state.h" 33 #include "content/common/text_input_state.h"
34 #include "content/common/view_messages.h" 34 #include "content/common/view_messages.h"
35 #include "content/public/common/content_features.h" 35 #include "content/public/common/content_features.h"
36 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
37 #include "content/public/common/context_menu_params.h" 37 #include "content/public/common/context_menu_params.h"
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 740 RenderThreadImpl* render_thread = RenderThreadImpl::current();
741 // render_thread may be NULL in tests. 741 // render_thread may be NULL in tests.
742 InputHandlerManager* input_handler_manager = 742 InputHandlerManager* input_handler_manager =
743 render_thread ? render_thread->input_handler_manager() : NULL; 743 render_thread ? render_thread->input_handler_manager() : NULL;
744 if (input_handler_manager) 744 if (input_handler_manager)
745 input_handler_manager->ProcessRafAlignedInputOnMainThread(routing_id_); 745 input_handler_manager->ProcessRafAlignedInputOnMainThread(routing_id_);
746 746
747 GetWebWidget()->beginFrame(frame_time_sec); 747 GetWebWidget()->beginFrame(frame_time_sec);
748 } 748 }
749 749
750 std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface( 750 std::unique_ptr<cc::CompositorFrameSink>
751 bool fallback) { 751 RenderWidget::CreateCompositorFrameSink(bool fallback) {
752 DCHECK(GetWebWidget()); 752 DCHECK(GetWebWidget());
753 // For widgets that are never visible, we don't start the compositor, so we 753 // For widgets that are never visible, we don't start the compositor, so we
754 // never get a request for a cc::OutputSurface. 754 // never get a request for a cc::CompositorFrameSink.
755 DCHECK(!compositor_never_visible_); 755 DCHECK(!compositor_never_visible_);
756 return RenderThreadImpl::current()->CreateCompositorOutputSurface( 756 return RenderThreadImpl::current()->CreateCompositorFrameSink(
757 fallback, routing_id_, frame_swap_message_queue_, 757 fallback, routing_id_, frame_swap_message_queue_,
758 GetURLForGraphicsContext3D()); 758 GetURLForGraphicsContext3D());
759 } 759 }
760 760
761 void RenderWidget::DidCommitAndDrawCompositorFrame() { 761 void RenderWidget::DidCommitAndDrawCompositorFrame() {
762 // NOTE: Tests may break if this event is renamed or moved. See 762 // NOTE: Tests may break if this event is renamed or moved. See
763 // tab_capture_performancetest.cc. 763 // tab_capture_performancetest.cc.
764 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); 764 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame");
765 765
766 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, 766 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_,
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 1135
1136 void RenderWidget::initializeLayerTreeView() { 1136 void RenderWidget::initializeLayerTreeView() {
1137 DCHECK(!host_closing_); 1137 DCHECK(!host_closing_);
1138 1138
1139 compositor_ = RenderWidgetCompositor::Create(this, device_scale_factor_, 1139 compositor_ = RenderWidgetCompositor::Create(this, device_scale_factor_,
1140 compositor_deps_); 1140 compositor_deps_);
1141 compositor_->setViewportSize(physical_backing_size_); 1141 compositor_->setViewportSize(physical_backing_size_);
1142 OnDeviceScaleFactorChanged(); 1142 OnDeviceScaleFactorChanged();
1143 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); 1143 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace());
1144 // For background pages and certain tests, we don't want to trigger 1144 // For background pages and certain tests, we don't want to trigger
1145 // OutputSurface creation. 1145 // CompositorFrameSink creation.
1146 if (compositor_never_visible_ || !RenderThreadImpl::current()) 1146 if (compositor_never_visible_ || !RenderThreadImpl::current())
1147 compositor_->SetNeverVisible(); 1147 compositor_->SetNeverVisible();
1148 1148
1149 StartCompositor(); 1149 StartCompositor();
1150 } 1150 }
1151 1151
1152 void RenderWidget::WillCloseLayerTreeView() { 1152 void RenderWidget::WillCloseLayerTreeView() {
1153 if (host_closing_) 1153 if (host_closing_)
1154 return; 1154 return;
1155 1155
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 bool RenderWidget::isPointerLocked() { 2151 bool RenderWidget::isPointerLocked() {
2152 return mouse_lock_dispatcher_->IsMouseLockedTo( 2152 return mouse_lock_dispatcher_->IsMouseLockedTo(
2153 webwidget_mouse_lock_target_.get()); 2153 webwidget_mouse_lock_target_.get());
2154 } 2154 }
2155 2155
2156 blink::WebWidget* RenderWidget::GetWebWidget() const { 2156 blink::WebWidget* RenderWidget::GetWebWidget() const {
2157 return webwidget_internal_; 2157 return webwidget_internal_;
2158 } 2158 }
2159 2159
2160 } // namespace content 2160 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698