- Timestamp:
- Dec 27, 2017, 8:28:45 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r14 r15 39 39 procedure Timer1Timer(Sender: TObject); 40 40 private 41 TempBitmap: TBitmap; 41 42 RedrawPending: Boolean; 42 43 VideoDevice: TDeviceVideoBase; … … 73 74 NewApp2: TApp; 74 75 begin 76 TempBitmap := TBitmap.Create; 75 77 PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque]; 76 78 … … 164 166 begin 165 167 FreeAndNil(Kernel); 168 FreeAndNil(TempBitmap); 166 169 end; 167 170 … … 186 189 X, Y: Integer; 187 190 DX, DY: Integer; 188 Bitmap: TBitmap;189 191 P, PR: PByte; 190 192 begin 191 193 try 192 Bitmap := TBitmap.Create; 193 Bitmap.BeginUpdate; 194 Bitmap.SetSize(PaintBox1.Width, PaintBox1.Height); 194 TempBitmap.BeginUpdate; 195 TempBitmap.SetSize(PaintBox1.Width, PaintBox1.Height); 195 196 196 197 if Assigned(VideoDevice.VideoMemory) then begin … … 201 202 PR := P; 202 203 for X := 0 to VideoDevice.VideoMode.Size.X - 1 do begin 203 Bitmap.Canvas.Pixels[X, Y] := PInteger(PR)^ and $ffffff;204 TempBitmap.Canvas.Pixels[X, Y] := PInteger(PR)^ and $ffffff; 204 205 Inc(PR, DX); 205 206 end; … … 208 209 end; 209 210 finally 210 PaintBox1.Canvas.Draw(0, 0, Bitmap); 211 Bitmap.EndUpdate; 212 Bitmap.Free; 211 PaintBox1.Canvas.Draw(0, 0, TempBitmap); 212 TempBitmap.EndUpdate; 213 213 end; 214 214 end; -
trunk/Packages/Kernel/UAPI.pas
r13 r15 252 252 if Assigned(Window) then begin 253 253 Canvas := Window.Canvas; 254 Canvas.Parent := TKernel(Kernel).Screens.First.Canvas;255 254 Result := Canvas.Id; 256 255 end else Result := -1; -
trunk/Packages/Kernel/UGraphics.pas
r13 r15 70 70 Id: Integer; 71 71 Visible: Boolean; 72 constructor Create; 72 73 procedure Paint; virtual; 73 74 property Canvas: TCanvas read GetCanvas; … … 102 103 Objects: TFPGObjectList<TGraphicObject>; 103 104 Canvases: TFPGObjectList<TCanvas>; 105 ParentCanvas: TCanvas; 104 106 function CreateWindow: TWindow; 105 107 function CreateCanvas: TCanvas; … … 225 227 function TGraphicObject.GetCanvas: TCanvas; 226 228 begin 227 FCanvas := Desktop.CreateCanvas; 229 if not Assigned(FCanvas) then 230 FCanvas := Desktop.CreateCanvas; 228 231 Result := FCanvas; 232 end; 233 234 constructor TGraphicObject.Create; 235 begin 236 FCanvas := nil; 229 237 end; 230 238 … … 257 265 Result := TWindow.Create; 258 266 Result.Id := ObjectLastId; 267 Result.Desktop := Self; 268 Result.Canvas.Parent := ParentCanvas; 259 269 Objects.Add(Result); 270 Paint; 260 271 end; 261 272 -
trunk/Packages/Kernel/UKernel.pas
r13 r15 89 89 TScreenCanvas(NewScreen.Canvas).Screen := NewScreen; 90 90 Screens.Add(NewScreen); 91 Desktop.ParentCanvas := Screens.First.Canvas; 91 92 end; 92 93 Modes.Free; -
trunk/Packages/Kernel/UScreen.pas
r13 r15 68 68 for X := Rect.Left to Rect.Right do 69 69 SetPixel(TPoint.Create(X, Y), Color); 70 Screen.VideoMemoryUpdated; 70 71 end; 71 72
Note:
See TracChangeset
for help on using the changeset viewer.