Ignore:
Timestamp:
Apr 9, 2015, 8:55:27 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Initialization of array of draw method classes done in run.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/UMainForm.pas

    r470 r471  
    9191    TestTerminated: Boolean;
    9292    TestTimeout: Real;
     93    DrawMethodClasses: array of TDrawMethodClass;
    9394    procedure GenerateSceneFrames;
    9495    procedure TestMethod(Method: TDrawMethod);
     
    9697    procedure UpdateInterface;
    9798    procedure UpdateFrameSize;
     99    procedure RegisterDrawMethods;
     100    procedure RegisterDrawMethod(MethodClass: TDrawMethodClass);
    98101  public
    99102    FrameSize: TPoint;
     
    117120  UOpenGLPBOMethod, UGraphics32Method;
    118121
    119 const
    120   DrawMethodClasses: array[0..8{$IFDEF opengl}+2{$ENDIF}{$IFDEF gr32}+1{$ENDIF}] of TDrawMethodClass = (
    121     TCanvasPixels, TCanvasPixelsUpdateLock, TLazIntfImageColorsCopy,
    122     TLazIntfImageColorsNoCopy, TBitmapRawImageData, TBitmapRawImageDataPaintBox,
    123     TBitmapRawImageDataMove, TBGRABitmapPaintBox
    124     {$IFDEF gr32}, TGraphics32Method{$ENDIF}
    125     {$IFDEF opengl}, TOpenGLMethod, TOpenGLPBOMethod{$ENDIF}
    126     ,TDummyMethod);
    127 
    128 
    129 
    130122{ TMainForm }
    131123
     
    141133  Randomize;
    142134
     135  RegisterDrawMethods;
    143136  DrawMethods := TObjectList.Create;
    144137  for I := 0 to High(DrawMethodClasses) do begin
     
    400393end;
    401394
     395procedure TMainForm.RegisterDrawMethods;
     396begin
     397  RegisterDrawMethod(TCanvasPixels);
     398  RegisterDrawMethod(TCanvasPixelsUpdateLock);
     399  RegisterDrawMethod(TLazIntfImageColorsCopy);
     400  RegisterDrawMethod(TLazIntfImageColorsNoCopy);
     401  RegisterDrawMethod(TBitmapRawImageData);
     402  RegisterDrawMethod(TBitmapRawImageDataPaintBox);
     403  RegisterDrawMethod(TBitmapRawImageDataMove);
     404  RegisterDrawMethod(TBGRABitmapPaintBox);
     405  {$IFDEF GRAPHICS32}
     406  RegisterDrawMethod(TGraphics32Method);
     407  {$ENDIF}
     408  {$IFDEF OPENGL}
     409  RegisterDrawMethod(TOpenGLMethod);
     410  RegisterDrawMethod(TOpenGLPBOMethod);
     411  {$ENDIF}
     412  RegisterDrawMethod(TDummyMethod);
     413end;
     414
     415procedure TMainForm.RegisterDrawMethod(MethodClass: TDrawMethodClass);
     416begin
     417  SetLength(DrawMethodClasses, Length(DrawMethodClasses) + 1);
     418  DrawMethodClasses[High(DrawMethodClasses)] := MethodClass;
     419end;
     420
    402421end.
    403422
Note: See TracChangeset for help on using the changeset viewer.