diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-10-14 23:38:23 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-10-25 19:55:37 -0500 |
commit | 5ef746c2188703ec34245a2c096063958713dbdd (patch) | |
tree | 94f0127319ca5b70806ec641651c81bb08d30263 /canvas | |
parent | ea05f2aa4e28fd40238c4962e9dcbbf0d873cabd (diff) |
use SolarMutexGuard instead of LocalGuard in canvas
LocalGuard is a wrapper guard around the SolarMutex.
SolarMutexGuard already provide this function.
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_canvasfont.cxx | 33 | ||||
-rw-r--r-- | canvas/source/vcl/canvas.cxx | 6 | ||||
-rw-r--r-- | canvas/source/vcl/canvasbitmap.cxx | 4 | ||||
-rw-r--r-- | canvas/source/vcl/canvascustomsprite.cxx | 8 | ||||
-rw-r--r-- | canvas/source/vcl/canvasfont.cxx | 12 | ||||
-rw-r--r-- | canvas/source/vcl/spritecanvas.cxx | 8 | ||||
-rw-r--r-- | canvas/source/vcl/textlayout.cxx | 38 |
7 files changed, 44 insertions, 65 deletions
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index 6b8996e6fe6b..b6d83413e113 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -46,27 +46,6 @@ using namespace ::com::sun::star; namespace cairocanvas { - namespace - { - // Little helper to encapsulate locking into policy class - class LocalGuard - { - public: - LocalGuard() : - aGuard( Application::GetSolarMutex() ) - { - } - - /// To be compatible with CanvasBase mutex concept - LocalGuard( const ::osl::Mutex& ) : - aGuard( Application::GetSolarMutex() ) - { - } - - private: - ::vos::OGuard aGuard; - }; - } CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, const uno::Sequence< beans::PropertyValue >& /*rExtraFontProperties*/, @@ -121,14 +100,14 @@ namespace cairocanvas void SAL_CALL CanvasFont::disposing() { - LocalGuard aGuard; + SolarMutexGuard aGuard; mpRefDevice.clear(); } uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) throw (uno::RuntimeException) { - LocalGuard aGuard; + SolarMutexGuard aGuard; if( !mpRefDevice.is() ) return uno::Reference< rendering::XTextLayout >(); // we're disposed @@ -142,14 +121,14 @@ namespace cairocanvas rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException) { - LocalGuard aGuard; + SolarMutexGuard aGuard; return maFontRequest; } rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException) { - LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return rendering::FontMetrics(); @@ -157,7 +136,7 @@ namespace cairocanvas uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException) { - LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return uno::Sequence< double >(); @@ -165,7 +144,7 @@ namespace cairocanvas uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException) { - LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return uno::Sequence< beans::PropertyValue >(); diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index e115e072e1ac..81ce996015c2 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -98,7 +98,7 @@ namespace vclcanvas 4: XWindow for creating Window (or empty for VirtualDevice) 5: SystemGraphicsData as a streamed Any */ - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; VERBOSE_TRACE( "VCLCanvas::initialize called" ); @@ -135,7 +135,7 @@ namespace vclcanvas void SAL_CALL Canvas::disposing() { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; mxComponentContext.clear(); @@ -155,7 +155,7 @@ namespace vclcanvas const ::Size& rSz, const GraphicAttr& rAttr ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr ); } diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index bbd559c20c43..300617f417eb 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -111,7 +111,7 @@ namespace vclcanvas BitmapEx CanvasBitmap::getBitmap() const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(T3): Rework to use shared_ptr all over the place for // BmpEx. This is highly un-threadsafe @@ -125,7 +125,7 @@ namespace vclcanvas const ::Size& rSz, const GraphicAttr& rAttr ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; mbSurfaceDirty = true; diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx index 8499e026234d..010422b6e093 100644 --- a/canvas/source/vcl/canvascustomsprite.cxx +++ b/canvas/source/vcl/canvascustomsprite.cxx @@ -131,7 +131,7 @@ namespace vclcanvas void SAL_CALL CanvasCustomSprite::disposing() { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // forward to parent CanvasCustomSpriteBaseT::disposing(); @@ -162,7 +162,7 @@ namespace vclcanvas void CanvasCustomSprite::redraw( OutputDevice& rOutDev, bool bBufferedUpdate ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; redraw( rOutDev, maSpriteHelper.getPosPixel(), bBufferedUpdate ); } @@ -171,7 +171,7 @@ namespace vclcanvas const ::basegfx::B2DPoint& rOrigOutputPos, bool bBufferedUpdate ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; maSpriteHelper.redraw( rOutDev, rOrigOutputPos, @@ -188,7 +188,7 @@ namespace vclcanvas const ::Size& rSz, const GraphicAttr& rAttr ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; mbSurfaceDirty = true; diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index 2485261f7304..71962cf3b45c 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -98,7 +98,7 @@ namespace vclcanvas void SAL_CALL CanvasFont::disposing() { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; mpOutDevProvider.reset(); mpRefDevice.clear(); @@ -106,7 +106,7 @@ namespace vclcanvas uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; if( !mpRefDevice.is() ) return uno::Reference< rendering::XTextLayout >(); // we're disposed @@ -121,14 +121,14 @@ namespace vclcanvas rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return maFontRequest; } rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; OutputDevice& rOutDev = mpOutDevProvider->getOutDev(); VirtualDevice aVDev( rOutDev ); @@ -147,7 +147,7 @@ namespace vclcanvas uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return uno::Sequence< double >(); @@ -155,7 +155,7 @@ namespace vclcanvas uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return uno::Sequence< beans::PropertyValue >(); diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index e8e3d7a1f96c..b06bd1c77e9e 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.cxx @@ -64,7 +64,7 @@ namespace vclcanvas void SpriteCanvas::initialize() { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // #i64742# Only call initialize when not in probe mode if( maArguments.getLength() == 0 ) @@ -131,7 +131,7 @@ namespace vclcanvas void SAL_CALL SpriteCanvas::disposing() { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; mxComponentContext.clear(); @@ -151,7 +151,7 @@ namespace vclcanvas sal_Bool SAL_CALL SpriteCanvas::updateScreen( sal_Bool bUpdateAll ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // avoid repaints on hidden window (hidden: not mapped to // screen). Return failure, since the screen really has _not_ @@ -172,7 +172,7 @@ namespace vclcanvas const ::Size& rSz, const GraphicAttr& rAttr ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr ); } diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index e27bb920f986..ffd650dcd0bb 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -104,7 +104,7 @@ namespace vclcanvas void SAL_CALL TextLayout::disposing() { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; mpOutDevProvider.reset(); mxDevice.clear(); @@ -114,7 +114,7 @@ namespace vclcanvas // XTextLayout uno::Sequence< uno::Reference< rendering::XPolyPolygon2D > > SAL_CALL TextLayout::queryTextShapes( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; OutputDevice& rOutDev = mpOutDevProvider->getOutDev(); VirtualDevice aVDev( rOutDev ); @@ -166,7 +166,7 @@ namespace vclcanvas uno::Sequence< geometry::RealRectangle2D > SAL_CALL TextLayout::queryInkMeasures( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; OutputDevice& rOutDev = mpOutDevProvider->getOutDev(); @@ -218,7 +218,7 @@ namespace vclcanvas uno::Sequence< geometry::RealRectangle2D > SAL_CALL TextLayout::queryMeasures( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return uno::Sequence< geometry::RealRectangle2D >(); @@ -226,14 +226,14 @@ namespace vclcanvas uno::Sequence< double > SAL_CALL TextLayout::queryLogicalAdvancements( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return maLogicalAdvancements; } void SAL_CALL TextLayout::applyLogicalAdvancements( const uno::Sequence< double >& aAdvancements ) throw (lang::IllegalArgumentException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; ENSURE_ARG_OR_THROW( aAdvancements.getLength() == maText.Length, "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" ); @@ -243,7 +243,7 @@ namespace vclcanvas geometry::RealRectangle2D SAL_CALL TextLayout::queryTextBounds( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; if( !mpOutDevProvider ) return geometry::RealRectangle2D(); @@ -281,7 +281,7 @@ namespace vclcanvas double SAL_CALL TextLayout::justify( double nSize ) throw (lang::IllegalArgumentException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)nSize; @@ -292,7 +292,7 @@ namespace vclcanvas double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& aNextLayouts, double nSize ) throw (lang::IllegalArgumentException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)aNextLayouts; (void)nSize; @@ -303,7 +303,7 @@ namespace vclcanvas rendering::TextHit SAL_CALL TextLayout::getTextHit( const geometry::RealPoint2D& aHitPoint ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)aHitPoint; @@ -313,7 +313,7 @@ namespace vclcanvas rendering::Caret SAL_CALL TextLayout::getCaret( sal_Int32 nInsertionIndex, sal_Bool bExcludeLigatures ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)nInsertionIndex; (void)bExcludeLigatures; @@ -324,7 +324,7 @@ namespace vclcanvas sal_Int32 SAL_CALL TextLayout::getNextInsertionIndex( sal_Int32 nStartIndex, sal_Int32 nCaretAdvancement, sal_Bool bExcludeLigatures ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)nStartIndex; (void)nCaretAdvancement; @@ -336,7 +336,7 @@ namespace vclcanvas uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryVisualHighlighting( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)nStartIndex; (void)nEndIndex; @@ -347,7 +347,7 @@ namespace vclcanvas uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryLogicalHighlighting( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; (void)nStartIndex; (void)nEndIndex; @@ -358,7 +358,7 @@ namespace vclcanvas double SAL_CALL TextLayout::getBaselineOffset( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; // TODO(F1) return 0.0; @@ -366,21 +366,21 @@ namespace vclcanvas sal_Int8 SAL_CALL TextLayout::getMainTextDirection( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return mnTextDirection; } uno::Reference< rendering::XCanvasFont > SAL_CALL TextLayout::getFont( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return mpFont.getRef(); } rendering::StringContext SAL_CALL TextLayout::getText( ) throw (uno::RuntimeException) { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; return maText; } @@ -390,7 +390,7 @@ namespace vclcanvas const rendering::ViewState& viewState, const rendering::RenderState& renderState ) const { - tools::LocalGuard aGuard; + SolarMutexGuard aGuard; setupLayoutMode( rOutDev, mnTextDirection ); |