Browse Source

skia: less hints

mattias 1 year ago
parent
commit
5a1f164cb3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      demo/LCLSkiaPaintBox/LCL.Skia.pas

+ 3 - 1
demo/LCLSkiaPaintBox/LCL.Skia.pas

@@ -6,7 +6,7 @@ unit LCL.Skia;
 interface
 interface
 
 
 uses
 uses
-  Classes, SysUtils, Math, System.Math.Vectors, Types, System.UITypes, Controls, IntfGraphics,
+  Classes, SysUtils, Math, Types, System.UITypes, Controls, IntfGraphics,
   Graphics, LCLIntf, GraphType, System.Skia, SkiaFPC;
   Graphics, LCLIntf, GraphType, System.Skia, SkiaFPC;
 
 
 type
 type
@@ -945,6 +945,8 @@ end;
 
 
 function TSkRasterControlRender.TryRender(const ABackgroundBuffer: TBitmap; const AOpacity: Byte): Boolean;
 function TSkRasterControlRender.TryRender(const ABackgroundBuffer: TBitmap; const AOpacity: Byte): Boolean;
 begin
 begin
+  if AOpacity=0 then exit;
+  if ABackgroundBuffer=nil then ;
   DoRender(FTarget.ClientWidth, FTarget.ClientHeight, FTarget.ScaleFactor, FTarget.Canvas{, ABackgroundBuffer, AOpacity});
   DoRender(FTarget.ClientWidth, FTarget.ClientHeight, FTarget.ScaleFactor, FTarget.Canvas{, ABackgroundBuffer, AOpacity});
   Result := True;
   Result := True;
 end;
 end;