mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-24 08:02:15 +02:00
Issue #271 is fixed
Removed workaround from TBufferPanel, TFMXBufferPanel and demos.
This commit is contained in:
parent
fef076d4ea
commit
c9b2af2a5e
@ -635,27 +635,11 @@ end;
|
||||
procedure TFMXExternalPumpBrowserFrm.chrmosrGetViewRect( Sender : TObject;
|
||||
const browser : ICefBrowser;
|
||||
var rect : TCefRect);
|
||||
var
|
||||
TempScale : single;
|
||||
begin
|
||||
rect.x := 0;
|
||||
rect.y := 0;
|
||||
rect.width := round(Panel1.Width);
|
||||
rect.height := round(Panel1.Height);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if GlobalCEFApp.EnableGPU then
|
||||
begin
|
||||
TempScale := Panel1.ScreenScale;
|
||||
|
||||
if (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXExternalPumpBrowserFrm.chrmosrPaint( Sender : TObject;
|
||||
|
@ -587,27 +587,11 @@ end;
|
||||
|
||||
procedure TBrowserFrame.FMXChromium1GetViewRect(Sender: TObject;
|
||||
const browser: ICefBrowser; var rect: TCefRect);
|
||||
var
|
||||
TempScale : single;
|
||||
begin
|
||||
rect.x := 0;
|
||||
rect.y := 0;
|
||||
rect.width := round(FMXBufferPanel1.Width);
|
||||
rect.height := round(FMXBufferPanel1.Height);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if GlobalCEFApp.EnableGPU then
|
||||
begin
|
||||
TempScale := FMXBufferPanel1.ScreenScale;
|
||||
|
||||
if (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.FMXChromium1LoadError(Sender: TObject;
|
||||
|
@ -366,15 +366,6 @@ begin
|
||||
rect.y := 0;
|
||||
rect.width := DeviceToLogical(Panel1.Width, TempScale);
|
||||
rect.height := DeviceToLogical(Panel1.Height, TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.EnableGPU and (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWebBrowserFrm.chrmosrPaint( Sender : TObject;
|
||||
|
@ -432,15 +432,6 @@ begin
|
||||
rect.y := 0;
|
||||
rect.width := DeviceToLogical(Panel1.Width, TempScale);
|
||||
rect.height := DeviceToLogical(Panel1.Height, TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.EnableGPU and (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.chrmosrPaint( Sender : TObject;
|
||||
|
@ -409,15 +409,6 @@ begin
|
||||
rect.y := 0;
|
||||
rect.width := DeviceToLogical(Panel1.Width, TempScale);
|
||||
rect.height := DeviceToLogical(Panel1.Height, TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.EnableGPU and (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TOSRExternalPumpBrowserFrm.chrmosrPaint( Sender : TObject;
|
||||
|
@ -464,15 +464,6 @@ begin
|
||||
rect.y := 0;
|
||||
rect.width := DeviceToLogical(Panel1.Width, TempScale);
|
||||
rect.height := DeviceToLogical(Panel1.Height, TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.EnableGPU and (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.chrmosrPaint( Sender : TObject;
|
||||
|
@ -38,8 +38,8 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="188"/>
|
||||
<CursorPos X="5" Y="215"/>
|
||||
<TopLine Value="382"/>
|
||||
<CursorPos X="60" Y="393"/>
|
||||
<UsageCount Value="42"/>
|
||||
<Bookmarks Count="2">
|
||||
<Item0 X="40" Y="301" ID="4"/>
|
||||
@ -247,123 +247,123 @@
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="343" Column="64" TopLine="320"/>
|
||||
<Caret Line="344" Column="64" TopLine="320"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="344" Column="64" TopLine="320"/>
|
||||
<Caret Line="358" Column="26" TopLine="321"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="358" Column="26" TopLine="321"/>
|
||||
<Caret Line="364" Column="71" TopLine="323"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="364" Column="71" TopLine="323"/>
|
||||
<Caret Line="365" Column="71" TopLine="324"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="365" Column="71" TopLine="324"/>
|
||||
<Caret Line="507" TopLine="469"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="507" TopLine="469"/>
|
||||
<Caret Line="510" Column="48" TopLine="469"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="510" Column="48" TopLine="469"/>
|
||||
<Caret Line="780" Column="52" TopLine="739"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="780" Column="52" TopLine="739"/>
|
||||
<Caret Line="801" Column="52" TopLine="760"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="801" Column="52" TopLine="760"/>
|
||||
<Caret Line="818" Column="52" TopLine="777"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="818" Column="52" TopLine="777"/>
|
||||
<Caret Line="832" Column="52" TopLine="791"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="832" Column="52" TopLine="791"/>
|
||||
<Caret Line="982" Column="52" TopLine="941"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="982" Column="52" TopLine="941"/>
|
||||
<Caret Line="224" Column="40" TopLine="201"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="224" Column="40" TopLine="201"/>
|
||||
<Caret Line="318" Column="75" TopLine="238"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="318" Column="75" TopLine="238"/>
|
||||
<Caret Line="225" Column="59" TopLine="201"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="225" Column="59" TopLine="201"/>
|
||||
<Caret Line="320" Column="46" TopLine="292"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="320" Column="46" TopLine="292"/>
|
||||
<Caret Line="343" Column="28" TopLine="310"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="343" Column="28" TopLine="310"/>
|
||||
<Caret Line="365" Column="9" TopLine="344"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="365" Column="9" TopLine="344"/>
|
||||
<Caret Line="512" Column="55" TopLine="486"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="512" Column="55" TopLine="486"/>
|
||||
<Caret Line="775" Column="86" TopLine="735"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="775" Column="86" TopLine="735"/>
|
||||
<Caret Line="793" Column="54" TopLine="765"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="793" Column="54" TopLine="765"/>
|
||||
<Caret Line="807" Column="56" TopLine="782"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="807" Column="56" TopLine="782"/>
|
||||
<Caret Line="818" Column="86" TopLine="797"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="818" Column="86" TopLine="797"/>
|
||||
<Caret Line="965" Column="60" TopLine="936"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="965" Column="60" TopLine="936"/>
|
||||
<Caret Line="224" Column="40" TopLine="201"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="224" Column="40" TopLine="201"/>
|
||||
<Caret Line="314" Column="40" TopLine="310"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="314" Column="40" TopLine="310"/>
|
||||
<Caret Line="337" Column="37" TopLine="309"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="337" Column="37" TopLine="309"/>
|
||||
<Caret Line="352" Column="36" TopLine="338"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="352" Column="36" TopLine="338"/>
|
||||
<Caret Line="507" Column="44" TopLine="496"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="507" Column="44" TopLine="496"/>
|
||||
<Caret Line="774" Column="48" TopLine="745"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="774" Column="48" TopLine="745"/>
|
||||
<Caret Line="93" Column="25" TopLine="87"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
|
@ -391,15 +391,6 @@ begin
|
||||
rect.y := 0;
|
||||
rect.width := DeviceToLogical(Panel1.Width, TempScale);
|
||||
rect.height := DeviceToLogical(Panel1.Height, TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.EnableGPU and (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(rect.width * TempScale) <> 0) do dec(rect.width);
|
||||
while (Frac(rect.height * TempScale) <> 0) do dec(rect.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.chrmosrPaint(Sender: TObject; const browser: ICefBrowser;
|
||||
|
@ -793,15 +793,6 @@ begin
|
||||
TempDevWidth := LogicalToDevice(TempLogWidth, TempScale);
|
||||
TempDevHeight := LogicalToDevice(TempLogHeight, TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if GlobalCEFApp.EnableGPU then
|
||||
begin
|
||||
while (Frac(TempDevWidth * TempScale) <> 0) do dec(TempDevWidth);
|
||||
while (Frac(TempDevHeight * TempScale) <> 0) do dec(TempDevHeight);
|
||||
end;
|
||||
|
||||
Result := (FBuffer <> nil) and
|
||||
(FBuffer.Width = TempDevWidth) and
|
||||
(FBuffer.Height = TempDevHeight);
|
||||
|
@ -460,15 +460,6 @@ begin
|
||||
TempWidth := round(Width * TempScale);
|
||||
TempHeight := round(Height * TempScale);
|
||||
|
||||
// Workaround for CEF4Delphi issue #271 (CEF issue #2833)
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/271
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2833/osr-gpu-consume-cpu-and-may-not-draw
|
||||
if GlobalCEFApp.EnableGPU and (TempScale <> 1) then
|
||||
begin
|
||||
while (Frac(TempWidth * TempScale) <> 0) do dec(TempWidth);
|
||||
while (Frac(TempHeight * TempScale) <> 0) do dec(TempHeight);
|
||||
end;
|
||||
|
||||
Result := (FBuffer <> nil) and
|
||||
(FBuffer.BitmapScale = TempScale) and
|
||||
(FBuffer.Width = TempWidth) and
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 114,
|
||||
"InternalVersion" : 115,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "80.1.15.0"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user