Skip to content
Snippets Groups Projects
  1. Aug 17, 2016
  2. Aug 11, 2016
  3. Aug 04, 2016
  4. Aug 01, 2016
  5. Jul 27, 2016
  6. Jul 26, 2016
  7. Aug 03, 2016
    • Nat Goodspeed's avatar
      MAINT-6584: Use RAII classes to manage helper object lifespans. · 03bff896
      Nat Goodspeed authored
      Use boost::scoped_ptr instead of raw pointers to LLKDUMemSource,
      LLKDUDecodeState, kdu_coords and kdu_dims so cleanup is simpler, and automated
      on destruction of LLImageJ2CKDU.
      
      Replace pointer to kdu_codestream with a custom RAII class. kdu_codestream is
      itself an opaque handle, so we don't need to add another layer of indirection.
      Just wrap it to ensure its destroy() method is reliably called when needed.
      
      Make static instances of LLKDUMessageWarning and LLKDUMessageError
      self-register, eliminating the companion static bool and explicit checks in
      code.
      03bff896
  8. Jul 25, 2016
  9. Jul 22, 2016
  10. Jul 21, 2016
    • Nat Goodspeed's avatar
      MAINT-6584: Streamline static LLImageJ2C implementation API. · 71b593e8
      Nat Goodspeed authored
      Specifically, remove unused function pointer types CreateLLImageJ2CFunction,
      DestroyLLImageJ2CFunction and EngineInfoLLImageJ2CFunction.
      
      Also eliminate static fallbackDestroyLLImageJ2CImpl() and
      fallbackEngineInfoLLImageJ2CImpl(), leaving only static
      fallbackCreateLLImageJ2CImpl().
      
      We do need a factory function to instantiate the appropriate LLImageJ2CImpl
      subclass, so leave the fallbackCreateLLImageJ2CImpl() link seam in place.
      
      However, given that every known LLImageJ2CImpl subclass is cheap to
      instantiate, make getEngineInfo() a pure virtual method on that subclass: the
      static LLImageJ2C::getEngineInfo() method can temporarily construct an
      instance to query. While we're at it, make getEngineInfo() return std::string
      like LLImageJ2C::getEngineInfo(). It's ridiculous that
      fallbackEngineInfoLLImageJ2CImpl() implementations constructed a static
      std::string and returned its c_str(), only to have LLImageJ2C::getEngineInfo()
      construct ANOTHER std::string from the returned const char*.
      
      fallbackDestroyLLImageJ2CImpl() never did anything useful: it merely deleted
      the passed LLImageJ2CImpl subclass pointer as the specific subclass type. But
      since LLImageJ2CImpl's destructor is virtual, LLImageJ2C's destructor could
      simply delete the stored LLImageJ2CImpl*. In fact, make mImpl a
      boost::scoped_ptr<LLImageJ2CImpl> so we don't even have to delete it manually.
      71b593e8
    • Nat Goodspeed's avatar
      DRTVWR-427: Remove engineInfoLLImageJ2CKDU(), createLLImageJ2CKDU(), · f09a92f1
      Nat Goodspeed authored
      destroyLLImageJ2CKDU().
      
      These were apparently intended as simple C-style DLL entry points. But as
      nobody calls them, and as we decided against building the viewer from DLLs,
      they only clutter the code.
      f09a92f1
  11. Jul 19, 2016
    • Nat Goodspeed's avatar
      MAINT-5011: Introduce LLException base class for viewer exceptions. · 9c49a6c9
      Nat Goodspeed authored
      This also introduces LLContinueError for exceptions which should interrupt
      some part of viewer processing (e.g. the current coroutine) but should attempt
      to let the viewer session proceed.
      
      Derive all existing viewer exception classes from LLException rather than from
      std::runtime_error or std::logic_error.
      
      Use BOOST_THROW_EXCEPTION() rather than plain 'throw' to enrich the thrown
      exception with source file, line number and containing function.
      9c49a6c9
    • Nat Goodspeed's avatar
      DRTVWR-418: Remove rogue getMessage() from llsecapi.h exceptions. · 47d93e4f
      Nat Goodspeed authored
      The LLProtectedDataException and LLCertException exception classes didn't used
      to be derived from std::exception, so they followed their own getMessage()
      convention instead of the standard what() convention. Now that they're derived
      from std::exception, remove getMessage() and change its few consumers to use
      what() instead. Thanks NickyD for suggesting.
      47d93e4f
  12. Jul 14, 2016
  13. Jul 13, 2016
  14. Jul 12, 2016
  15. Jul 11, 2016
  16. Jul 08, 2016
  17. Jul 06, 2016
  18. Jun 30, 2016
    • Nat Goodspeed's avatar
      DRTVWR-418: Unify control flow through LLAppViewer across platforms. · 464a0df4
      Nat Goodspeed authored
      The LLApp API used to consist of init(), mainLoop(), cleanup() methods. This
      makes sense -- but on Mac that structure was being subverted. The method
      called mainLoop() was in fact being called once per frame. There was
      initialization code in the method, which (on Mac) needed to be skipped with an
      already-initialized bool. There was a 'while' loop which (on Mac) needed to be
      turned into an 'if' instead so the method would return after every frame.
      
      Rename LLApp::mainLoop() to frame(). Propagate through subclasses LLAppViewer
      and LLCrashLogger. Document the fact that frame() returns true to mean "done."
      (This was always the case, but had to be inferred from the code.)
      
      Rename the Mac Objective-C function mainLoop to oneFrame. Rename the C++ free
      function it calls from runMainLoop() to pumpMainLoop(). Add comments to
      llappdelegate-objc.mm explaining (inferred) control flow.
      
      Change the Linux viewer main() and the Windows viewer WINMAIN() from a single
      LLAppViewer::mainLoop() call to repeatedly call frame() until it returns true.
      
      Move initialization code from the top of LLAppViewer::frame() to the init()
      method, where it more properly belongs. Remove corresponding
      mMainLoopInitialized flag (and all references) from LLAppViewer.
      
      Remove 'while (! LLApp::isExiting())' (or on Mac, 'if (! LLApp::isExiting())')
      from LLAppViewer::frame() -- thus unindenting the whole body of the 'while'
      and causing many lines of apparent change. (Apologies to reviewers.)
      
      There are four LLApp states: APP_STATUS_RUNNING, APP_STATUS_QUITTING,
      APP_STATUS_STOPPED and APP_STATUS_ERROR. Change LLAppViewer::frame() return
      value from (isExiting()) (QUITTING or ERROR) to (! isRunning()). I do not know
      under what circumstances the state might transition to STOPPED during a
      frame() call, but I'm quite sure that if it does, we don't want to call
      frame() again. We only want a subsequent call if the state is RUNNING.
      
      Also rename mainLoop() method in LLCrashLogger subclasses
      LLCrashLoggerWindows, LLCrashLoggerMac, LLCrashLoggerLinux. Of course it's
      completely up to the frame() method whether to yield control; none of those in
      fact do. Honor protocol by returning true (frame() is done), even though each
      one's main() caller ignores the return value.
      
      In fact LLCrashLoggerWindows::mainLoop() wasn't using the return protocol
      correctly anyway, returning wParam or 0 or 1 -- possibly because the return
      protocol was never explicitly documented. It should always return true: "I'm
      done, don't call me again."
      464a0df4
  19. Jun 17, 2016
Loading