Recent

Author Topic: BGRABitmap / BGRAControls and OSX is it working?  (Read 19777 times)

circular

  • Hero Member
  • *****
  • Posts: 4397
    • Personal webpage
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #45 on: August 02, 2016, 02:08:02 pm »
Well the time change here is for non opaque shapes, but the code change is only for opaque.

Yes please try on cocoa.

It seems indeed that the widgetsets handle CreateBitmap quite differently.

Also what happens if you change the function to:
Code: Pascal  [Select][+][-]
  1. procedure DataDrawOpaqueImplementation(ACanvas: TCanvas; Rect: TRect;
  2.   AData: Pointer; ALineOrder: TRawImageLineOrder; AWidth, AHeight: integer);
  3. var
  4.   Temp:      TBitmap;
  5.   RawImage:  TRawImage;
  6.   BitmapHandle, MaskHandle: HBitmap;
  7.   CreateResult: boolean;
  8.   tempShift: byte;
  9. begin
  10.   if (AHeight = 0) or (AWidth = 0) then
  11.     exit;
  12.  
  13.   RawImage.Init;
  14.   RawImage.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth,AHeight);
  15.   RawImage.Description.LineOrder := ALineOrder;
  16.   RawImage.Description.LineEnd := rileDWordBoundary;
  17.   RawImage.Data := PByte(AData);
  18.   RawImage.DataSize:= AWidth*AHeight*sizeof(TBGRAPixel);
  19.   if TBGRAPixel_RGBAOrder then
  20.   begin
  21.     tempShift := RawImage.Description.RedShift;
  22.     RawImage.Description.RedShift := RawImage.Description.BlueShift;
  23.     RawImage.Description.BlueShift := tempShift;
  24.   end;
  25.   CreateResult := RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, False);
  26.  
  27.   if not CreateResult then
  28.     raise FPImageException.Create('Failed to create bitmap handle');
  29.  
  30.   Temp := TBitmap.Create;
  31.   Temp.Handle := BitmapHandle;
  32.   Temp.MaskHandle := MaskHandle;
  33.   ACanvas.StretchDraw(Rect, Temp);
  34.   Temp.Free;
  35. end;      
« Last Edit: August 02, 2016, 02:42:15 pm by circular »
Conscience is the debugger of the mind

Josh

  • Hero Member
  • *****
  • Posts: 1371
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #46 on: August 21, 2016, 08:40:17 pm »
Hi Circular,

Apologies for not getting back sooner; work and other things stopped me from progressing any further until yesterday.

Yesterday morning I created a small app bundle of your speed test to take to where I purchased my 2 identical imac from, as I was noticing other strange behavior and slowness. On running app on their MAC's I was getting better performance than on my old PC; I have left one IMac with them for repair ( tried things like timemachine and Restore to factory and Safe mode still very slow) so they can repair and fix.

So my slowness is not with BGRABITMAP but both my Imac's :(

I have got an old Imac out of the attic 10.6.8 SL; and installed 1.4.4 and bgrabitmap and the speed is on a par with my windows PC. So for the time being I will test with this 12 year old MAC :)

Thanks for persevering.

Josh
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018