Changeset 453


Ignore:
Timestamp:
Nov 25, 2012, 5:04:36 PM (12 years ago)
Author:
chronos
Message:
  • Added: Export results to text file in mediawiki format.
Location:
GraphicTest
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/GraphicTest.lpi

    r452 r453  
    6666      </local>
    6767    </RunParams>
    68     <RequiredPackages Count="4">
     68    <RequiredPackages Count="5">
    6969      <Item1>
     70        <PackageName Value="lazopenglcontext"/>
     71      </Item1>
     72      <Item2>
    7073        <PackageName Value="BGRABitmapPack"/>
    7174        <DefaultFilename Value="Packages/bgrabitmap/bgrabitmappack.lpk" Prefer="True"/>
    72       </Item1>
    73       <Item2>
     75      </Item2>
     76      <Item3>
    7477        <PackageName Value="GR32_L"/>
    7578        <DefaultFilename Value="Packages/Graphics32/Packages/GR32_L.lpk" Prefer="True"/>
    76       </Item2>
    77       <Item3>
    78         <PackageName Value="SynEdit"/>
    7979      </Item3>
    8080      <Item4>
     81        <PackageName Value="SynEdit"/>
     82      </Item4>
     83      <Item5>
    8184        <PackageName Value="LCL"/>
    82       </Item4>
     85      </Item5>
    8386    </RequiredPackages>
    8487    <Units Count="18">
     
    205208        <StackChecks Value="True"/>
    206209      </Checks>
    207       <VerifyObjMethodCallValidity Value="True"/>
    208210    </CodeGeneration>
    209211    <Linking>
     
    221223        <UseMsgFile Value="True"/>
    222224      </CompilerMessages>
     225      <CustomOptions Value="-dopengl"/>
    223226      <CompilerPath Value="$(CompPath)"/>
    224227    </Other>
  • GraphicTest/GraphicTest.lpr

    r452 r453  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UMainForm, UPlatform, UDrawMethod, UFastBitmap, UDrawForm,
    11   bgrabitmappack, GR32_L, UCanvasPixels, UCanvasPixelsUpdateLock,
     10  Forms, lazopenglcontext, UMainForm, UPlatform, UDrawMethod, UFastBitmap,
     11  UDrawForm, bgrabitmappack, GR32_L, UCanvasPixels, UCanvasPixelsUpdateLock,
    1212  ULazIntfImageColorsCopy, ULazIntfImageColorsNoCopy, UBGRABitmapPaintBox,
    1313  UBitmapRawImageDataPaintBox, UBitmapRawImageData, UDummyMethod,
  • GraphicTest/UDrawMethod.pas

    r451 r453  
    113113  Image.SetBounds(0, 0, Size.X, Size.Y);
    114114  Image.Picture.Bitmap.SetSize(Size.X, Size.Y);
    115   Image.Picture.Bitmap.PixelFormat := pf32bit;
     115  Image.Picture.Bitmap.PixelFormat := pf24bit;
    116116  Image.Show;
    117117end;
  • GraphicTest/UMainForm.lfm

    r452 r453  
    11object MainForm: TMainForm
    22  Left = 165
    3   Height = 411
     3  Height = 444
    44  Top = 117
    55  Width = 857
    66  Caption = 'Graphic test'
    7   ClientHeight = 411
     7  ClientHeight = 425
    88  ClientWidth = 857
     9  Menu = MainMenu1
    910  OnClose = FormClose
    1011  OnCreate = FormCreate
     
    1415  object PageControl1: TPageControl
    1516    Left = 459
    16     Height = 411
     17    Height = 425
    1718    Top = 0
    1819    Width = 398
     
    2324    object TabSheet1: TTabSheet
    2425      Caption = 'Description'
    25       ClientHeight = 386
    26       ClientWidth = 394
     26      ClientHeight = 388
     27      ClientWidth = 390
    2728      object Memo1: TMemo
    2829        Left = 0
    29         Height = 386
     30        Height = 388
    3031        Top = 0
    31         Width = 394
     32        Width = 390
    3233        Align = alClient
    3334        ReadOnly = True
     
    3839    object TabSheet2: TTabSheet
    3940      Caption = 'Code'
    40       ClientHeight = 386
    41       ClientWidth = 394
     41      ClientHeight = 388
     42      ClientWidth = 390
    4243      inline SynMemo1: TSynMemo
    4344        Cursor = crIBeam
     
    524525  object Panel1: TPanel
    525526    Left = 0
    526     Height = 411
     527    Height = 425
    527528    Top = 0
    528529    Width = 454
    529530    Align = alClient
    530531    BevelOuter = bvNone
    531     ClientHeight = 411
     532    ClientHeight = 425
    532533    ClientWidth = 454
    533534    TabOrder = 1
    534535    object ListViewMethods: TListView
    535536      Left = 9
    536       Height = 335
     537      Height = 349
    537538      Top = 8
    538539      Width = 443
     
    578579      Left = 8
    579580      Height = 25
    580       Top = 350
     581      Top = 364
    581582      Width = 115
    582583      Anchors = [akLeft, akBottom]
     
    588589      Left = 136
    589590      Height = 25
    590       Top = 350
     591      Top = 364
    591592      Width = 112
    592593      Anchors = [akLeft, akBottom]
     
    597598    object FloatSpinEdit1: TFloatSpinEdit
    598599      Left = 88
    599       Height = 25
    600       Top = 378
     600      Height = 23
     601      Top = 394
    601602      Width = 58
    602603      Anchors = [akLeft, akBottom]
     
    610611      Left = 256
    611612      Height = 25
    612       Top = 350
     613      Top = 364
    613614      Width = 75
    614615      Anchors = [akLeft, akBottom]
     
    620621      Left = 8
    621622      Height = 15
    622       Top = 384
    623       Width = 80
     623      Top = 398
     624      Width = 78
    624625      Anchors = [akLeft, akBottom]
    625626      Caption = 'Step duration:'
     
    629630      Left = 152
    630631      Height = 15
    631       Top = 384
    632       Width = 6
     632      Top = 398
     633      Width = 5
    633634      Anchors = [akLeft, akBottom]
    634635      Caption = 's'
     
    637638    object SpinEditWidth: TSpinEdit
    638639      Left = 204
    639       Height = 25
    640       Top = 378
     640      Height = 23
     641      Top = 394
    641642      Width = 58
    642643      Anchors = [akLeft, akBottom]
     
    648649    object SpinEditHeight: TSpinEdit
    649650      Left = 273
    650       Height = 25
    651       Top = 378
     651      Height = 23
     652      Top = 394
    652653      Width = 58
    653654      Anchors = [akLeft, akBottom]
     
    660661      Left = 169
    661662      Height = 15
    662       Top = 385
     663      Top = 399
    663664      Width = 25
    664665      Anchors = [akLeft, akBottom]
     
    669670      Left = 265
    670671      Height = 15
    671       Top = 384
     672      Top = 398
    672673      Width = 6
    673674      Anchors = [akLeft, akBottom]
     
    677678    object CheckBoxDoubleBuffered: TCheckBox
    678679      Left = 336
    679       Height = 21
    680       Top = 346
    681       Width = 116
     680      Height = 24
     681      Top = 357
     682      Width = 118
    682683      Anchors = [akLeft, akBottom]
    683684      Caption = 'Double buffered'
     
    687688    object CheckBoxEraseBackground: TCheckBox
    688689      Left = 336
    689       Height = 21
    690       Top = 363
     690      Height = 24
     691      Top = 374
    691692      Width = 124
    692693      Anchors = [akLeft, akBottom]
     
    697698    object CheckBox1: TCheckBox
    698699      Left = 336
    699       Height = 21
    700       Top = 383
    701       Width = 67
     700      Height = 24
     701      Top = 394
     702      Width = 69
    702703      Anchors = [akLeft, akBottom]
    703704      Caption = 'Opaque'
     
    708709  object Splitter1: TSplitter
    709710    Left = 454
    710     Height = 411
     711    Height = 425
    711712    Top = 0
    712713    Width = 5
     
    738739    top = 164
    739740  end
     741  object ActionList1: TActionList
     742    left = 104
     743    top = 168
     744    object AExportAsWikiText: TAction
     745      Caption = 'Export as Wiki text'
     746      Hint = 'Export as Wiki text'
     747      OnExecute = AExportAsWikiTextExecute
     748    end
     749    object Action1: TAction
     750      Caption = 'Action1'
     751    end
     752    object FileExit1: TFileExit
     753      Category = 'File'
     754      Caption = '&Exit'
     755      Hint = 'Exit'
     756      ShortCut = 32883
     757    end
     758  end
     759  object MainMenu1: TMainMenu
     760    left = 160
     761    top = 80
     762    object MenuItem1: TMenuItem
     763      Caption = 'General'
     764      object MenuItem2: TMenuItem
     765        Action = AExportAsWikiText
     766      end
     767      object MenuItem3: TMenuItem
     768        Action = FileExit1
     769      end
     770    end
     771  end
     772  object SaveDialog1: TSaveDialog
     773    DefaultExt = '.txt'
     774    left = 308
     775    top = 76
     776  end
    740777end
  • GraphicTest/UMainForm.pas

    r451 r453  
    99  Graphics, Dialogs, ComCtrls, ExtCtrls, StdCtrls, DateUtils, UPlatform,
    1010  LCLType, IntfGraphics, fpImage, Math, GraphType, Contnrs, LclIntf, Spin,
    11   UFastBitmap, UDrawMethod;
     11  ActnList, Menus, StdActns, UFastBitmap, UDrawMethod;
    1212
    1313const
     
    1919
    2020  TMainForm = class(TForm)
     21    Action1: TAction;
     22    AExportAsWikiText: TAction;
     23    ActionList1: TActionList;
    2124    ButtonBenchmark: TButton;
    2225    ButtonSingleTest: TButton;
     
    2528    CheckBoxDoubleBuffered: TCheckBox;
    2629    CheckBoxEraseBackground: TCheckBox;
     30    FileExit1: TFileExit;
    2731    FloatSpinEdit1: TFloatSpinEdit;
    2832    Label1: TLabel;
     
    3135    Label4: TLabel;
    3236    ListViewMethods: TListView;
     37    MainMenu1: TMainMenu;
    3338    Memo1: TMemo;
     39    MenuItem1: TMenuItem;
     40    MenuItem2: TMenuItem;
     41    MenuItem3: TMenuItem;
    3442    PageControl1: TPageControl;
    3543    Panel1: TPanel;
     44    SaveDialog1: TSaveDialog;
    3645    SpinEditHeight: TSpinEdit;
    3746    SpinEditWidth: TSpinEdit;
     
    4251    TabSheet2: TTabSheet;
    4352    TimerUpdateList: TTimer;
     53    procedure AExportAsWikiTextExecute(Sender: TObject);
    4454    procedure ButtonBenchmarkClick(Sender: TObject);
    4555    procedure ButtonSingleTestClick(Sender: TObject);
     
    187197end;
    188198
     199procedure TMainForm.AExportAsWikiTextExecute(Sender: TObject);
     200var
     201  Output: TStringList;
     202  I: Integer;
     203  Duration: Real;
     204begin
     205  SaveDialog1.FileName := 'GraphicsTest results.txt';
     206  if SaveDialog1.Execute then
     207  try
     208    Output := TStringList.Create;
     209    Output.Add('{| class="wikitable sortable"');
     210    Output.Add('|-');
     211    Output.Add('! Method !! FPS !! Frame duration [ms]');
     212    for I := 0 to DrawMethods.Count - 1 do
     213    with TDrawMethod(DrawMethods[I]) do begin
     214      Output.Add('|-');
     215      if FPS <> 0 then Duration := 1 / FPS * 1000
     216        else Duration := 0;
     217      Output.Add('|' + Caption + ' || ' + FloatToStr(RoundTo(FPS, -1)) +
     218        ' || ' + FloatToStr(RoundTo(Duration, -1)));
     219    end;
     220    Output.Add('|}');
     221    Output.SaveToFile(SaveDialog1.FileName);
     222  finally
     223    Output.Free;
     224  end;
     225end;
     226
    189227procedure TMainForm.ButtonStopClick(Sender: TObject);
    190228begin
Note: See TracChangeset for help on using the changeset viewer.