Changeset 318
- Timestamp:
- Feb 1, 2012, 3:33:59 PM (13 years ago)
- Location:
- GraphicTest
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/GraphicTest.lpi
r317 r318 41 41 <TopLine Value="1"/> 42 42 <CursorPos X="51" Y="15"/> 43 <UsageCount Value="5 8"/>43 <UsageCount Value="59"/> 44 44 </Unit0> 45 45 <Unit1> … … 52 52 <EditorIndex Value="0"/> 53 53 <WindowIndex Value="0"/> 54 <TopLine Value="1 18"/>55 <CursorPos X=" 32" Y="135"/>56 <UsageCount Value="5 8"/>54 <TopLine Value="198"/> 55 <CursorPos X="79" Y="203"/> 56 <UsageCount Value="59"/> 57 57 <Loaded Value="True"/> 58 58 <LoadedDesigner Value="True"/> … … 71 71 <TopLine Value="1"/> 72 72 <CursorPos X="1" Y="1"/> 73 <UsageCount Value="5 8"/>73 <UsageCount Value="59"/> 74 74 </Unit3> 75 75 <Unit4> … … 161 161 <EditorIndex Value="2"/> 162 162 <WindowIndex Value="0"/> 163 <TopLine Value="6 90"/>164 <CursorPos X="3" Y=" 709"/>165 <UsageCount Value="5 2"/>163 <TopLine Value="658"/> 164 <CursorPos X="3" Y="662"/> 165 <UsageCount Value="53"/> 166 166 <Loaded Value="True"/> 167 167 </Unit17> … … 172 172 <EditorIndex Value="1"/> 173 173 <WindowIndex Value="0"/> 174 <TopLine Value="1 85"/>175 <CursorPos X=" 39" Y="198"/>176 <UsageCount Value="5 2"/>174 <TopLine Value="15"/> 175 <CursorPos X="19" Y="25"/> 176 <UsageCount Value="53"/> 177 177 <Loaded Value="True"/> 178 178 </Unit18> … … 186 186 <Filename Value="BGRABitmap/bgradefaultbitmap.pas"/> 187 187 <UnitName Value="BGRADefaultBitmap"/> 188 <EditorIndex Value=" 13"/>188 <EditorIndex Value="3"/> 189 189 <WindowIndex Value="0"/> 190 190 <TopLine Value="655"/> 191 <CursorPos X="2 5" Y="666"/>192 <UsageCount Value="1 1"/>191 <CursorPos X="22" Y="667"/> 192 <UsageCount Value="12"/> 193 193 <Loaded Value="True"/> 194 194 </Unit20> … … 385 385 <Unit50> 386 386 <Filename Value="../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/inc/mathh.inc"/> 387 <EditorIndex Value="14"/>388 387 <WindowIndex Value="0"/> 389 388 <TopLine Value="65"/> 390 389 <CursorPos X="14" Y="78"/> 391 390 <UsageCount Value="11"/> 392 <Loaded Value="True"/>393 391 </Unit50> 394 392 <Unit51> 395 393 <Filename Value="../../../Lazarus/0.9.31_2.6.0/components/opengl/openglcontext.pas"/> 396 394 <UnitName Value="OpenGLContext"/> 397 <EditorIndex Value="9"/>398 395 <WindowIndex Value="0"/> 399 396 <TopLine Value="387"/> 400 397 <CursorPos X="3" Y="389"/> 401 398 <UsageCount Value="11"/> 402 <Loaded Value="True"/>403 399 </Unit51> 404 400 <Unit52> 405 401 <Filename Value="../../../Lazarus/0.9.31_2.6.0/components/opengl/glwin32wglcontext.pas"/> 406 402 <UnitName Value="GLWin32WGLContext"/> 407 <EditorIndex Value="10"/>408 403 <WindowIndex Value="0"/> 409 404 <TopLine Value="236"/> 410 405 <CursorPos X="3" Y="240"/> 411 406 <UsageCount Value="11"/> 412 <Loaded Value="True"/>413 407 </Unit52> 414 408 <Unit53> 415 409 <Filename Value="../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/win/wininc/func.inc"/> 416 <EditorIndex Value="12"/>417 410 <WindowIndex Value="0"/> 418 411 <TopLine Value="988"/> 419 412 <CursorPos X="10" Y="1001"/> 420 413 <UsageCount Value="11"/> 421 <Loaded Value="True"/>422 414 </Unit53> 423 415 <Unit54> 424 416 <Filename Value="../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/win/wininc/ascdef.inc"/> 425 <EditorIndex Value="11"/>426 417 <WindowIndex Value="0"/> 427 418 <TopLine Value="236"/> 428 419 <CursorPos X="10" Y="249"/> 429 420 <UsageCount Value="11"/> 430 <Loaded Value="True"/>431 421 </Unit54> 432 422 <Unit55> 433 423 <Filename Value="../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/objpas/objpas.pp"/> 434 424 <UnitName Value="objpas"/> 435 <EditorIndex Value="8"/>436 425 <WindowIndex Value="0"/> 437 426 <TopLine Value="15"/> 438 427 <CursorPos X="8" Y="28"/> 439 428 <UsageCount Value="11"/> 440 <Loaded Value="True"/>441 429 </Unit55> 442 430 <Unit56> 443 431 <Filename Value="../../../Lazarus/0.9.31_2.6.0/lcl/graphics.pp"/> 444 432 <UnitName Value="Graphics"/> 445 <EditorIndex Value="4"/>446 433 <WindowIndex Value="0"/> 447 434 <TopLine Value="1292"/> 448 435 <CursorPos X="15" Y="1305"/> 449 436 <UsageCount Value="11"/> 450 <Loaded Value="True"/>451 437 </Unit56> 452 438 <Unit57> 453 439 <Filename Value="../../../Lazarus/0.9.31_2.6.0/lcl/include/rasterimage.inc"/> 454 <EditorIndex Value="5"/>455 440 <WindowIndex Value="0"/> 456 441 <TopLine Value="247"/> 457 <CursorPos X="1" Y="260"/> 458 <UsageCount Value="11"/> 459 <Loaded Value="True"/> 442 <CursorPos X="61" Y="251"/> 443 <UsageCount Value="11"/> 460 444 </Unit57> 461 445 <Unit58> 462 446 <Filename Value="../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/inc/systemh.inc"/> 463 <EditorIndex Value="3"/>464 447 <WindowIndex Value="0"/> 465 448 <TopLine Value="501"/> 466 449 <CursorPos X="11" Y="514"/> 467 450 <UsageCount Value="11"/> 468 <Loaded Value="True"/>469 451 </Unit58> 470 452 <Unit59> 471 453 <Filename Value="../../../Lazarus/0.9.31_2.6.0/lcl/include/custombitmap.inc"/> 472 <EditorIndex Value="7"/>473 454 <WindowIndex Value="0"/> 474 455 <TopLine Value="403"/> 475 456 <CursorPos X="1" Y="416"/> 476 <UsageCount Value="10"/> 477 <Loaded Value="True"/> 457 <UsageCount Value="11"/> 478 458 </Unit59> 479 459 <Unit60> 480 460 <Filename Value="../../../Lazarus/0.9.31_2.6.0/lcl/include/bitmapcanvas.inc"/> 481 <EditorIndex Value="6"/>482 461 <WindowIndex Value="0"/> 483 462 <TopLine Value="90"/> 484 463 <CursorPos X="1" Y="103"/> 485 <UsageCount Value="10"/> 486 <Loaded Value="True"/> 464 <UsageCount Value="11"/> 487 465 </Unit60> 488 466 </Units> 489 <JumpHistory Count="30" HistoryIndex="2 9">467 <JumpHistory Count="30" HistoryIndex="27"> 490 468 <Position1> 491 469 <Filename Value="UMainForm.pas"/> 492 <Caret Line=" 233" Column="30" TopLine="210"/>470 <Caret Line="199" Column="1" TopLine="184"/> 493 471 </Position1> 494 472 <Position2> 495 473 <Filename Value="UMainForm.pas"/> 496 <Caret Line="1 17" Column="1" TopLine="112"/>474 <Caret Line="156" Column="1" TopLine="143"/> 497 475 </Position2> 498 476 <Position3> 499 477 <Filename Value="UMainForm.pas"/> 500 <Caret Line="1 90" Column="12" TopLine="178"/>478 <Caret Line="189" Column="82" TopLine="177"/> 501 479 </Position3> 502 480 <Position4> 503 481 <Filename Value="UMainForm.pas"/> 504 <Caret Line="14 5" Column="21" TopLine="138"/>482 <Caret Line="144" Column="43" TopLine="136"/> 505 483 </Position4> 506 484 <Position5> 507 485 <Filename Value="UMainForm.pas"/> 508 <Caret Line="1 42" Column="1" TopLine="137"/>486 <Caret Line="185" Column="20" TopLine="183"/> 509 487 </Position5> 510 488 <Position6> 511 489 <Filename Value="UMainForm.pas"/> 512 <Caret Line="19 2" Column="14" TopLine="187"/>490 <Caret Line="191" Column="3" TopLine="189"/> 513 491 </Position6> 514 492 <Position7> 515 493 <Filename Value="UMainForm.pas"/> 516 <Caret Line=" 199" Column="1" TopLine="184"/>494 <Caret Line="236" Column="58" TopLine="215"/> 517 495 </Position7> 518 496 <Position8> 519 497 <Filename Value="UMainForm.pas"/> 520 <Caret Line="1 56" Column="1" TopLine="143"/>498 <Caret Line="124" Column="14" TopLine="107"/> 521 499 </Position8> 522 500 <Position9> 523 501 <Filename Value="UMainForm.pas"/> 524 <Caret Line=" 189" Column="82" TopLine="177"/>502 <Caret Line="206" Column="19" TopLine="203"/> 525 503 </Position9> 526 504 <Position10> 527 505 <Filename Value="UMainForm.pas"/> 528 <Caret Line="1 44" Column="43" TopLine="136"/>506 <Caret Line="117" Column="3" TopLine="115"/> 529 507 </Position10> 530 508 <Position11> 531 509 <Filename Value="UMainForm.pas"/> 532 <Caret Line="1 85" Column="20" TopLine="183"/>510 <Caret Line="118" Column="1" TopLine="113"/> 533 511 </Position11> 534 512 <Position12> 535 513 <Filename Value="UMainForm.pas"/> 536 <Caret Line="1 91" Column="3" TopLine="189"/>514 <Caret Line="119" Column="1" TopLine="113"/> 537 515 </Position12> 538 516 <Position13> 539 517 <Filename Value="UMainForm.pas"/> 540 <Caret Line="2 36" Column="58" TopLine="215"/>518 <Caret Line="242" Column="1" TopLine="223"/> 541 519 </Position13> 542 520 <Position14> 543 521 <Filename Value="UMainForm.pas"/> 544 <Caret Line=" 124" Column="14" TopLine="107"/>522 <Caret Line="243" Column="1" TopLine="223"/> 545 523 </Position14> 546 524 <Position15> 547 525 <Filename Value="UMainForm.pas"/> 548 <Caret Line="2 06" Column="19" TopLine="203"/>526 <Caret Line="244" Column="1" TopLine="223"/> 549 527 </Position15> 550 528 <Position16> 551 529 <Filename Value="UMainForm.pas"/> 552 <Caret Line=" 117" Column="3" TopLine="115"/>530 <Caret Line="245" Column="1" TopLine="223"/> 553 531 </Position16> 554 532 <Position17> 555 533 <Filename Value="UMainForm.pas"/> 556 <Caret Line="1 18" Column="1" TopLine="113"/>534 <Caret Line="120" Column="1" TopLine="107"/> 557 535 </Position17> 558 536 <Position18> 559 537 <Filename Value="UMainForm.pas"/> 560 <Caret Line="1 19" Column="1" TopLine="113"/>538 <Caret Line="121" Column="1" TopLine="107"/> 561 539 </Position18> 562 540 <Position19> 563 541 <Filename Value="UMainForm.pas"/> 564 <Caret Line=" 242" Column="1" TopLine="223"/>542 <Caret Line="122" Column="1" TopLine="107"/> 565 543 </Position19> 566 544 <Position20> 567 545 <Filename Value="UMainForm.pas"/> 568 <Caret Line=" 243" Column="1" TopLine="223"/>546 <Caret Line="123" Column="1" TopLine="107"/> 569 547 </Position20> 570 548 <Position21> 571 549 <Filename Value="UMainForm.pas"/> 572 <Caret Line=" 244" Column="1" TopLine="223"/>550 <Caret Line="129" Column="37" TopLine="115"/> 573 551 </Position21> 574 552 <Position22> 575 553 <Filename Value="UMainForm.pas"/> 576 <Caret Line=" 245" Column="1" TopLine="223"/>554 <Caret Line="148" Column="3" TopLine="139"/> 577 555 </Position22> 578 556 <Position23> 579 557 <Filename Value="UMainForm.pas"/> 580 <Caret Line="1 20" Column="1" TopLine="107"/>558 <Caret Line="133" Column="32" TopLine="116"/> 581 559 </Position23> 582 560 <Position24> 583 561 <Filename Value="UMainForm.pas"/> 584 <Caret Line="1 21" Column="1" TopLine="107"/>562 <Caret Line="134" Column="32" TopLine="117"/> 585 563 </Position24> 586 564 <Position25> 587 <Filename Value="U MainForm.pas"/>588 <Caret Line="1 22" Column="1" TopLine="107"/>565 <Filename Value="UFastBitmap.pas"/> 566 <Caret Line="16" Column="14" TopLine="9"/> 589 567 </Position25> 590 568 <Position26> 591 <Filename Value="U MainForm.pas"/>592 <Caret Line=" 123" Column="1" TopLine="107"/>569 <Filename Value="UFastBitmap.pas"/> 570 <Caret Line="41" Column="3" TopLine="27"/> 593 571 </Position26> 594 572 <Position27> 595 <Filename Value="U MainForm.pas"/>596 <Caret Line="1 29" Column="37" TopLine="115"/>573 <Filename Value="UFastBitmap.pas"/> 574 <Caret Line="1" Column="1" TopLine="1"/> 597 575 </Position27> 598 576 <Position28> 599 <Filename Value="U MainForm.pas"/>600 <Caret Line=" 148" Column="3" TopLine="139"/>577 <Filename Value="UFastBitmap.pas"/> 578 <Caret Line="25" Column="24" TopLine="3"/> 601 579 </Position28> 602 580 <Position29> 603 <Filename Value="U MainForm.pas"/>604 <Caret Line=" 133" Column="32" TopLine="116"/>581 <Filename Value="UDrawMethod.pas"/> 582 <Caret Line="662" Column="3" TopLine="658"/> 605 583 </Position29> 606 584 <Position30> 607 <Filename Value="U MainForm.pas"/>608 <Caret Line=" 134" Column="32" TopLine="117"/>585 <Filename Value="UFastBitmap.pas"/> 586 <Caret Line="81" Column="4" TopLine="77"/> 609 587 </Position30> 610 588 </JumpHistory> -
GraphicTest/UFastBitmap.pas
r317 r318 9 9 10 10 type 11 TFastBitmapPixel = Integer; 12 PFastBitmapPixel = ^TFastBitmapPixel; 13 14 TFastBitmapPixelComponents = packed record 15 B, G, R, A: Byte; 16 end; 17 18 { TFastBitmap } 11 12 TFastBitmapPixel = Integer; 13 (*TFastBitmapPixel = record 14 Blue: Byte; 15 Green: Byte; 16 Red: Byte; 17 end;*) 18 PFastBitmapPixel = ^TFastBitmapPixel; 19 20 TFastBitmapPixelComponents = packed record 21 B, G, R, A: Byte; 22 end; 23 24 const 25 FastPixelSize = SizeOf(TFastBitmapPixel); 26 27 type 28 { TFastBitmap } 19 29 20 30 TFastBitmap = class … … 166 176 function TFastBitmap.GetPixel(X, Y: Integer): TFastBitmapPixel; 167 177 begin 168 Result := PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * SizeOf(TFastBitmapPixel))^;178 Result := PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * FastPixelSize)^; 169 179 end; 170 180 171 181 procedure TFastBitmap.SetPixel(X, Y: Integer; const AValue: TFastBitmapPixel); 172 182 begin 173 PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * SizeOf(TFastBitmapPixel))^ := AValue;183 PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * FastPixelSize)^ := AValue; 174 184 end; 175 185 … … 178 188 if (FSize.X = AValue.X) and (FSize.Y = AValue.X) then Exit; 179 189 FSize := AValue; 180 FPixelsData := ReAllocMem(FPixelsData, FSize.X * FSize.Y * SizeOf(TFastBitmapPixel));190 FPixelsData := ReAllocMem(FPixelsData, FSize.X * FSize.Y * FastPixelSize); 181 191 end; 182 192 -
GraphicTest/UMainForm.lfm
r317 r318 13 13 LCLVersion = '0.9.31' 14 14 object PageControl1: TPageControl 15 Left = 3 6015 Left = 384 16 16 Height = 401 17 17 Top = 16 18 Width = 3 7218 Width = 348 19 19 ActivePage = TabSheet1 20 20 Anchors = [akTop, akLeft, akRight, akBottom] … … 24 24 Caption = 'TImage' 25 25 ClientHeight = 375 26 ClientWidth = 3 6426 ClientWidth = 340 27 27 object Image1: TImage 28 28 Left = 6 29 29 Height = 307 30 30 Top = 7 31 Width = 3 5431 Width = 330 32 32 Anchors = [akTop, akLeft, akRight, akBottom] 33 33 end … … 53 53 Height = 345 54 54 Top = 8 55 Width = 3 4455 Width = 368 56 56 Anchors = [akTop, akLeft, akBottom] 57 57 Columns = < … … 61 61 end 62 62 item 63 Caption = 'Duration '64 Width = 6063 Caption = 'Duration [ms]' 64 Width = 80 65 65 end 66 66 item -
GraphicTest/UMainForm.pas
r317 r318 88 88 end; 89 89 Bitmap := TBitmap.Create; 90 Bitmap.PixelFormat := pf 24bit;90 Bitmap.PixelFormat := pf32bit; 91 91 Image1.Picture.Bitmap.SetSize(TFastBitmap(Scenes[0]).Size.X, TFastBitmap(Scenes[0]).Size.Y); 92 92 Image1.Picture.Bitmap.PixelFormat := pf32bit; … … 183 183 procedure TMainForm.FormDestroy(Sender: TObject); 184 184 begin 185 ListViewMethods.Clear; 185 186 FreeMem(TextureData, OpenGLControl1.Width * OpenGLControl1.Height); 186 187 DrawMethods.Free; … … 200 201 with TDrawMethod(DrawMethods[Item.Index]) do begin 201 202 Item.Caption := Caption; 203 Item.SubItems.Add(FloatToStr(RoundTo(FrameDuration / OneMillisecond, -3))); 202 204 if FrameDuration > 0 then 203 205 Item.SubItems.Add(FloatToStr(RoundTo(1 / (FrameDuration / OneSecond), -3))) 204 206 else Item.SubItems.Add('0'); 205 Item.SubItems.Add(FloatToStr(RoundTo(FrameDuration / OneMillisecond, -3)) + ' ms');206 207 end; 207 208 end;
Note:
See TracChangeset
for help on using the changeset viewer.