0026915: Visualization - return Handle from Graphic3d_CView::FBOCreate() instead...
authorkgv <kgv@opencascade.com>
Mon, 23 Nov 2015 11:16:08 +0000 (14:16 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 27 Nov 2015 07:08:35 +0000 (10:08 +0300)
OpenGl_View::FBO() - use copy Handle constructor for compatibility.

14 files changed:
src/D3DHost/D3DHost_View.cxx
src/Graphic3d/FILES
src/Graphic3d/Graphic3d_CView.hxx
src/Graphic3d/Graphic3d_GraphicDriver.hxx
src/Graphic3d/Graphic3d_PtrFrameBuffer.hxx [deleted file]
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_View.cxx
src/OpenGl/OpenGl_View.hxx
src/OpenGl/OpenGl_View_Print.cxx
src/OpenGl/OpenGl_View_Redraw.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/OpenGl/OpenGl_Workspace.hxx
src/V3d/V3d_View.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx

index 08532dd..e773f87 100644 (file)
@@ -301,7 +301,7 @@ void D3DHost_View::Redraw()
   {
     return;
   }
-  else if (myFBO != NULL)
+  else if (!myFBO.IsNull())
   {
     OpenGl_View::Redraw();
     return;
@@ -310,9 +310,9 @@ void D3DHost_View::Redraw()
   Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
   myToFlipOutput = Standard_True;
   myD3dWglFbo->LockSurface   (aCtx);
-  myFBO = myD3dWglFbo.get();
+  myFBO = myD3dWglFbo;
   OpenGl_View::Redraw();
-  myFBO = NULL;
+  myFBO.Nullify();
   myD3dWglFbo->UnlockSurface (aCtx);
   myToFlipOutput = Standard_False;
   if (aCtx->caps->buffersNoSwap)
@@ -351,7 +351,7 @@ void D3DHost_View::RedrawImmediate()
   {
     return;
   }
-  else if (myFBO != NULL)
+  else if (!myFBO.IsNull())
   {
     OpenGl_View::Redraw();
     return;
@@ -359,9 +359,9 @@ void D3DHost_View::RedrawImmediate()
 
   myToFlipOutput = Standard_True;
   myD3dWglFbo->LockSurface   (aCtx);
-  myFBO = myD3dWglFbo.get();
+  myFBO = myD3dWglFbo;
   OpenGl_View::RedrawImmediate();
-  myFBO = NULL;
+  myFBO.Nullify();
   myD3dWglFbo->UnlockSurface (aCtx);
   myToFlipOutput = Standard_False;
   if (aCtx->caps->buffersNoSwap)
index f373a1a..ef47d46 100755 (executable)
@@ -95,7 +95,6 @@ Graphic3d_NameOfTexturePlane.hxx
 Graphic3d_NListOfHAsciiString.hxx
 Graphic3d_NMapOfTransient.hxx
 Graphic3d_PriorityDefinitionError.hxx
-Graphic3d_PtrFrameBuffer.hxx
 Graphic3d_RenderingMode.hxx
 Graphic3d_RenderingParams.hxx
 Graphic3d_SequenceOfGroup.hxx
index 2a29b91..414cfdf 100644 (file)
@@ -30,7 +30,6 @@
 #include <Graphic3d_GraduatedTrihedron.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
 #include <Graphic3d_NMapOfTransient.hxx>
-#include <Graphic3d_PtrFrameBuffer.hxx>
 #include <Graphic3d_RenderingParams.hxx>
 #include <Graphic3d_SequenceOfHClipPlane.hxx>
 #include <Graphic3d_SequenceOfStructure.hxx>
@@ -349,28 +348,28 @@ public:
                                   const Graphic3d_ZLayerSettings& theSettings) = 0;
 
   //! Returns pointer to an assigned framebuffer object.
-  virtual Graphic3d_PtrFrameBuffer FBO() const = 0;
+  virtual Handle(Standard_Transient) FBO() const = 0;
 
   //! Sets framebuffer object for offscreen rendering.
-  virtual void SetFBO (const Graphic3d_PtrFrameBuffer theFBO) = 0;
+  virtual void SetFBO (const Handle(Standard_Transient)& theFbo) = 0;
 
   //! Generate offscreen FBO in the graphic library.
   //! If not supported on hardware returns NULL.
-  virtual Graphic3d_PtrFrameBuffer FBOCreate (const Standard_Integer theWidth,
-                                              const Standard_Integer theHeight) = 0;
+  virtual Handle(Standard_Transient) FBOCreate (const Standard_Integer theWidth,
+                                                const Standard_Integer theHeight) = 0;
 
   //! Remove offscreen FBO from the graphic library
-  virtual void FBORelease (Graphic3d_PtrFrameBuffer& theFBOPtr) = 0;
+  virtual void FBORelease (Handle(Standard_Transient)& theFbo) = 0;
 
   //! Read offscreen FBO configuration.
-  virtual void FBOGetDimensions (const Graphic3d_PtrFrameBuffer theFBOPtr,
+  virtual void FBOGetDimensions (const Handle(Standard_Transient)& theFbo,
                                  Standard_Integer& theWidth,
                                  Standard_Integer& theHeight,
                                  Standard_Integer& theWidthMax,
                                  Standard_Integer& theHeightMax) = 0;
 
   //! Change offscreen FBO viewport.
-  virtual void FBOChangeViewport (Graphic3d_PtrFrameBuffer& theFBOPtr,
+  virtual void FBOChangeViewport (const Handle(Standard_Transient)& theFbo,
                                   const Standard_Integer theWidth,
                                   const Standard_Integer theHeight) = 0;
 
index 4df4e19..edbbe0c 100644 (file)
@@ -38,7 +38,6 @@
 #include <Graphic3d_Vec3.hxx>
 #include <Standard_ShortReal.hxx>
 #include <Standard_Address.hxx>
-#include <Graphic3d_PtrFrameBuffer.hxx>
 #include <Image_PixMap.hxx>
 #include <Graphic3d_BufferType.hxx>
 #include <Aspect_Handle.hxx>
diff --git a/src/Graphic3d/Graphic3d_PtrFrameBuffer.hxx b/src/Graphic3d/Graphic3d_PtrFrameBuffer.hxx
deleted file mode 100644 (file)
index f299750..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _Graphic3d_PtrFrameBuffer_HeaderFile
-#define _Graphic3d_PtrFrameBuffer_HeaderFile
-
-class Graphic3d_FrameBuffer;
-typedef Graphic3d_FrameBuffer* Graphic3d_PtrFrameBuffer;
-
-#endif /*Graphic3d_PtrFrameBuffer_HeaderFile*/
index 0f73a4f..3d990e9 100644 (file)
@@ -37,7 +37,6 @@
 #include <Graphic3d_TypeOfComposition.hxx>
 #include <Graphic3d_ExportFormat.hxx>
 #include <Graphic3d_SortType.hxx>
-#include <Graphic3d_PtrFrameBuffer.hxx>
 #include <Graphic3d_Array1OfVertex.hxx>
 #include <Graphic3d_Array2OfVertex.hxx>
 #include <Graphic3d_BufferType.hxx>
index 6ecb61d..c68579f 100644 (file)
@@ -70,7 +70,6 @@ OpenGl_View::OpenGl_View (const Handle(Graphic3d_StructureManager)& theMgr,
   myFog            (myDefaultFog),
   myZClip          (myDefaultZClip),
   myCamera         (new Graphic3d_Camera()),
-  myFBO            (NULL),
   myUseGLLight     (Standard_True),
   myToShowTrihedron      (false),
   myToShowGradTrihedron  (false),
@@ -517,26 +516,26 @@ void OpenGl_View::SetZLayerSettings (const Graphic3d_ZLayerId        theLayerId,
 //function : FBO
 //purpose  :
 //=======================================================================
-Graphic3d_PtrFrameBuffer OpenGl_View::FBO() const
+Handle(Standard_Transient) OpenGl_View::FBO() const
 {
-  return reinterpret_cast<Graphic3d_PtrFrameBuffer> (myFBO);
+  return Handle(Standard_Transient)(myFBO);
 }
 
 //=======================================================================
 //function : SetFBO
 //purpose  :
 //=======================================================================
-void OpenGl_View::SetFBO (const Graphic3d_PtrFrameBuffer theFBO)
+void OpenGl_View::SetFBO (const Handle(Standard_Transient)& theFbo)
 {
-  myFBO = reinterpret_cast<OpenGl_FrameBuffer*> (theFBO);
+  myFBO = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
 }
 
 //=======================================================================
 //function : FBOCreate
 //purpose  :
 //=======================================================================
-Graphic3d_PtrFrameBuffer OpenGl_View::FBOCreate (const Standard_Integer theWidth,
-                                                 const Standard_Integer theHeight)
+Handle(Standard_Transient) OpenGl_View::FBOCreate (const Standard_Integer theWidth,
+                                                   const Standard_Integer theHeight)
 {
   return myWorkspace->FBOCreate (theWidth, theHeight);
 }
@@ -545,22 +544,34 @@ Graphic3d_PtrFrameBuffer OpenGl_View::FBOCreate (const Standard_Integer theWidth
 //function : FBORelease
 //purpose  :
 //=======================================================================
-void OpenGl_View::FBORelease (Graphic3d_PtrFrameBuffer& theFBOPtr)
+void OpenGl_View::FBORelease (Handle(Standard_Transient)& theFbo)
 {
-  myWorkspace->FBORelease (theFBOPtr);
+  Handle(OpenGl_FrameBuffer) aFrameBuffer = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
+  if (aFrameBuffer.IsNull())
+  {
+    return;
+  }
+
+  myWorkspace->FBORelease (aFrameBuffer);
+  theFbo.Nullify();
 }
 
 //=======================================================================
 //function : FBOGetDimensions
 //purpose  :
 //=======================================================================
-void OpenGl_View::FBOGetDimensions (const Graphic3d_PtrFrameBuffer theFBOPtr,
+void OpenGl_View::FBOGetDimensions (const Handle(Standard_Transient)& theFbo,
                                     Standard_Integer& theWidth,
                                     Standard_Integer& theHeight,
                                     Standard_Integer& theWidthMax,
                                     Standard_Integer& theHeightMax)
 {
-  const OpenGl_FrameBuffer* aFrameBuffer = (const OpenGl_FrameBuffer* )theFBOPtr;
+  const Handle(OpenGl_FrameBuffer) aFrameBuffer = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
+  if (aFrameBuffer.IsNull())
+  {
+    return;
+  }
+
   theWidth     = aFrameBuffer->GetVPSizeX(); // current viewport size
   theHeight    = aFrameBuffer->GetVPSizeY();
   theWidthMax  = aFrameBuffer->GetSizeX(); // texture size
@@ -571,11 +582,16 @@ void OpenGl_View::FBOGetDimensions (const Graphic3d_PtrFrameBuffer theFBOPtr,
 //function : FBOChangeViewport
 //purpose  :
 //=======================================================================
-void OpenGl_View::FBOChangeViewport (Graphic3d_PtrFrameBuffer& theFBOPtr,
+void OpenGl_View::FBOChangeViewport (const Handle(Standard_Transient)& theFbo,
                                      const Standard_Integer theWidth,
                                      const Standard_Integer theHeight)
 {
-  OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )theFBOPtr;
+  const Handle(OpenGl_FrameBuffer) aFrameBuffer = Handle(OpenGl_FrameBuffer)::DownCast (theFbo);
+  if (aFrameBuffer.IsNull())
+  {
+    return;
+  }
+
   aFrameBuffer->ChangeViewport (theWidth, theHeight);
 }
 
index 6a058aa..0cb0759 100644 (file)
@@ -233,28 +233,28 @@ public:
                                                   const Graphic3d_ZLayerSettings& theSettings) Standard_OVERRIDE;
 
   //! Returns pointer to an assigned framebuffer object.
-  Standard_EXPORT virtual Graphic3d_PtrFrameBuffer FBO() const Standard_OVERRIDE;
+  Standard_EXPORT virtual Handle(Standard_Transient) FBO() const Standard_OVERRIDE;
 
   //! Sets framebuffer object for offscreen rendering.
-  Standard_EXPORT virtual void SetFBO (const Graphic3d_PtrFrameBuffer theFBO) Standard_OVERRIDE;
+  Standard_EXPORT virtual void SetFBO (const Handle(Standard_Transient)& theFbo) Standard_OVERRIDE;
 
   //! Generate offscreen FBO in the graphic library.
   //! If not supported on hardware returns NULL.
-  Standard_EXPORT virtual Graphic3d_PtrFrameBuffer FBOCreate (const Standard_Integer theWidth,
-                                                              const Standard_Integer theHeight) Standard_OVERRIDE;
+  Standard_EXPORT virtual Handle(Standard_Transient) FBOCreate (const Standard_Integer theWidth,
+                                                                const Standard_Integer theHeight) Standard_OVERRIDE;
 
   //! Remove offscreen FBO from the graphic library
-  Standard_EXPORT virtual void FBORelease (Graphic3d_PtrFrameBuffer& theFBOPtr) Standard_OVERRIDE;
+  Standard_EXPORT virtual void FBORelease (Handle(Standard_Transient)& theFbo) Standard_OVERRIDE;
 
   //! Read offscreen FBO configuration.
-  Standard_EXPORT virtual void FBOGetDimensions (const Graphic3d_PtrFrameBuffer theFBOPtr,
+  Standard_EXPORT virtual void FBOGetDimensions (const Handle(Standard_Transient)& theFbo,
                                                  Standard_Integer& theWidth,
                                                  Standard_Integer& theHeight,
                                                  Standard_Integer& theWidthMax,
                                                  Standard_Integer& theHeightMax) Standard_OVERRIDE;
 
   //! Change offscreen FBO viewport.
-  Standard_EXPORT virtual void FBOChangeViewport (Graphic3d_PtrFrameBuffer& theFBOPtr,
+  Standard_EXPORT virtual void FBOChangeViewport (const Handle(Standard_Transient)& theFbo,
                                                   const Standard_Integer theWidth,
                                                   const Standard_Integer theHeight) Standard_OVERRIDE;
 
@@ -569,7 +569,7 @@ protected:
   OPENGL_ZCLIP                    myZClip;
   Graphic3d_SequenceOfHClipPlane  myClipPlanes;
   Handle(Graphic3d_Camera)        myCamera;
-  OpenGl_FrameBuffer*             myFBO;
+  Handle(OpenGl_FrameBuffer)      myFBO;
   Standard_Boolean                myUseGLLight;
   Standard_Boolean                myToShowTrihedron;
   Standard_Boolean                myToShowGradTrihedron;
index 3251a5e..921f8f6 100644 (file)
@@ -343,7 +343,7 @@ Standard_Boolean OpenGl_View::Print (const Aspect_Handle    thePrinterDC,
 
   // Frame buffer initialization
   OpenGl_FrameBuffer* aFrameBuffer = NULL;
-  OpenGl_FrameBuffer* aPrevBuffer = (OpenGl_FrameBuffer*)myFBO;
+  OpenGl_FrameBuffer* aPrevBuffer  = myFBO.operator->();
   Standard_Integer aFrameWidth (0),  aFrameHeight (0),
                    aPrevBufferX (0), aPrevBufferY (0);
 
index 82734bc..aeabc27 100644 (file)
@@ -284,7 +284,7 @@ void OpenGl_View::Redraw()
   // set resolution ratio
   aCtx->SetResolutionRatio (RenderingParams().ResolutionRatio());
 
-  OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )myFBO;
+  OpenGl_FrameBuffer* aFrameBuffer = myFBO.operator->();
   bool toSwap = aCtx->IsRender()
             && !aCtx->caps->buffersNoSwap
             &&  aFrameBuffer == NULL;
@@ -521,7 +521,7 @@ void OpenGl_View::RedrawImmediate()
 
   const Graphic3d_StereoMode   aStereoMode  = myRenderParams.StereoMode;
   Graphic3d_Camera::Projection aProjectType = myCamera->ProjectionType();
-  OpenGl_FrameBuffer*          aFrameBuffer = (OpenGl_FrameBuffer* )myFBO;
+  OpenGl_FrameBuffer*          aFrameBuffer = myFBO.operator->();
 
   if ( aFrameBuffer == NULL
    && !aCtx->DefaultFrameBuffer().IsNull()
index b05c7c0..640e17e 100644 (file)
@@ -1084,45 +1084,39 @@ Standard_Boolean OpenGl_Workspace::IsCullingEnabled() const
 // function : FBOCreate
 // purpose  :
 // =======================================================================
-Graphic3d_PtrFrameBuffer OpenGl_Workspace::FBOCreate (const Standard_Integer theWidth,
-                                                      const Standard_Integer theHeight)
+Handle(OpenGl_FrameBuffer) OpenGl_Workspace::FBOCreate (const Standard_Integer theWidth,
+                                                        const Standard_Integer theHeight)
 {
   // activate OpenGL context
   if (!Activate())
-    return NULL;
+    return Handle(OpenGl_FrameBuffer)();
 
   // create the FBO
   const Handle(OpenGl_Context)& aCtx = GetGlContext();
-  OpenGl_FrameBuffer* aFrameBuffer = new OpenGl_FrameBuffer();
+  Handle(OpenGl_FrameBuffer) aFrameBuffer = new OpenGl_FrameBuffer();
   if (!aFrameBuffer->Init (aCtx, theWidth, theHeight, GL_RGBA8, GL_DEPTH24_STENCIL8, 0))
   {
     aFrameBuffer->Release (aCtx.operator->());
-    delete aFrameBuffer;
-    return NULL;
+    return Handle(OpenGl_FrameBuffer)();
   }
-  return (Graphic3d_PtrFrameBuffer )aFrameBuffer;
+  return aFrameBuffer;
 }
 
 // =======================================================================
 // function : FBORelease
 // purpose  :
 // =======================================================================
-void OpenGl_Workspace::FBORelease (Graphic3d_PtrFrameBuffer theFBOPtr)
+void OpenGl_Workspace::FBORelease (Handle(OpenGl_FrameBuffer)& theFbo)
 {
   // activate OpenGL context
   if (!Activate()
-   || theFBOPtr == NULL)
+   || theFbo.IsNull())
   {
     return;
   }
 
-  // release the object
-  OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer*)theFBOPtr;
-  if (aFrameBuffer != NULL)
-  {
-    aFrameBuffer->Release (GetGlContext().operator->());
-  }
-  delete aFrameBuffer;
+  theFbo->Release (GetGlContext().operator->());
+  theFbo.Nullify();
 }
 
 inline bool getDataFormat (const Image_PixMap& theData,
@@ -1209,9 +1203,9 @@ inline Standard_Size getAligned (const Standard_Size theNumber,
 // function : BufferDump
 // purpose  :
 // =======================================================================
-Standard_Boolean OpenGl_Workspace::BufferDump (OpenGl_FrameBuffer*         theFBOPtr,
-                                               Image_PixMap&               theImage,
-                                               const Graphic3d_BufferType& theBufferType)
+Standard_Boolean OpenGl_Workspace::BufferDump (const Handle(OpenGl_FrameBuffer)& theFbo,
+                                               Image_PixMap&                     theImage,
+                                               const Graphic3d_BufferType&       theBufferType)
 {
   GLenum aFormat, aType;
   if (theImage.IsEmpty()
@@ -1230,9 +1224,9 @@ Standard_Boolean OpenGl_Workspace::BufferDump (OpenGl_FrameBuffer*         theFB
 #endif
 
   // bind FBO if used
-  if (theFBOPtr != NULL && theFBOPtr->IsValid())
+  if (!theFbo.IsNull() && theFbo->IsValid())
   {
-    theFBOPtr->BindBuffer (GetGlContext());
+    theFbo->BindBuffer (GetGlContext());
   }
   else
   {
@@ -1290,9 +1284,9 @@ Standard_Boolean OpenGl_Workspace::BufferDump (OpenGl_FrameBuffer*         theFB
   glPixelStorei (GL_PACK_ROW_LENGTH, 0);
 #endif
 
-  if (theFBOPtr != NULL && theFBOPtr->IsValid())
+  if (!theFbo.IsNull() && theFbo->IsValid())
   {
-    theFBOPtr->UnbindBuffer (GetGlContext());
+    theFbo->UnbindBuffer (GetGlContext());
   }
   else
   {
index c211954..6da121e 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef _OpenGl_Workspace_Header
 #define _OpenGl_Workspace_Header
 
-#include <Graphic3d_PtrFrameBuffer.hxx>
 #include <Graphic3d_BufferType.hxx>
 
 #include <InterfaceGraphic_Graphic3d.hxx>
@@ -128,13 +127,13 @@ public:
 
   const Handle(OpenGl_Context)& GetGlContext() { return myGlContext; }
 
-  Standard_EXPORT Graphic3d_PtrFrameBuffer FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight);
+  Standard_EXPORT Handle(OpenGl_FrameBuffer) FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight);
 
-  Standard_EXPORT void FBORelease (Graphic3d_PtrFrameBuffer theFBOPtr);
+  Standard_EXPORT void FBORelease (Handle(OpenGl_FrameBuffer)& theFbo);
 
-  Standard_Boolean BufferDump (OpenGl_FrameBuffer*         theFBOPtr,
-                               Image_PixMap&               theImage,
-                               const Graphic3d_BufferType& theBufferType);
+  Standard_Boolean BufferDump (const Handle(OpenGl_FrameBuffer)& theFbo,
+                               Image_PixMap&                     theImage,
+                               const Graphic3d_BufferType&       theBufferType);
 
   Standard_EXPORT Standard_Integer Width()  const;
 
index 9464ca6..f9da1b4 100644 (file)
@@ -2940,11 +2940,11 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap&               theImage,
                                      const V3d_StereoDumpOptions theStereoOptions)
 {
   // always prefer hardware accelerated offscreen buffer
-  Graphic3d_PtrFrameBuffer aFBOPtr = NULL;
-  Graphic3d_PtrFrameBuffer aPrevFBOPtr = myView->FBO();
+  Handle(Standard_Transient) aFBOPtr;
+  Handle(Standard_Transient) aPrevFBOPtr = myView->FBO();
   Standard_Integer aFBOVPSizeX (theWidth), aFBOVPSizeY (theHeight), aFBOSizeXMax (0), aFBOSizeYMax (0);
   Standard_Integer aPrevFBOVPSizeX (0), aPrevFBOVPSizeY (0), aPrevFBOSizeXMax (0), aPrevFBOSizeYMax (0);
-  if (aPrevFBOPtr != NULL)
+  if (!aPrevFBOPtr.IsNull())
   {
     myView->FBOGetDimensions (aPrevFBOPtr,
                               aPrevFBOVPSizeX, aPrevFBOVPSizeY,
@@ -2956,11 +2956,11 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap&               theImage,
     }
   }
 
-  if (aFBOPtr == NULL)
+  if (aFBOPtr.IsNull())
   {
     // Try to create hardware accelerated buffer
     aFBOPtr = myView->FBOCreate (aFBOVPSizeX, aFBOVPSizeY);
-    if (aFBOPtr != NULL)
+    if (!aFBOPtr.IsNull())
     {
       myView->FBOGetDimensions (aFBOPtr,
                                 aFBOVPSizeX,  aFBOVPSizeY,
@@ -2975,7 +2975,7 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap&               theImage,
 
   // If hardware accelerated buffer - try to use onscreen buffer
   // Results may be bad!
-  if (aFBOPtr == NULL)
+  if (aFBOPtr.IsNull())
   {
     // retrieve window sizes
     Standard_Integer aWinWidth, aWinHeight;
@@ -3065,7 +3065,7 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap&               theImage,
   {
     myView->FBORelease (aFBOPtr);
   }
-  else if (aPrevFBOPtr != NULL)
+  else if (!aPrevFBOPtr.IsNull())
   {
     myView->FBOChangeViewport (aPrevFBOPtr, aPrevFBOVPSizeX, aPrevFBOVPSizeY);
   }
index c79eb9b..8a3cdc1 100644 (file)
@@ -4370,9 +4370,9 @@ static int VPrintView (Draw_Interpretor& di, Standard_Integer argc,
     {
       if (isTileSizeProvided)
       {
-        Handle(Graphic3d_CView) aGraphicView = ViewerTest::CurrentView()->View();
-        Graphic3d_PtrFrameBuffer anOldBuffer = aGraphicView->FBO();
-        Graphic3d_PtrFrameBuffer aNewBuffer  = aGraphicView->FBOCreate (aTileWidth, aTileHeight);
+        Handle(Graphic3d_CView)    aGraphicView = ViewerTest::CurrentView()->View();
+        Handle(Standard_Transient) anOldBuffer  = aGraphicView->FBO();
+        Handle(Standard_Transient) aNewBuffer   = aGraphicView->FBOCreate (aTileWidth, aTileHeight);
         aGraphicView->SetFBO (aNewBuffer);
 
         isPrinted = aView->Print (anDC, 1, 1, 0, Aspect_PA_TILE);