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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1841083007: Remove SendBeginFramesToChildren plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_output_surface_client_set_beginframesource
Patch Set: Rebase Created 4 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
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_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 #include <QuartzCore/QuartzCore.h> 9 #include <QuartzCore/QuartzCore.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 void RenderWidgetHostViewMac::DelegatedFrameHostOnLostCompositorResources() { 475 void RenderWidgetHostViewMac::DelegatedFrameHostOnLostCompositorResources() {
476 render_widget_host_->ScheduleComposite(); 476 render_widget_host_->ScheduleComposite();
477 } 477 }
478 478
479 void RenderWidgetHostViewMac::DelegatedFrameHostUpdateVSyncParameters( 479 void RenderWidgetHostViewMac::DelegatedFrameHostUpdateVSyncParameters(
480 const base::TimeTicks& timebase, 480 const base::TimeTicks& timebase,
481 const base::TimeDelta& interval) { 481 const base::TimeDelta& interval) {
482 render_widget_host_->UpdateVSyncParameters(timebase, interval); 482 render_widget_host_->UpdateVSyncParameters(timebase, interval);
483 } 483 }
484 484
485 void RenderWidgetHostViewMac::SetBeginFrameSource(
486 cc::BeginFrameSource* source) {
487 if (begin_frame_source_ && needs_begin_frames_)
488 begin_frame_source_->RemoveObserver(this);
489 begin_frame_source_ = source;
490 if (begin_frame_source_ && needs_begin_frames_)
491 begin_frame_source_->AddObserver(this);
492 }
493
494 ////////////////////////////////////////////////////////////////////////////////
495 // cc::BeginFrameSourceBase, public:
496
497 void RenderWidgetHostViewMac::OnSetNeedsBeginFrames(bool needs_begin_frames) {
498 if (needs_begin_frames_ == needs_begin_frames)
499 return;
500
501 needs_begin_frames_ = needs_begin_frames;
502 if (begin_frame_source_) {
503 if (needs_begin_frames_)
504 begin_frame_source_->AddObserver(this);
505 else
506 begin_frame_source_->RemoveObserver(this);
507 }
508 }
509
510 bool RenderWidgetHostViewMac::OnBeginFrameDerivedImpl(
511 const cc::BeginFrameArgs& args) {
512 delegated_frame_host_->SetVSyncParameters(args.frame_time, args.interval);
513 render_widget_host_->Send(
514 new ViewMsg_BeginFrame(render_widget_host_->GetRoutingID(), args));
515 return true;
516 }
517
518 void RenderWidgetHostViewMac::OnBeginFrameSourcePausedChanged(
519 bool paused) {
520 // Nothing to do here.
521 }
522
485 //////////////////////////////////////////////////////////////////////////////// 523 ////////////////////////////////////////////////////////////////////////////////
486 // AcceleratedWidgetMacNSView, public: 524 // AcceleratedWidgetMacNSView, public:
487 525
488 NSView* RenderWidgetHostViewMac::AcceleratedWidgetGetNSView() const { 526 NSView* RenderWidgetHostViewMac::AcceleratedWidgetGetNSView() const {
489 return cocoa_view_; 527 return cocoa_view_;
490 } 528 }
491 529
492 void RenderWidgetHostViewMac::AcceleratedWidgetGetVSyncParameters( 530 void RenderWidgetHostViewMac::AcceleratedWidgetGetVSyncParameters(
493 base::TimeTicks* timebase, base::TimeDelta* interval) const { 531 base::TimeTicks* timebase, base::TimeDelta* interval) const {
494 if (display_link_ && 532 if (display_link_ &&
(...skipping 25 matching lines...) Expand all
520 : render_widget_host_(RenderWidgetHostImpl::From(widget)), 558 : render_widget_host_(RenderWidgetHostImpl::From(widget)),
521 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), 559 text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
522 can_compose_inline_(true), 560 can_compose_inline_(true),
523 browser_compositor_state_(BrowserCompositorDestroyed), 561 browser_compositor_state_(BrowserCompositorDestroyed),
524 browser_compositor_placeholder_(new BrowserCompositorMacPlaceholder), 562 browser_compositor_placeholder_(new BrowserCompositorMacPlaceholder),
525 page_at_minimum_scale_(true), 563 page_at_minimum_scale_(true),
526 is_loading_(false), 564 is_loading_(false),
527 allow_pause_for_resize_or_repaint_(true), 565 allow_pause_for_resize_or_repaint_(true),
528 is_guest_view_hack_(is_guest_view_hack), 566 is_guest_view_hack_(is_guest_view_hack),
529 wheel_gestures_enabled_(UseGestureBasedWheelScrolling()), 567 wheel_gestures_enabled_(UseGestureBasedWheelScrolling()),
530 fullscreen_parent_host_view_(NULL), 568 fullscreen_parent_host_view_(nullptr),
569 begin_frame_source_(nullptr),
570 needs_begin_frames_(false),
531 weak_factory_(this) { 571 weak_factory_(this) {
532 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| 572 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_|
533 // goes away. Since we autorelease it, our caller must put 573 // goes away. Since we autorelease it, our caller must put
534 // |GetNativeView()| into the view hierarchy right after calling us. 574 // |GetNativeView()| into the view hierarchy right after calling us.
535 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] 575 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc]
536 initWithRenderWidgetHostViewMac:this] autorelease]; 576 initWithRenderWidgetHostViewMac:this] autorelease];
537 577
538 // Paint this view host with |background_color_| when there is no content 578 // Paint this view host with |background_color_| when there is no content
539 // ready to draw. 579 // ready to draw.
540 background_layer_.reset([[CALayer alloc] init]); 580 background_layer_.reset([[CALayer alloc] init]);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // This should only be reached if |render_widget_host_| is hidden, destroyed, 720 // This should only be reached if |render_widget_host_| is hidden, destroyed,
681 // or in the process of being destroyed. 721 // or in the process of being destroyed.
682 DestroyBrowserCompositorView(); 722 DestroyBrowserCompositorView();
683 } 723 }
684 724
685 bool RenderWidgetHostViewMac::OnMessageReceived(const IPC::Message& message) { 725 bool RenderWidgetHostViewMac::OnMessageReceived(const IPC::Message& message) {
686 bool handled = true; 726 bool handled = true;
687 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewMac, message) 727 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewMac, message)
688 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedTextCompleted, 728 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedTextCompleted,
689 OnGetRenderedTextCompleted) 729 OnGetRenderedTextCompleted)
730 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames,
731 OnSetNeedsBeginFrames)
690 IPC_MESSAGE_UNHANDLED(handled = false) 732 IPC_MESSAGE_UNHANDLED(handled = false)
691 IPC_END_MESSAGE_MAP() 733 IPC_END_MESSAGE_MAP()
692 return handled; 734 return handled;
693 } 735 }
694 736
695 void RenderWidgetHostViewMac::InitAsChild( 737 void RenderWidgetHostViewMac::InitAsChild(
696 gfx::NativeView parent_view) { 738 gfx::NativeView parent_view) {
697 } 739 }
698 740
699 void RenderWidgetHostViewMac::InitAsPopup( 741 void RenderWidgetHostViewMac::InitAsPopup(
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after
3397 3439
3398 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3440 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3399 // regions that are not draggable. (See ControlRegionView in 3441 // regions that are not draggable. (See ControlRegionView in
3400 // native_app_window_cocoa.mm). This requires the render host view to be 3442 // native_app_window_cocoa.mm). This requires the render host view to be
3401 // draggable by default. 3443 // draggable by default.
3402 - (BOOL)mouseDownCanMoveWindow { 3444 - (BOOL)mouseDownCanMoveWindow {
3403 return YES; 3445 return YES;
3404 } 3446 }
3405 3447
3406 @end 3448 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698