feat: remove osr framerate limit when use shared texture (#45669)

feat: remove framerate limit, if use shared texture osr.
This commit is contained in:
reito 2025-02-24 23:21:46 +08:00 committed by GitHub
parent 698cce6707
commit f3259be73c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@ _Notes_:
* There are two rendering modes that can be used (see the section below) and only * There are two rendering modes that can be used (see the section below) and only
the dirty area is passed to the `paint` event to be more efficient. the dirty area is passed to the `paint` event to be more efficient.
* You can stop/continue the rendering as well as set the frame rate. * You can stop/continue the rendering as well as set the frame rate.
* The maximum frame rate is 240 because greater values bring only performance * When `webPreferences.offscreen.useSharedTexture` is not `true`, the maximum frame rate is 240 because greater values bring only performance
losses with no benefits. losses with no benefits.
* When nothing is happening on a webpage, no frames are generated. * When nothing is happening on a webpage, no frames are generated.
* An offscreen window is always created as a * An offscreen window is always created as a

View file

@ -918,7 +918,7 @@ void OffScreenRenderWidgetHostView::SetFrameRate(int frame_rate) {
} else { } else {
if (frame_rate <= 0) if (frame_rate <= 0)
frame_rate = 1; frame_rate = 1;
if (frame_rate > 240) if (!offscreen_use_shared_texture_ && frame_rate > 240)
frame_rate = 240; frame_rate = 240;
frame_rate_ = frame_rate; frame_rate_ = frame_rate;