Recent

Author Topic: (SOLVED) Advice of error in BGRABitmap on OSx  (Read 7837 times)

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
(SOLVED) Advice of error in BGRABitmap on OSx
« on: September 07, 2016, 09:54:00 pm »
Hi @Lainz/@Circular, i've noticed that since the last version (or perhaps two versions back) on OSX I have an error message on the console. This message comes when mouse over a TBCButton. The message is:

<Error>: CGBitmapContextCreate: unsupported parameter combination: set CGBITMAP_CONTEXT_LOG_ERRORS environmental variable to see the details
Unable to create Canvas Handle for Bitmap. Format "3" is not supported!
<Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextSetInterpolationQuality: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextSetShouldAntialias: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextSetInterpolationQuality: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextSetShouldAntialias: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Do you know if is a relevant problem?
« Last Edit: September 21, 2016, 12:53:33 am by esvignolo »

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Advice of error in BGRAControls on OSx
« Reply #1 on: September 07, 2016, 10:03:53 pm »
The call to CGContextSetShouldAntialias is probably originating in the Carbon widgetset, passing a value of 0 it looks like as the graphics context. This could be a bug in the Carbon widgetset. I assume you're using Laz 1.6? Maybe try trunk and see if any changes to Carbon widgetset?

https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGContext/index.html#//apple_ref/c/func/CGContextSetShouldAntialias


esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: Advice of error in BGRAControls on OSx
« Reply #2 on: September 07, 2016, 10:35:19 pm »
The call to CGContextSetShouldAntialias is probably originating in the Carbon widgetset, passing a value of 0 it looks like as the graphics context. This could be a bug in the Carbon widgetset. I assume you're using Laz 1.6? Maybe try trunk and see if any changes to Carbon widgetset?

https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGContext/index.html#//apple_ref/c/func/CGContextSetShouldAntialias

I Phil! I use the trunk (synced a month ago), this messages come after the releases of the bgracontrols (or bgrabitmap)

I will put in the first post, more details.

Thanks!!!

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Advice of error in BGRAControls on OSx
« Reply #3 on: September 07, 2016, 10:42:09 pm »
The Carbon widgetset calls that function in several places. It might be that changes to bgracontrols just revealted the bug.

I don't know bgracontrols, but normally LCL controls work at a higher level than the widgetset interface code and wouldn't be passing the graphics context directly, since in this case that's specific to Carbon.


lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Advice of error in BGRAControls on OSx
« Reply #4 on: September 07, 2016, 11:31:13 pm »
Bcbutton code is old you are sure? Please try different versions and tell me from wich exactly.

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: Advice of error in BGRAControls on OSx
« Reply #5 on: September 11, 2016, 01:30:43 am »
Hi! sorry for the delay, the problem isn't in bgracontrols is in bgrabitmap. I rollback commits (brabitmap) until the first commit on github, but the problem still there.
The problem solved when i comment the lines:

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

After comment this in bgrapixel.inc the fonts in the buttons are ugly, but the message (i put it in the first post) don' appears.

I hope this can help.

Regards!

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Advice of error in BGRAControls on OSx
« Reply #6 on: September 11, 2016, 03:45:04 am »
Change the thread name (in the first post) so circular can see it and see if this has any kind of solution.

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: (SOLVED) Advice of error in BGRABitmap on OSx
« Reply #7 on: September 21, 2016, 12:54:24 am »
Hi @Lainz/@Circular
I add -dBGRABITMAP_BGRAPIXEL to package and problem is solved.
NO more messages in the console.

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: (SOLVED) Advice of error in BGRABitmap on OSx
« Reply #8 on: September 21, 2016, 03:37:45 am »
Hi @Lainz/@Circular
I add -dBGRABITMAP_BGRAPIXEL to package and problem is solved.
NO more messages in the console.

Thanks for showing how to solve it. I've readed this was the solution from other user in other thread too.

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: (SOLVED) Advice of error in BGRABitmap on OSx
« Reply #9 on: September 21, 2016, 03:49:04 am »
Thank you for these components. Thanks to them my application is more beautiful. (At least it seems to me).
As you can see in the attachment.

Thanks again!

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: (SOLVED) Advice of error in BGRABitmap on OSx
« Reply #10 on: September 21, 2016, 04:25:16 am »
Thank you for these components. Thanks to them my application is more beautiful. (At least it seems to me).
As you can see in the attachment.

Thanks again!

Que bueno quedó!

Son ricas las pepas Trio :) Son de acá de Argentina.

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: (SOLVED) Advice of error in BGRABitmap on OSx
« Reply #11 on: September 21, 2016, 04:28:11 am »
Gracias!!! Muy buenas las pepas, ricas y llenadoras :p jajaj.

Abrazo grande! y gracias por los bgracontrols :)
« Last Edit: September 21, 2016, 04:33:42 am by esvignolo »

 

TinyPortal © 2005-2018