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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback + add more testing Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #if defined(OS_ANDROID) 10 #if defined(OS_ANDROID)
11 #include "base/android/sys_utils.h" 11 #include "base/android/sys_utils.h"
12 #endif 12 #endif
13 13
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "base/synchronization/lock.h" 17 #include "base/synchronization/lock.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "cc/base/latency_info_swap_promise.h" 20 #include "cc/base/latency_info_swap_promise.h"
21 #include "cc/base/latency_info_swap_promise_monitor.h" 21 #include "cc/base/latency_info_swap_promise_monitor.h"
22 #include "cc/base/swap_promise.h"
22 #include "cc/base/switches.h" 23 #include "cc/base/switches.h"
23 #include "cc/debug/layer_tree_debug_state.h" 24 #include "cc/debug/layer_tree_debug_state.h"
24 #include "cc/debug/micro_benchmark.h" 25 #include "cc/debug/micro_benchmark.h"
25 #include "cc/layers/layer.h" 26 #include "cc/layers/layer.h"
26 #include "cc/output/copy_output_request.h" 27 #include "cc/output/copy_output_request.h"
27 #include "cc/output/copy_output_result.h" 28 #include "cc/output/copy_output_result.h"
28 #include "cc/resources/single_release_callback.h" 29 #include "cc/resources/single_release_callback.h"
29 #include "cc/trees/layer_tree_host.h" 30 #include "cc/trees/layer_tree_host.h"
30 #include "content/child/child_shared_bitmap_manager.h" 31 #include "content/child/child_shared_bitmap_manager.h"
31 #include "content/common/content_switches_internal.h" 32 #include "content/common/content_switches_internal.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 399
399 void RenderWidgetCompositor::QueueSwapPromise( 400 void RenderWidgetCompositor::QueueSwapPromise(
400 scoped_ptr<cc::SwapPromise> swap_promise) { 401 scoped_ptr<cc::SwapPromise> swap_promise) {
401 layer_tree_host_->QueueSwapPromise(swap_promise.Pass()); 402 layer_tree_host_->QueueSwapPromise(swap_promise.Pass());
402 } 403 }
403 404
404 int RenderWidgetCompositor::GetLayerTreeId() const { 405 int RenderWidgetCompositor::GetLayerTreeId() const {
405 return layer_tree_host_->id(); 406 return layer_tree_host_->id();
406 } 407 }
407 408
409 int RenderWidgetCompositor::GetSourceFrameNumber() const {
410 return layer_tree_host_->source_frame_number();
411 }
412
408 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { 413 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() {
409 layer_tree_host_->NotifyInputThrottledUntilCommit(); 414 layer_tree_host_->NotifyInputThrottledUntilCommit();
410 } 415 }
411 416
412 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { 417 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const {
413 return layer_tree_host_->root_layer(); 418 return layer_tree_host_->root_layer();
414 } 419 }
415 420
416 int RenderWidgetCompositor::ScheduleMicroBenchmark( 421 int RenderWidgetCompositor::ScheduleMicroBenchmark(
417 const std::string& name, 422 const std::string& name,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 534
530 void RenderWidgetCompositor::heuristicsForGpuRasterizationUpdated( 535 void RenderWidgetCompositor::heuristicsForGpuRasterizationUpdated(
531 bool matches_heuristics) { 536 bool matches_heuristics) {
532 layer_tree_host_->SetHasGpuRasterizationTrigger(matches_heuristics); 537 layer_tree_host_->SetHasGpuRasterizationTrigger(matches_heuristics);
533 } 538 }
534 539
535 void RenderWidgetCompositor::setNeedsAnimate() { 540 void RenderWidgetCompositor::setNeedsAnimate() {
536 layer_tree_host_->SetNeedsAnimate(); 541 layer_tree_host_->SetNeedsAnimate();
537 } 542 }
538 543
544 void RenderWidgetCompositor::setNeedsCommit() {
545 layer_tree_host_->SetNeedsCommit();
546 }
547
539 bool RenderWidgetCompositor::commitRequested() const { 548 bool RenderWidgetCompositor::commitRequested() const {
540 return layer_tree_host_->CommitRequested(); 549 return layer_tree_host_->CommitRequested();
541 } 550 }
542 551
543 void RenderWidgetCompositor::didStopFlinging() { 552 void RenderWidgetCompositor::didStopFlinging() {
544 layer_tree_host_->DidStopFlinging(); 553 layer_tree_host_->DidStopFlinging();
545 } 554 }
546 555
547 void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) { 556 void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) {
548 cc::Layer* cc_layer = static_cast<WebLayerImpl*>(layer)->layer(); 557 cc::Layer* cc_layer = static_cast<WebLayerImpl*>(layer)->layer();
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 widget_->OnSwapBuffersAborted(); 712 widget_->OnSwapBuffersAborted();
704 } 713 }
705 714
706 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 715 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
707 cc::ContextProvider* provider = 716 cc::ContextProvider* provider =
708 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 717 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
709 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 718 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
710 } 719 }
711 720
712 } // namespace content 721 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698