Changeset 319 for GraphicTest


Ignore:
Timestamp:
Feb 1, 2012, 3:50:43 PM (13 years ago)
Author:
chronos
Message:
  • Added: In addition to measure frame data conversion, table show real step duration and FPS include Application.ProcessMessage which cause TImage to draw its data to form and show lower FPS for draw methods which use TImage Bitmap as target.
Location:
GraphicTest
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/GraphicTest.lpi

    r318 r319  
    4141        <TopLine Value="1"/>
    4242        <CursorPos X="51" Y="15"/>
    43         <UsageCount Value="59"/>
     43        <UsageCount Value="60"/>
    4444      </Unit0>
    4545      <Unit1>
     
    5252        <EditorIndex Value="0"/>
    5353        <WindowIndex Value="0"/>
    54         <TopLine Value="198"/>
    55         <CursorPos X="79" Y="203"/>
    56         <UsageCount Value="59"/>
     54        <TopLine Value="114"/>
     55        <CursorPos X="12" Y="120"/>
     56        <UsageCount Value="60"/>
    5757        <Loaded Value="True"/>
    5858        <LoadedDesigner Value="True"/>
     
    7171        <TopLine Value="1"/>
    7272        <CursorPos X="1" Y="1"/>
    73         <UsageCount Value="59"/>
     73        <UsageCount Value="60"/>
    7474      </Unit3>
    7575      <Unit4>
     
    161161        <EditorIndex Value="2"/>
    162162        <WindowIndex Value="0"/>
    163         <TopLine Value="658"/>
    164         <CursorPos X="3" Y="662"/>
    165         <UsageCount Value="53"/>
     163        <TopLine Value="691"/>
     164        <CursorPos X="3" Y="710"/>
     165        <UsageCount Value="54"/>
    166166        <Loaded Value="True"/>
    167167      </Unit17>
     
    174174        <TopLine Value="15"/>
    175175        <CursorPos X="19" Y="25"/>
    176         <UsageCount Value="53"/>
     176        <UsageCount Value="54"/>
    177177        <Loaded Value="True"/>
    178178      </Unit18>
     
    455455        <TopLine Value="403"/>
    456456        <CursorPos X="1" Y="416"/>
    457         <UsageCount Value="11"/>
     457        <UsageCount Value="10"/>
    458458      </Unit59>
    459459      <Unit60>
     
    462462        <TopLine Value="90"/>
    463463        <CursorPos X="1" Y="103"/>
    464         <UsageCount Value="11"/>
     464        <UsageCount Value="10"/>
    465465      </Unit60>
    466466    </Units>
    467     <JumpHistory Count="30" HistoryIndex="27">
     467    <JumpHistory Count="29" HistoryIndex="28">
    468468      <Position1>
    469469        <Filename Value="UMainForm.pas"/>
    470         <Caret Line="199" Column="1" TopLine="184"/>
     470        <Caret Line="189" Column="82" TopLine="177"/>
    471471      </Position1>
    472472      <Position2>
    473473        <Filename Value="UMainForm.pas"/>
    474         <Caret Line="156" Column="1" TopLine="143"/>
     474        <Caret Line="144" Column="43" TopLine="136"/>
    475475      </Position2>
    476476      <Position3>
    477477        <Filename Value="UMainForm.pas"/>
    478         <Caret Line="189" Column="82" TopLine="177"/>
     478        <Caret Line="185" Column="20" TopLine="183"/>
    479479      </Position3>
    480480      <Position4>
    481481        <Filename Value="UMainForm.pas"/>
    482         <Caret Line="144" Column="43" TopLine="136"/>
     482        <Caret Line="191" Column="3" TopLine="189"/>
    483483      </Position4>
    484484      <Position5>
    485485        <Filename Value="UMainForm.pas"/>
    486         <Caret Line="185" Column="20" TopLine="183"/>
     486        <Caret Line="236" Column="58" TopLine="215"/>
    487487      </Position5>
    488488      <Position6>
    489489        <Filename Value="UMainForm.pas"/>
    490         <Caret Line="191" Column="3" TopLine="189"/>
     490        <Caret Line="124" Column="14" TopLine="107"/>
    491491      </Position6>
    492492      <Position7>
    493493        <Filename Value="UMainForm.pas"/>
    494         <Caret Line="236" Column="58" TopLine="215"/>
     494        <Caret Line="206" Column="19" TopLine="203"/>
    495495      </Position7>
    496496      <Position8>
    497497        <Filename Value="UMainForm.pas"/>
    498         <Caret Line="124" Column="14" TopLine="107"/>
     498        <Caret Line="117" Column="3" TopLine="115"/>
    499499      </Position8>
    500500      <Position9>
    501501        <Filename Value="UMainForm.pas"/>
    502         <Caret Line="206" Column="19" TopLine="203"/>
     502        <Caret Line="118" Column="1" TopLine="113"/>
    503503      </Position9>
    504504      <Position10>
    505505        <Filename Value="UMainForm.pas"/>
    506         <Caret Line="117" Column="3" TopLine="115"/>
     506        <Caret Line="119" Column="1" TopLine="113"/>
    507507      </Position10>
    508508      <Position11>
    509509        <Filename Value="UMainForm.pas"/>
    510         <Caret Line="118" Column="1" TopLine="113"/>
     510        <Caret Line="242" Column="1" TopLine="223"/>
    511511      </Position11>
    512512      <Position12>
    513513        <Filename Value="UMainForm.pas"/>
    514         <Caret Line="119" Column="1" TopLine="113"/>
     514        <Caret Line="243" Column="1" TopLine="223"/>
    515515      </Position12>
    516516      <Position13>
    517517        <Filename Value="UMainForm.pas"/>
    518         <Caret Line="242" Column="1" TopLine="223"/>
     518        <Caret Line="244" Column="1" TopLine="223"/>
    519519      </Position13>
    520520      <Position14>
    521521        <Filename Value="UMainForm.pas"/>
    522         <Caret Line="243" Column="1" TopLine="223"/>
     522        <Caret Line="245" Column="1" TopLine="223"/>
    523523      </Position14>
    524524      <Position15>
    525525        <Filename Value="UMainForm.pas"/>
    526         <Caret Line="244" Column="1" TopLine="223"/>
     526        <Caret Line="120" Column="1" TopLine="107"/>
    527527      </Position15>
    528528      <Position16>
    529529        <Filename Value="UMainForm.pas"/>
    530         <Caret Line="245" Column="1" TopLine="223"/>
     530        <Caret Line="121" Column="1" TopLine="107"/>
    531531      </Position16>
    532532      <Position17>
    533533        <Filename Value="UMainForm.pas"/>
    534         <Caret Line="120" Column="1" TopLine="107"/>
     534        <Caret Line="122" Column="1" TopLine="107"/>
    535535      </Position17>
    536536      <Position18>
    537537        <Filename Value="UMainForm.pas"/>
    538         <Caret Line="121" Column="1" TopLine="107"/>
     538        <Caret Line="123" Column="1" TopLine="107"/>
    539539      </Position18>
    540540      <Position19>
    541541        <Filename Value="UMainForm.pas"/>
    542         <Caret Line="122" Column="1" TopLine="107"/>
     542        <Caret Line="129" Column="37" TopLine="115"/>
    543543      </Position19>
    544544      <Position20>
    545545        <Filename Value="UMainForm.pas"/>
    546         <Caret Line="123" Column="1" TopLine="107"/>
     546        <Caret Line="148" Column="3" TopLine="139"/>
    547547      </Position20>
    548548      <Position21>
    549549        <Filename Value="UMainForm.pas"/>
    550         <Caret Line="129" Column="37" TopLine="115"/>
     550        <Caret Line="133" Column="32" TopLine="116"/>
    551551      </Position21>
    552552      <Position22>
    553553        <Filename Value="UMainForm.pas"/>
    554         <Caret Line="148" Column="3" TopLine="139"/>
     554        <Caret Line="134" Column="32" TopLine="117"/>
    555555      </Position22>
    556556      <Position23>
    557         <Filename Value="UMainForm.pas"/>
    558         <Caret Line="133" Column="32" TopLine="116"/>
     557        <Filename Value="UFastBitmap.pas"/>
     558        <Caret Line="16" Column="14" TopLine="9"/>
    559559      </Position23>
    560560      <Position24>
    561         <Filename Value="UMainForm.pas"/>
    562         <Caret Line="134" Column="32" TopLine="117"/>
     561        <Filename Value="UFastBitmap.pas"/>
     562        <Caret Line="41" Column="3" TopLine="27"/>
    563563      </Position24>
    564564      <Position25>
    565565        <Filename Value="UFastBitmap.pas"/>
    566         <Caret Line="16" Column="14" TopLine="9"/>
     566        <Caret Line="1" Column="1" TopLine="1"/>
    567567      </Position25>
    568568      <Position26>
    569569        <Filename Value="UFastBitmap.pas"/>
    570         <Caret Line="41" Column="3" TopLine="27"/>
     570        <Caret Line="25" Column="24" TopLine="3"/>
    571571      </Position26>
    572572      <Position27>
    573         <Filename Value="UFastBitmap.pas"/>
    574         <Caret Line="1" Column="1" TopLine="1"/>
     573        <Filename Value="UMainForm.pas"/>
     574        <Caret Line="160" Column="1" TopLine="143"/>
    575575      </Position27>
    576576      <Position28>
    577         <Filename Value="UFastBitmap.pas"/>
    578         <Caret Line="25" Column="24" TopLine="3"/>
     577        <Filename Value="UMainForm.pas"/>
     578        <Caret Line="162" Column="31" TopLine="143"/>
    579579      </Position28>
    580580      <Position29>
    581         <Filename Value="UDrawMethod.pas"/>
    582         <Caret Line="662" Column="3" TopLine="658"/>
     581        <Filename Value="UMainForm.pas"/>
     582        <Caret Line="138" Column="1" TopLine="118"/>
    583583      </Position29>
    584       <Position30>
    585         <Filename Value="UFastBitmap.pas"/>
    586         <Caret Line="81" Column="4" TopLine="77"/>
    587       </Position30>
    588584    </JumpHistory>
    589585  </ProjectOptions>
  • GraphicTest/UDrawMethod.pas

    r317 r319  
    2626    Terminated: Boolean;
    2727    FrameDuration: TDateTime;
     28    StepDuration: TDateTime;
    2829    PaintObject: TPaintObject;
    2930    OpenGLBitmap: Pointer;
  • GraphicTest/UMainForm.lfm

    r318 r319  
    1818    Width = 348
    1919    ActivePage = TabSheet1
    20     Anchors = [akTop, akLeft, akRight, akBottom]
     20    Anchors = [akTop, akRight, akBottom]
    2121    TabIndex = 0
    2222    TabOrder = 0
     
    5454    Top = 8
    5555    Width = 368
    56     Anchors = [akTop, akLeft, akBottom]
     56    Anchors = [akTop, akLeft, akRight, akBottom]
    5757    Columns = <   
    5858      item
     
    6666      item
    6767        Caption = 'FPS'
     68        Width = 75
     69      end   
     70      item
     71        Caption = 'Step duration [ms]'
     72        Width = 80
     73      end   
     74      item
     75        Caption = 'Step FPS'
    6876        Width = 75
    6977      end>
     
    97105  end
    98106  object FloatSpinEdit1: TFloatSpinEdit
    99     Left = 160
     107    Left = 88
    100108    Height = 21
    101109    Top = 392
     
    122130    Height = 14
    123131    Top = 395
    124     Width = 137
     132    Width = 70
    125133    Anchors = [akLeft, akBottom]
    126     Caption = 'Single method test duration:'
     134    Caption = 'Step duration:'
    127135    ParentColor = False
    128136  end
    129137  object Label2: TLabel
    130     Left = 224
     138    Left = 152
    131139    Height = 14
    132140    Top = 395
  • GraphicTest/UMainForm.pas

    r318 r319  
    117117
    118118procedure TMainForm.ButtonSingleTestClick(Sender: TObject);
     119var
     120  StepStartTime: TDateTime;
    119121begin
    120122  try
     
    129131      Application.ProcessMessages;
    130132      repeat
     133        StepStartTime := NowPrecise;
    131134        DrawFrameTiming(TFastBitmap(Scenes[SceneIndex]));
    132135        SceneIndex := (SceneIndex + 1) mod Scenes.Count;
    133136        Application.ProcessMessages;
     137        StepDuration := NowPrecise - StepStartTime;
    134138      until not SingleTestActive;
    135139    end;
     
    146150  C: Integer;
    147151  StartTime: TDateTime;
     152  StepStartTime: TDateTime;
    148153begin
    149154  try
     
    158163      StartTime := NowPrecise;
    159164      repeat
     165        StepStartTime := NowPrecise;
    160166        DrawFrameTiming(TFastBitmap(Scenes[SceneIndex]));
    161167        SceneIndex := (SceneIndex + 1) mod Scenes.Count;
    162168        Application.ProcessMessages;
     169        StepDuration := NowPrecise - StepStartTime;
    163170      until ((NowPrecise - StartTime) > OneSecond * FloatSpinEdit1.Value) or not AllTestActive;
    164171    end;
     
    204211    if FrameDuration > 0 then
    205212      Item.SubItems.Add(FloatToStr(RoundTo(1 / (FrameDuration / OneSecond), -3)))
     213      else Item.SubItems.Add('0');
     214    Item.SubItems.Add(FloatToStr(RoundTo(StepDuration / OneMillisecond, -3)));
     215    if FrameDuration > 0 then
     216      Item.SubItems.Add(FloatToStr(RoundTo(1 / (StepDuration / OneSecond), -3)))
    206217      else Item.SubItems.Add('0');
    207218  end;
Note: See TracChangeset for help on using the changeset viewer.