Fix OSR use_external_begin_frame support and update VSync setters (fixes issue #2618)

This commit is contained in:
Orfeas Zafeiris
2019-04-15 16:57:33 +00:00
committed by Marshall Greenblatt
parent 941d53ebfd
commit 5623338662

View File

@@ -406,7 +406,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
context_factory_private->AllocateFrameSinkId(), context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(), context_factory_private, content::GetContextFactory(), context_factory_private,
base::ThreadTaskRunnerHandle::Get(), false /* enable_pixel_canvas */, base::ThreadTaskRunnerHandle::Get(), false /* enable_pixel_canvas */,
use_external_begin_frame ? this : nullptr, use_external_begin_frame)); use_external_begin_frame ? this : nullptr));
compositor_->SetAcceleratedWidget(compositor_widget_); compositor_->SetAcceleratedWidget(compositor_widget_);
// Tell the compositor to use shared textures if the client can handle // Tell the compositor to use shared textures if the client can handle
@@ -694,7 +694,9 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
// the frame rate to something other than the default of 60Hz. // the frame rate to something other than the default of 60Hz.
if (sync_frame_rate_) { if (sync_frame_rate_) {
if (frame_rate_threshold_us_ != 0) { if (frame_rate_threshold_us_ != 0) {
// TODO(cef): Figure out how to set the VSync interval. See issue #2517. GetCompositor()->SetDisplayVSyncParameters(
base::TimeTicks::Now(),
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
} }
sync_frame_rate_ = false; sync_frame_rate_ = false;
} }
@@ -1731,7 +1733,9 @@ void CefRenderWidgetHostViewOSR::SetFrameRate() {
frame_rate_threshold_us_ = 1000000 / frame_rate; frame_rate_threshold_us_ = 1000000 / frame_rate;
if (compositor) { if (compositor) {
// TODO(cef): Figure out how to set the VSync interval. See issue #2517. compositor->vsync_manager()->UpdateVSyncParameters(
base::TimeTicks::Now(),
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
} }
if (copy_frame_generator_.get()) { if (copy_frame_generator_.get()) {