Remove unused GetCompositor method and fix macOS compile error (see issue #2575)

This commit is contained in:
Marshall Greenblatt 2019-07-18 19:30:29 -04:00
parent fafe7a7cfc
commit cf87c88b05
2 changed files with 8 additions and 24 deletions

View File

@ -953,8 +953,8 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
if (render_widget_host_) if (render_widget_host_)
render_widget_host_->ProgressFlingIfNeeded(frame_time); render_widget_host_->ProgressFlingIfNeeded(frame_time);
GetCompositor()->context_factory_private()->IssueExternalBeginFrame( compositor_->context_factory_private()->IssueExternalBeginFrame(
GetCompositor(), begin_frame_args); compositor_.get(), begin_frame_args);
if (!IsPopupWidget() && popup_host_view_) { if (!IsPopupWidget() && popup_host_view_) {
popup_host_view_->SendExternalBeginFrame(); popup_host_view_->SendExternalBeginFrame();
@ -1322,10 +1322,6 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
ReleaseResize(); ReleaseResize();
} }
ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const {
return compositor_.get();
}
ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const { ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const {
return root_layer_.get(); return root_layer_.get();
} }
@ -1349,26 +1345,16 @@ void CefRenderWidgetHostViewOSR::SetFrameRate() {
if (frame_rate_threshold_us_ != 0) if (frame_rate_threshold_us_ != 0)
return; return;
ui::Compositor* compositor = GetCompositor();
int frame_rate = int frame_rate =
osr_util::ClampFrameRate(browser->settings().windowless_frame_rate); osr_util::ClampFrameRate(browser->settings().windowless_frame_rate);
frame_rate_threshold_us_ = 1000000 / frame_rate; frame_rate_threshold_us_ = 1000000 / frame_rate;
#if defined(OS_MACOSX) if (compositor_) {
if (browser_compositor_) { compositor_->SetDisplayVSyncParameters(
browser_compositor_->UpdateVSyncParameters(
base::TimeTicks::Now(), base::TimeTicks::Now(),
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_)); base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
} }
#else
if (compositor) {
compositor->SetDisplayVSyncParameters(
base::TimeTicks::Now(),
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
}
#endif
if (video_consumer_) { if (video_consumer_) {
video_consumer_->SetFrameRate( video_consumer_->SetFrameRate(
@ -1430,12 +1416,11 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer(bool force) {
local_surface_id_allocation_ = local_surface_id_allocation_ =
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation(); local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
if (GetCompositor()) { if (compositor_) {
compositor_local_surface_id_allocator_.GenerateId(); compositor_local_surface_id_allocator_.GenerateId();
GetCompositor()->SetScaleAndSize(current_device_scale_factor_, compositor_->SetScaleAndSize(current_device_scale_factor_, size_in_pixels,
size_in_pixels, compositor_local_surface_id_allocator_
compositor_local_surface_id_allocator_ .GetCurrentLocalSurfaceIdAllocation());
.GetCurrentLocalSurfaceIdAllocation());
} }
GetDelegatedFrameHost()->EmbedSurface( GetDelegatedFrameHost()->EmbedSurface(

View File

@ -262,7 +262,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
child_host_view_ = popup_view; child_host_view_ = popup_view;
} }
ui::Compositor* GetCompositor() const;
content::RenderWidgetHostImpl* render_widget_host() const { content::RenderWidgetHostImpl* render_widget_host() const {
return render_widget_host_; return render_widget_host_;
} }