Recent

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

Josh

  • Hero Member
  • *****
  • Posts: 1274
BGRABitmap / BGRAControls and OSX is it working?
« on: July 29, 2016, 09:23:11 pm »
Hi
I have been getting all kinds of errors and slow response on OSX using BGRAControls on OSX
mavericks, laz 1.6 Official Release. One patch to correct the modal messages not displaying on top.

If I create a new carbon based project then add just a TBCButton.
Then compile and run from Finder the Executable, to see any errors generated I get the following messages, and the app is very slow, if I move the mouse over the tbcbutton then I get  a square blob dragging over it and the app slows right down to crawl. CPU usage jumps up to 40+%

Can any body else replicate this on OSX, and if so does any one know of a fix.

Thanks in advance.
Last login: Fri Jul 29 20:08:16 on ttys002
joshs-mac-Pro:~ josh$ /MyProjects_and_components/My_Projects/vl3_editor/test_mac_error_ideas ; exit;
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 32 bits/pixel; 3-component color space; kCGImageAlphaLast; 344 bytes/row.
Unable to create Canvas Handle for Bitmap. Format "3" is not supported!
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetShouldAntialias: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetShouldAntialias: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:31 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 32 bits/pixel; 3-component color space; kCGImageAlphaLast; 344 bytes/row.
Unable to create Canvas Handle for Bitmap. Format "3" is not supported!
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetShouldAntialias: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetShouldAntialias: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:32 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 32 bits/pixel; 3-component color space; kCGImageAlphaLast; 492 bytes/row.
Unable to create Canvas Handle for Bitmap. Format "3" is not supported!
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetShouldAntialias: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Jul 29 20:10:33 joshs-mac-Pro.local test_mac_error_ideas[678] <Error>: CGContextSetShouldAntialias: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
« Last Edit: July 29, 2016, 10:32:02 pm by josh »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: BGRBmap and OSX is it working?
« Reply #1 on: July 29, 2016, 09:56:56 pm »
I've never used those controls and know nothing about them, but it's possible they were never tested on OS X. Do you have a specific OS X reference for them that says they work on OS X?




Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: BGRABitmap and OSX is it working?
« Reply #2 on: July 29, 2016, 10:29:21 pm »
Hi
I have not checked for any specific reference to confirm or deny if they are OSX compatible, in object explorer the OSX icon is listed so am assuming that they should work.

Begs the question are they compatible?; if not then maybe it would help others too if they would not compile on OSX and also mention it in the readme and download page; what OS's they are compatible with; so users can decide whether to use or not use if developing a cross platform application.

Not tying to sound negative as I like these contrls and library as they work exceptionally well in windows

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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #3 on: July 29, 2016, 10:38:55 pm »
Is this what you're using? 2nd sentence says doesn't work with Mac.

http://wiki.lazarus.freepascal.org/BGRABitmap


Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #4 on: July 29, 2016, 10:53:55 pm »
Hi
I have not checked that page for a while; it does not mention which version though is the new version; I have gone back 2 releases and still getting the same problem.

Is it possible that page is out of date as it does not mention some of the features like opengl that has been in for a while.

Maybe it's not compatible at all now....  :(



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

Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #5 on: July 30, 2016, 07:13:51 pm »
Just an update.

I have gone back to 8.5.2 of BGRABITMAP, this does indeed help; but is still not working properly.

The controls do show the background colour, and the mouse roll-over effect is working without the 'square blobby' effect present on new ones.

The application is much much slower on OSX than on windows; to a point where it is unusable when the form contains a multitude of panels, bcbuttons and bgrashape components.

Also another issue not sure if it is related to bgrabitmap,bgracontrols or Lazarus. Lazarus would not open my application would give access violation, division by zero errors ( this is when opening the application in the IDE). Not compiling or Running it.
So I opened it in Windows, modified the project so that no form were displayed when project opened, When I transferred to OSX, changed project options for OSX and saved, still ok; When I opened a source file, and then display form I then got Divisiion by Zero error, chose ok, then I get Access Violoation error, choose ok and Lazarus crahses and exit.

It would appear that this problem arises when the the form is being rendered throughout bgrabitmap.

If anyone is successfully using BGRABITMAP and BGRAControls extensively on OSX, would you be kind enough to share your configuration versions and any patches that you may have applied.

Thanks in advance.

Josh

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

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #6 on: July 31, 2016, 12:02:46 am »
I use the lasted version from svn on linux, windows, osx (and raspberry pi), I use only some components, but if you can help you can serve only apply a patch.

http://forum.lazarus.freepascal.org/index.php/topic,29064.msg184239.html#msg184239


TBCLabel, TBCButtonFocus, TBGRAFlashProgressbar
« Last Edit: July 31, 2016, 12:05:07 am by esvignolo »

Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #7 on: July 31, 2016, 09:26:36 am »
Hi
Thanks for replying,

Nice Layout.

On OSX when I use latest 9.1 or any version after 8.5.2 I get many errors even after commenting out the darwin section in the inc file.

My target is for carbon. Are you also developing on carbon 32bit; or are you using Cocoa 64Bit?

If I just place a TBCbutton on a form, and then run the executable; not the package in Finder I get many errors, even moving the mouse over the button to get the 'roll-over effect I can see it repainting and app CPU usage jumps dramatically.

One of my application create 100's if not 1000's of tbcbutton's when it starts and the list of errors goes on and on.

Do you also notice a square blobby effect around the mouse currsor when navigate around controls.


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

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #8 on: July 31, 2016, 02:10:45 pm »
Hello josh,

I am trying to optimise font rendering in BGRABitmap. That may help in the case you're talking about.

For MacOSX, I would need a screenshot of the following program run. It is an application with one form and the OnPaint handler is:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormPaint(Sender: TObject);
  2. var bmp: TBitmap;
  3. begin
  4.   bmp := TBitmap.Create;
  5.   bmp.Width  := ClientWidth;
  6.   bmp.Height := ClientHeight;
  7.   with bmp.Canvas do
  8.   begin
  9.     Brush.Color := clBlack;
  10.     FillRect(0,0,bmp.Width,bmp.Height);
  11.     Brush.Style := bsClear;
  12.     Font.Height := 50;
  13.     Font.Color := clWhite;
  14.     Font.Quality := fqNonAntialiased;
  15.     TextOut(0,0,'fqNonAnti.');
  16.     Font.Quality := fqDraft;
  17.     TextOut(0,80,'fqDraft');
  18.     Font.Quality := fqProof;
  19.     TextOut(0,160,'fqProof');
  20.     Font.Quality := fqAntialiased;
  21.     TextOut(bmp.Width div 2,0,'fqAntialiased');
  22.     Font.Quality := fqCleartype;
  23.     TextOut(bmp.Width div 2,80,'fqCleartype');
  24.     Font.Quality := fqCleartypeNatural;
  25.     TextOut(bmp.Width div 2,160,'fqCtNatural');
  26.   end;
  27.   Canvas.Draw(0,0,bmp);
  28.   bmp.Free;
  29. end;  

As you have OSX, can you make this screenshot for me?
Conscience is the debugger of the mind

Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #9 on: July 31, 2016, 03:47:46 pm »
Hi Circular,

I hope the screen shot below helps

I am using laz 1.4.4 (2.6.4)at the moment, as this seems more stable than 1.6 and trunk.

If you want me to use a later version maybe trunk with 3.1.1 support let me know; and I will install on another mac just for testing purposes. This also is using latest mavs, but is a clean install and does not have lazarus on it.


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

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #10 on: July 31, 2016, 05:02:28 pm »
Thanks. Ok so antialiasing is fine, so drawing regular text can be optimised.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #11 on: July 31, 2016, 05:42:12 pm »
Hi josh!

I have put on Git some fix for MacOS for text rendering. Does the text look antialiased? And does it work while keeping RGBA order for pixels (the {$DEFINE BGRABITMAP_RGBAPIXEL} in bgrapixel.inc)?
Conscience is the debugger of the mind

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #12 on: July 31, 2016, 06:38:29 pm »
Hi Josh, i think maybe u problem is the FPC version, I use the trunk.

Hi Circular (thanks for u great work), i delete and download from svn the lasted code, and i can test for u too.

Without the patch:

In the file 'bgrapixel.inc' the following:
(*
  {$IFDEF DARWIN}
  {$DEFINE BGRABITMAP_RGBAPIXEL}
  {$ENDIF}
*)


And can confirm the lasted version still have the problem not show text, see te attach the same application i upload a screenshot a post erlier.


I use the FPC trunk.



Hi
Thanks for replying,

Nice Layout.

On OSX when I use latest 9.1 or any version after 8.5.2 I get many errors even after commenting out the darwin section in the inc file.

My target is for carbon. Are you also developing on carbon 32bit; or are you using Cocoa 64Bit?

If I just place a TBCbutton on a form, and then run the executable; not the package in Finder I get many errors, even moving the mouse over the button to get the 'roll-over effect I can see it repainting and app CPU usage jumps dramatically.

One of my application create 100's if not 1000's of tbcbutton's when it starts and the list of errors goes on and on.

Do you also notice a square blobby effect around the mouse currsor when navigate around controls.
« Last Edit: July 31, 2016, 06:41:44 pm by esvignolo »

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #13 on: July 31, 2016, 06:47:47 pm »
Hi!

Thanks for your answer esvignolo.

The code is not on SVN but on Git. Ok, let me update SVN as well. Done.

Just update BGRAText.pas and try again please

 8-)
Conscience is the debugger of the mind

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: BGRABitmap / BGRAControls and OSX is it working?
« Reply #14 on: July 31, 2016, 06:55:38 pm »
Circular, i update from github and i have this problem:
(when u drop a bgracontrol on the form) or (when u open a project using a bgracontrols)

If is easier for testing for u, u can push in github and i can test it.

« Last Edit: July 31, 2016, 06:57:32 pm by esvignolo »

 

TinyPortal © 2005-2018