MantisBT - Community
View Issue Details
0026128Community[OCCT] OCCT:Visualizationpublic2015-04-23 10:272015-05-14 16:37
solomin_s 
bugmaster 
normaltrivial 
closedfixed 
LinixUbuntu14.04
[OCCT] 6.5.3 
[OCCT] 6.9.0[OCCT] 6.9.0 
Not needed
0026128: Visualization, TKOpenGl - fix misprint in external GLX context initialization
OpenGl_Window initalization failed when external opengl context pass to V3d_View.
XGetVisualInfo return valid XVisualInfo object for correct Display, but in case of external opengl context Aspect_GraphicDeviceDefinitionError is raised.
In this case XVisualInfo configuration shoold be checked and exception should be raised if XVisualInfo has no needed configuration.
Handle_V3d_View aView = anAISContext->CurrentViewer()->CreateView();
aView->SetWindow(aWindow, theContext, nullptr, nullptr);
No tags attached.
related to 0022819closed bugmaster Open CASCADE Redesign of OpenGl driver 
Issue History
2015-04-23 10:27solomin_sNew Issue
2015-04-23 10:27solomin_sAssigned To => kgv
2015-04-23 10:31gitNote Added: 0040152
2015-04-27 19:25kgvTarget Version6.9.0 => 7.1.0
2015-04-27 21:27solomin_sStatusnew => resolved
2015-04-28 11:43kgvNote Added: 0040319
2015-04-28 11:43kgvAssigned Tokgv => solomin_s
2015-04-28 11:43kgvStatusresolved => feedback
2015-04-28 11:43kgvNote Edited: 0040319bug_revision_view_page.php?bugnote_id=40319#r10237
2015-04-28 11:55solomin_sNote Added: 0040320
2015-04-28 11:55solomin_sAssigned Tosolomin_s => kgv
2015-04-28 11:56solomin_sNote Edited: 0040320bug_revision_view_page.php?bugnote_id=40320#r10241
2015-04-28 11:56solomin_sNote Edited: 0040320bug_revision_view_page.php?bugnote_id=40320#r10242
2015-04-28 12:11kgvNote Added: 0040327
2015-04-28 12:11kgvAssigned Tokgv => solomin_s
2015-04-28 12:11kgvSummaryIncorrect OpenGl_Window intialization with external OpenGl context on Linux => Visualization, TKOpenGl - fix misprint in external GLX context management
2015-04-28 12:12kgvSummaryVisualization, TKOpenGl - fix misprint in external GLX context management => Visualization, TKOpenGl - fix misprint in external GLX context initialization
2015-04-28 12:13kgvNote Edited: 0040327bug_revision_view_page.php?bugnote_id=40327#r10244
2015-04-28 12:44gitNote Added: 0040331
2015-04-28 12:49gitNote Added: 0040333
2015-04-28 12:50kgvNote Added: 0040334
2015-04-28 12:50kgvAssigned Tosolomin_s => san
2015-04-28 12:50kgvSeverityminor => trivial
2015-04-28 12:50kgvStatusfeedback => resolved
2015-04-28 12:50kgvTarget Version7.1.0 => 6.9.0
2015-04-28 12:59kgvProduct Version6.9.0 => 6.5.3
2015-04-28 12:59kgvRelationship addedrelated to 0022819
2015-04-28 13:02solomin_sNote Added: 0040338
2015-04-29 12:41sanNote Added: 0040409
2015-04-29 12:41sanAssigned Tosan => bugmaster
2015-04-29 12:41sanStatusresolved => reviewed
2015-04-29 14:45apvAssigned Tobugmaster => apv
2015-04-29 20:28gitNote Added: 0040445
2015-05-05 16:44apvTest case number => Not needed
2015-05-05 16:46apvNote Added: 0040565
2015-05-05 16:46apvAssigned Toapv => bugmaster
2015-05-05 16:46apvStatusreviewed => tested
2015-05-07 11:18bugmasterChangeset attached => occt master 95db72f1
2015-05-07 11:18bugmasterStatustested => verified
2015-05-07 11:18bugmasterResolutionopen => fixed
2015-05-14 15:28aivStatusverified => closed
2015-05-14 15:30aivFixed in Version => 6.9.0
2015-05-14 16:37gitNote Added: 0041105
2015-05-14 16:37gitNote Added: 0041106

Notes
(0040152)
git   
2015-04-23 10:31   
Branch CR26128 has been created by solomin_s.

SHA-1: 6ef92a25a6544c38fdc0fb32098a3aed842e45b1


Detailed log of new commits:

Author: Sergey Solomin
Date: Thu Apr 23 10:29:54 2015 +0300

    0026128: Incorrect OpenGl_Window intialization with external OpenGl context on Linux
(0040319)
kgv   
2015-04-28 11:43   
Could you please elaborate how this patch helps anyhow?

As far as I can see it just raises exception in one more scenario - when external context has no depth/stencil buffers and something like this.
Or I have missed something in the patch?

(0040320)
solomin_s   
2015-04-28 11:55   
(edited on: 2015-04-28 11:56)
Previous code has bug: exception will be raised if XGetVisualInfo returned correct XVisualInfo.

More:
aVis = XGetVisualInfo (aDisp, aVisInfoMask, &aVisInfo, &aNbItems); //<- return correct VisualInfo (not NULL)
if (!myOwnGContext)
{
  if (aVis != NULL) // <- for external context is true, because aVis is not NULL
  {
    Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window::CreateWindow: XGetVisualInfo failed."); // <- exception raise, so viewer cannot be initialized
    return;
  }
   aWindow = aParent;
}

I suppose aVis should be check to have needed configuration, and exception should be raised if aVis is NULL or unsupported by occt.
My changes fix it.

(0040327)
kgv   
2015-04-28 12:11   
(edited on: 2015-04-28 12:13)
  if (aVis != NULL) // <- for external context is true, because aVis is not NULL

oh, I see it now - there is misprint in condition ;).

> I suppose aVis should be check to have needed configuration,
> and exception should be raised if aVis is NULL or unsupported by occt.
this would be different for alien context, because these extra checks are not intended to prevent creation of the view, but to apply extra workaround in this case - create a subwindow with more reliable Visual.

But this workaround will not be applied for alien context and would just prevent creation of the view in case when it might be (partially) functional (e.g. it will not be a complete disaster if window would not have stencil buffer) - warning message would be more reliable in this context. So I believe that this change should be withdrawn from the patch.

(0040331)
git   
2015-04-28 12:44   
Branch CR26128 has been updated by kgv.

SHA-1: 2f33c2350abea67971d020bc1f2f85d40262ed5d


Detailed log of new commits:

Author: kgv
Date: Tue Apr 28 12:43:55 2015 +0300

    OpenGl_Window, GLX - push warning about missing caps in window Visual

(0040333)
git   
2015-04-28 12:49   
Branch CR26128_1 has been created by kgv.

SHA-1: 63708235acbac06368f9a5042744bbe9757e4a6e


Detailed log of new commits:

Author: Sergey Solomin
Date: Tue Apr 28 12:48:31 2015 +0300

    0026128: Visualization, TKOpenGl - fix misprint in external GLX context initialization
    
    OpenGl_Window, GLX - push warning about missing caps in window Visual.
    Allow initialization of alien GLX context.
(0040334)
kgv   
2015-04-28 12:50   
Updated patch is ready for review.
(0040338)
solomin_s   
2015-04-28 13:02   
Yes, you are right! Thanks for update and fix :)
(0040409)
san   
2015-04-29 12:41   
Branch CR26128_1 reviewed without remarks, ready for testing.
(0040445)
git   
2015-04-29 20:28   
Branch CR26128_1 has been updated by inv.

SHA-1: 46d8dd0a05b323d459f3f543eede3d633793d9b6


Detailed log of new commits:

Author: bugmaster
Date: Wed Apr 29 20:27:27 2015 +0300

    Correction of misprinting

(0040565)
apv   
2015-05-05 16:46   
Dear BugMaster,

Branch CR26128_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 46d8dd0a05b323d459f3f543eede3d633793d9b6

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 94675129 / 94611080 [+0.07%]
Total CPU difference: 50888.24999999936 / 51017.469999999455 [-0.25%]

Testing on Windows:
Total MEMORY difference: 57176071 / 57184627 [-0.01%]
Total CPU difference: 15784.758383698976 / 15796.84846119897 [-0.08%]
(0041105)
git   
2015-05-14 16:37   
Branch CR26128 has been deleted by inv.

SHA-1: 2f33c2350abea67971d020bc1f2f85d40262ed5d
(0041106)
git   
2015-05-14 16:37   
Branch CR26128_1 has been deleted by inv.

SHA-1: 46d8dd0a05b323d459f3f543eede3d633793d9b6