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

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

Issue 2835673002: Disable raf alignment when the compositor doesn't generate begin frames. (Closed)
Patch Set: Created 3 years, 8 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/input/main_thread_event_queue_unittest.cc ('k') | no next file » | 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"
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 compositor_->SetRasterColorSpace(screen_info_.icc_profile.GetColorSpace()); 1305 compositor_->SetRasterColorSpace(screen_info_.icc_profile.GetColorSpace());
1306 compositor_->SetContentSourceId(current_content_source_id_); 1306 compositor_->SetContentSourceId(current_content_source_id_);
1307 #if defined(USE_AURA) 1307 #if defined(USE_AURA)
1308 RendererWindowTreeClient* window_tree_client = 1308 RendererWindowTreeClient* window_tree_client =
1309 RendererWindowTreeClient::Get(routing_id_); 1309 RendererWindowTreeClient::Get(routing_id_);
1310 if (window_tree_client) 1310 if (window_tree_client)
1311 compositor_->SetLocalSurfaceId(window_tree_client->local_surface_id()); 1311 compositor_->SetLocalSurfaceId(window_tree_client->local_surface_id());
1312 #endif 1312 #endif
1313 // For background pages and certain tests, we don't want to trigger 1313 // For background pages and certain tests, we don't want to trigger
1314 // CompositorFrameSink creation. 1314 // CompositorFrameSink creation.
1315 if (compositor_never_visible_ || !RenderThreadImpl::current()) 1315 bool should_geneate_frame_sink =
aelias_OOO_until_Jul13 2017/04/21 21:45:28 typo: "generate"
dtapuska 2017/04/24 13:44:01 ugh. Done.
1316 !compositor_never_visible_ && RenderThreadImpl::current();
1317 if (!should_geneate_frame_sink)
1316 compositor_->SetNeverVisible(); 1318 compositor_->SetNeverVisible();
1317 1319
1318 StartCompositor(); 1320 StartCompositor();
1319 DCHECK_NE(MSG_ROUTING_NONE, routing_id_); 1321 DCHECK_NE(MSG_ROUTING_NONE, routing_id_);
1320 compositor_->SetFrameSinkId( 1322 compositor_->SetFrameSinkId(
1321 cc::FrameSinkId(RenderThread::Get()->GetClientId(), routing_id_)); 1323 cc::FrameSinkId(RenderThread::Get()->GetClientId(), routing_id_));
1322 1324
1323 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 1325 RenderThreadImpl* render_thread = RenderThreadImpl::current();
1324 // render_thread may be NULL in tests. 1326 // render_thread may be NULL in tests.
1325 InputHandlerManager* input_handler_manager = 1327 InputHandlerManager* input_handler_manager =
1326 render_thread ? render_thread->input_handler_manager() : NULL; 1328 render_thread ? render_thread->input_handler_manager() : NULL;
1327 if (input_handler_manager) { 1329 if (input_handler_manager) {
1328 input_event_queue_ = new MainThreadEventQueue( 1330 input_event_queue_ = new MainThreadEventQueue(
1329 this, render_thread->GetRendererScheduler()->CompositorTaskRunner(), 1331 this, render_thread->GetRendererScheduler()->CompositorTaskRunner(),
1330 render_thread->GetRendererScheduler()); 1332 render_thread->GetRendererScheduler(), should_geneate_frame_sink);
1331 input_handler_manager->AddInputHandler( 1333 input_handler_manager->AddInputHandler(
1332 routing_id_, compositor()->GetInputHandler(), input_event_queue_, 1334 routing_id_, compositor()->GetInputHandler(), input_event_queue_,
1333 weak_ptr_factory_.GetWeakPtr(), 1335 weak_ptr_factory_.GetWeakPtr(),
1334 compositor_deps_->IsScrollAnimatorEnabled()); 1336 compositor_deps_->IsScrollAnimatorEnabled());
1335 has_added_input_handler_ = true; 1337 has_added_input_handler_ = true;
1336 } 1338 }
1337 1339
1338 return compositor_.get(); 1340 return compositor_.get();
1339 } 1341 }
1340 1342
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
2330 // browser side (https://crbug.com/669219). 2332 // browser side (https://crbug.com/669219).
2331 // If there is no WebFrameWidget, then there will be no 2333 // If there is no WebFrameWidget, then there will be no
2332 // InputMethodControllers for a WebLocalFrame. 2334 // InputMethodControllers for a WebLocalFrame.
2333 return nullptr; 2335 return nullptr;
2334 } 2336 }
2335 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2337 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2336 ->GetActiveWebInputMethodController(); 2338 ->GetActiveWebInputMethodController();
2337 } 2339 }
2338 2340
2339 } // namespace content 2341 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/main_thread_event_queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698