[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 4 commits - canvas/source solenv/gbuild sw/source
David Tardon
dtardon at kemper.freedesktop.org
Mon Jun 18 02:33:58 PDT 2012
canvas/source/cairo/cairo_spritecanvashelper.cxx | 66 +++++++++++++++++------
canvas/source/cairo/cairo_spritecanvashelper.hxx | 12 +++-
solenv/gbuild/InstallModule.mk | 6 +-
solenv/gbuild/InstallModuleTarget.mk | 12 ++--
solenv/gbuild/InstallScript.mk | 17 +++--
solenv/gbuild/TargetLocations.mk | 6 +-
sw/source/core/unocore/unochart.cxx | 1
7 files changed, 82 insertions(+), 38 deletions(-)
New commits:
commit 760fba9e415291ad166a9d3ba1abaf83dda18cf5
Author: David Tardon <dtardon at redhat.com>
Date: Sat Jun 16 16:31:28 2012 +0200
fdo#30519 paint scrolled area from the right surface
This adds a way to test whether mpCompositeSurface contains the front
buffer image, so it can be used as a source in painting operations.
It means the mpCompositeSurface changed status from 'temporary' to
'persistent' (which it was anyway, from implementation POV :-)
Change-Id: Iee4fc7a97cd60e47d0abb148e7337f0b50cabb40
Signed-off-by: David Tardon <dtardon at redhat.com>
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index e3d7969..4af8dc6 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -144,7 +144,8 @@ namespace cairocanvas
mpRedrawManager( NULL ),
mpOwningSpriteCanvas( NULL ),
mpCompositingSurface(),
- maCompositingSurfaceSize()
+ maCompositingSurfaceSize(),
+ mbCompositingSurfaceDirty(true)
{
}
@@ -222,7 +223,7 @@ namespace cairocanvas
// TODO(P1): Might be worthwile to track areas of background
// changes, too.
- if( !bUpdateAll && !io_bSurfaceDirty )
+ if( !bUpdateAll && !io_bSurfaceDirty && !mbCompositingSurfaceDirty )
{
// background has not changed, so we're free to optimize
// repaint to areas where a sprite has changed
@@ -270,6 +271,7 @@ namespace cairocanvas
// rendering and sprite changing
mpRedrawManager->clearChangeRecords();
+ mbCompositingSurfaceDirty = false;
io_bSurfaceDirty = false;
// commit to screen
@@ -351,16 +353,33 @@ namespace cairocanvas
::basegfx::B2IRange aDestRect( rDestRect );
aDestRect.intersect( aOutputBounds );
- cairo_save( pCompositingCairo.get() );
- // scroll content in device back buffer
- cairo_set_source_surface( pCompositingCairo.get(),
- mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(),
+ ::basegfx::B2ISize aScrollSize( aDestRect.getWidth(), aDestRect.getHeight() );
+ SurfaceSharedPtr pScrollSurface( getTemporarySurface() );
+ CairoSharedPtr pScrollCairo( pScrollSurface->getCairo() );
+
+ cairo_save( pScrollCairo.get() );
+ // scroll the current content of the compositing surface (and,
+ // thus, of the window) in temp. surface
+ cairo_set_source_surface( pScrollCairo.get(),
+ pCompositingSurface->getCairoSurface().get(),
aDestPos.getX() - aSourceUpperLeftPos.getX(),
aDestPos.getY() - aSourceUpperLeftPos.getY() );
+ cairo_rectangle( pScrollCairo.get(),
+ aDestPos.getX(), aDestPos.getY(),
+ aScrollSize.getX(), aScrollSize.getY() );
+ cairo_clip( pScrollCairo.get() );
+ cairo_set_operator( pScrollCairo.get(), CAIRO_OPERATOR_SOURCE );
+ cairo_paint( pScrollCairo.get() );
+ cairo_restore( pScrollCairo.get() );
+
+ cairo_save( pCompositingCairo.get() );
+ // copy the scrolled area back onto the compositing surface
+ cairo_set_source_surface( pCompositingCairo.get(),
+ pScrollSurface->getCairoSurface().get(),
+ 0, 0 );
cairo_rectangle( pCompositingCairo.get(),
aDestPos.getX(), aDestPos.getY(),
- sal::static_int_cast<sal_Int32>(aDestRect.getWidth()),
- sal::static_int_cast<sal_Int32>(aDestRect.getHeight()) );
+ aScrollSize.getX(), aScrollSize.getY() );
cairo_clip( pCompositingCairo.get() );
cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE );
cairo_paint( pCompositingCairo.get() );
@@ -530,15 +549,28 @@ namespace cairocanvas
if( !mpCompositingSurface )
{
- mpCompositingSurface =
- mpOwningSpriteCanvas->getWindowSurface()->getSimilar(
- CAIRO_CONTENT_COLOR,
- rNeededSize.getX(), rNeededSize.getY() );
+ mpCompositingSurface = createSurface( rNeededSize );
maCompositingSurfaceSize = rNeededSize;
+ mbCompositingSurfaceDirty = true;
+ mpTemporarySurface.reset();
}
return mpCompositingSurface;
}
+
+ ::cairo::SurfaceSharedPtr SpriteCanvasHelper::getTemporarySurface()
+ {
+ if ( !mpTemporarySurface )
+ mpTemporarySurface = createSurface( maCompositingSurfaceSize );
+ return mpTemporarySurface;
+ }
+
+ ::cairo::SurfaceSharedPtr SpriteCanvasHelper::createSurface( const ::basegfx::B2ISize& rNeededSize ) const
+ {
+ return mpOwningSpriteCanvas->getWindowSurface()->getSimilar(
+ CAIRO_CONTENT_COLOR,
+ rNeededSize.getX(), rNeededSize.getY() );
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.hxx b/canvas/source/cairo/cairo_spritecanvashelper.hxx
index 8e3e609..e3de503 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.hxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.hxx
@@ -131,6 +131,8 @@ namespace cairocanvas
private:
::cairo::SurfaceSharedPtr getCompositingSurface( const ::basegfx::B2ISize& rNeededSize );
+ ::cairo::SurfaceSharedPtr getTemporarySurface();
+ ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rNeededSize ) const;
/// Set from the SpriteCanvas: instance coordinating sprite redraw
::canvas::SpriteRedrawManager* mpRedrawManager;
@@ -138,9 +140,13 @@ namespace cairocanvas
/// Set from the init method. used to generate sprites
SpriteCanvas* mpOwningSpriteCanvas;
- /// a temporary surface used to composite the frontbuffer image
- ::cairo::SurfaceSharedPtr mpCompositingSurface;
- ::basegfx::B2ISize maCompositingSurfaceSize;
+ /// a surface used to composite the frontbuffer image
+ ::cairo::SurfaceSharedPtr mpCompositingSurface;
+ ::basegfx::B2ISize maCompositingSurfaceSize;
+ bool mbCompositingSurfaceDirty;
+ /// a temporary surface that is guaranteed to be the same size
+ //as the compositing surface
+ ::cairo::SurfaceSharedPtr mpTemporarySurface;
};
}
commit 2884d2f9aafa8cb7cc11ae2f56f036e01e35e67f
Author: David Tardon <dtardon at redhat.com>
Date: Sat Jun 16 07:19:41 2012 +0200
change the way par files for ins are collected
This avoids the need for $(wildcard), which seemed to cause problems in
some cases (in gentoo ebuild) and I never found any missing dependency
that might account for it.
Change-Id: Ia03d630bb85309fbb7da3068c396834fb56cffb1
Signed-off-by: David Tardon <dtardon at redhat.com>
diff --git a/solenv/gbuild/InstallModule.mk b/solenv/gbuild/InstallModule.mk
index f1b9dbe..7ff5a9e 100644
--- a/solenv/gbuild/InstallModule.mk
+++ b/solenv/gbuild/InstallModule.mk
@@ -45,7 +45,6 @@ $(call gb_Package_Package_internal,$(1)_par,$(call gb_InstallModuleTarget_get_wo
$(call gb_InstallModule_get_target,$(1)) : $(call gb_InstallModuleTarget_get_target,$(1))
$(call gb_InstallModule_get_target,$(1)) : $(call gb_Package_get_target,$(1)_par)
$(call gb_InstallModule_get_target,$(1)) :| $(dir $(call gb_InstallModule_get_target,$(1))).dir
-$(call gb_Package_get_preparation_target,$(1)_par) :| $(call gb_InstallModuleTarget_get_target,$(1))
$(call gb_InstallModule_get_clean_target,$(1)) : $(call gb_InstallModuleTarget_get_clean_target,$(1))
$(call gb_InstallModule_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(1)_par)
@@ -89,12 +88,12 @@ $(call gb_InstallModuleTarget_use_packages,$(1),$(2))
endef
define gb_InstallModule__add_scpfile_impl
-$(call gb_Package_add_file,$(1)_par,par/osl/$(2),$(2))
+$(call gb_Package_add_file,$(1)_par,par/osl/$(notdir $(2)),$(2))
endef
define gb_InstallModule__add_scpfile
-$(call gb_InstallModule__add_scpfile_impl,$(1),$(notdir $(call gb_ScpTarget_get_target,$(2))))
+$(call gb_InstallModule__add_scpfile_impl,$(1),$(dir $(2))$(notdir $(call gb_ScpTarget_get_target,$(2))))
endef
@@ -123,6 +122,7 @@ endef
define gb_InstallModule_add_localized_scpfiles
$(call gb_InstallModuleTarget_add_localized_scpfiles,$(1),$(2))
+$(call gb_InstallModule__add_scpfiles,$(1),$(2))
endef
diff --git a/solenv/gbuild/InstallModuleTarget.mk b/solenv/gbuild/InstallModuleTarget.mk
index 1b717a7..3d7fcd0 100644
--- a/solenv/gbuild/InstallModuleTarget.mk
+++ b/solenv/gbuild/InstallModuleTarget.mk
@@ -265,15 +265,17 @@ endef
define gb_InstallModuleTarget__command
$(call gb_Output_announce,$(2),$(true),INM,3)
-$(foreach scpfile,$(SCP_FILES),$(call gb_Deliver_deliver,$(scpfile),$(3)/$(notdir $(scpfile))) &&) \
-touch $(1)
+$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(1) \
+ $(foreach scpfile,$(SCP_FILES),&& echo $(scpfile) >> $(1)) \
+)
endef
$(dir $(call gb_InstallModuleTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_InstallModuleTarget_get_target,%) :
- $(call gb_InstallModuleTarget__command,$@,$*,$(call gb_InstallModuleTarget_get_workdir,$*))
+ $(call gb_InstallModuleTarget__command,$@,$*)
$(call gb_InstallModuleTarget_get_external_target,%) :
touch $@
@@ -282,14 +284,12 @@ $(call gb_InstallModuleTarget_get_external_target,%) :
$(call gb_InstallModuleTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),INM,3)
rm -rf \
- $(call gb_InstallModuleTarget_get_workdir,$*) \
$(call gb_InstallModuleTarget_get_target,$*) \
$(call gb_InstallModuleTarget_get_external_target,$*)
define gb_InstallModuleTarget_InstallModuleTarget
$(call gb_InstallModuleTarget_get_target,$(1)) :| \
- $(call gb_InstallModuleTarget_get_external_target,$(1)) \
- $(call gb_InstallModuleTarget_get_workdir,$(1))/.dir
+ $(call gb_InstallModuleTarget_get_external_target,$(1))
$(call gb_InstallModuleTarget_get_external_target,$(1)) :| \
$(dir $(call gb_InstallModuleTarget_get_target,$(1))).dir
diff --git a/solenv/gbuild/InstallScript.mk b/solenv/gbuild/InstallScript.mk
index 506e7b3..35ea142 100644
--- a/solenv/gbuild/InstallScript.mk
+++ b/solenv/gbuild/InstallScript.mk
@@ -32,6 +32,10 @@ gb_InstallScriptTarget_COMMAND := $(PERL) $(gb_InstallScriptTarget_TARGET)
gb_InstallScriptTarget__make_arglist = $(subst $(WHITESPACE),$(COMMA),$(strip $(1)))
+define gb_InstallScriptTarget__get_files
+$(notdir $(shell cat $(foreach module,$(1),$(call gb_InstallModule_get_filelist,$(module)))))
+endef
+
# Pass first arg if make is running in silent mode, second arg otherwise
define gb_InstallScriptTarget__if_silent
$(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),$(1),$(2))
@@ -42,11 +46,11 @@ $(call gb_Output_announce,$(2),$(true),INS,4)
$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\
$(call gb_InstallScriptTarget__make_arglist,\
- $(notdir $(foreach module,$(SCP_MODULE_DIRS),$(wildcard $(module)/*$(SCP_SUFFIX))))) \
+ $(call gb_InstallScriptTarget__get_files,$(SCP_MODULES))) \
) && \
$(gb_InstallScriptTarget_COMMAND) \
$(call gb_InstallScriptTarget__if_silent,-q) \
- -i $(call gb_InstallScriptTarget__make_arglist,$(SCP_MODULE_DIRS) $(OUTDIR)/par) \
+ -i $(OUTDIR)/par/osl \
-o $(1) \
@@$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE} \
@@ -70,15 +74,14 @@ $(call gb_InstallScriptTarget_get_clean_target,%) :
# gb_InstallScriptTarget_InstallScriptTarget(<target>)
define gb_InstallScriptTarget_InstallScriptTarget
$(call gb_InstallScriptTarget_get_target,$(1)) :| $(dir $(call gb_InstallScriptTarget_get_target,$(1))).dir
-$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_MODULE_DIRS :=
-$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_SUFFIX := $(suffix $(call gb_ScpTarget_get_target,%))
+$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_MODULES :=
endef
define gb_InstallScriptTarget_use_module
-$(call gb_InstallScriptTarget_get_target,$(1)) : $(call gb_InstallModuleTarget_get_target,$(2))
-$(call gb_InstallScriptTarget_get_clean_target,$(1)) : $(call gb_InstallModuleTarget_get_clean_target,$(2))
-$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_MODULE_DIRS += $(call gb_InstallModuleTarget_get_workdir,$(2))
+$(call gb_InstallScriptTarget_get_target,$(1)) : $(call gb_InstallModule_get_target,$(2))
+$(call gb_InstallScriptTarget_get_clean_target,$(1)) : $(call gb_InstallModule_get_clean_target,$(2))
+$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_MODULES += $(2)
endef
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index ffd60b4..5a86504 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -94,10 +94,12 @@ gb_Extension_get_workdir = $(WORKDIR)/Extension/$(1)
gb_ExternalLib_get_workdir = $(WORKDIR)/ExternalLib/$(1)
gb_ExternalLib_get_builddir = $(WORKDIR)/ExternalLib/$(1)/build
gb_ExternalLib_get_target = $(WORKDIR)/ExternalLib/$(1).done
+gb_InstallModule_get_filelist = $(call gb_InstallModuleTarget_get_filelist,$(1))
gb_InstallModule_get_target = $(WORKDIR)/InstallModule/$(1).done
gb_InstallModuleTarget_get_external_target = $(WORKDIR)/InstallModuleTarget/$(1).external
-gb_InstallModuleTarget_get_target = $(WORKDIR)/InstallModuleTarget/$(1).done
-gb_InstallModuleTarget_get_workdir = $(WORKDIR)/InstallModuleTarget/$(1)
+gb_InstallModuleTarget_get_filelist = $(WORKDIR)/InstallModuleTarget/$(1).filelist
+gb_InstallModuleTarget_get_target = $(WORKDIR)/InstallModuleTarget/$(1).filelist
+gb_InstallModuleTarget_get_workdir = $(patsubst %/,%,$(dir $(call gb_ScpTarget_get_target,%)))
gb_InstallScriptTarget_get_target = $(WORKDIR)/InstallScriptTarget/$(1)$(gb_InstallScript_EXT)
gb_Jar_get_target = $(WORKDIR)/Jar/$(1).jar
gb_Jar_get_classsetname = Jar/$(1)
commit a125900b74b6503a0430be7505b0d85463d848f2
Author: David Tardon <dtardon at redhat.com>
Date: Tue Jun 12 12:50:24 2012 +0200
OSL_TRACE -> SAL_INFO
Change-Id: Icc6f47cc76dfa6716fc44f6c1b5f1b11ba1443c6
Signed-off-by: David Tardon <dtardon at redhat.com>
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index d6cc28f..e3d7969 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -209,7 +209,7 @@ namespace cairocanvas
return sal_False; // disposed, or otherwise dysfunctional
}
- OSL_TRACE("SpriteCanvasHelper::updateScreen called");
+ SAL_INFO("canvas.cairo", "SpriteCanvasHelper::updateScreen called");
const ::basegfx::B2ISize& rSize = mpOwningSpriteCanvas->getSizePixel();
@@ -233,7 +233,7 @@ namespace cairocanvas
}
else
{
- OSL_TRACE("SpriteCanvasHelper::updateScreen update ALL");
+ SAL_INFO("canvas.cairo", "SpriteCanvasHelper::updateScreen update ALL");
// background has changed, so we currently have no choice
// but repaint everything (or caller requested that)
@@ -294,7 +294,7 @@ namespace cairocanvas
mpOwningSpriteCanvas->getBufferSurface(),
"SpriteCanvasHelper::scrollUpdate(): NULL device pointer " );
- OSL_TRACE("SpriteCanvasHelper::scrollUpdate called");
+ SAL_INFO("canvas.cairo", "SpriteCanvasHelper::scrollUpdate called");
const ::basegfx::B2ISize& rSize = mpOwningSpriteCanvas->getSizePixel();
const ::basegfx::B2IRange aOutputBounds( 0,0,
@@ -415,7 +415,7 @@ namespace cairocanvas
mpOwningSpriteCanvas->getBufferSurface(),
"SpriteCanvasHelper::opaqueUpdate(): NULL device pointer " );
- OSL_TRACE("SpriteCanvasHelper::opaqueUpdate called");
+ SAL_INFO("canvas.cairo", "SpriteCanvasHelper::opaqueUpdate called");
const ::basegfx::B2ISize& rDeviceSize = mpOwningSpriteCanvas->getSizePixel();
@@ -457,7 +457,7 @@ namespace cairocanvas
const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites )
{
// TODO
- OSL_TRACE("SpriteCanvasHelper::genericUpdate called");
+ SAL_INFO("canvas.cairo", "SpriteCanvasHelper::genericUpdate called");
ENSURE_OR_THROW( mpOwningSpriteCanvas &&
mpOwningSpriteCanvas->getBufferSurface(),
commit 4c41cd13e814b88d7a5e3855d073a95201606747
Author: David Tardon <dtardon at redhat.com>
Date: Tue Jun 12 10:52:55 2012 +0200
missing intialization
Change-Id: I2350adf98e12b9c9cda4c18a6ba9f935016ac299
Signed-off-by: David Tardon <dtardon at redhat.com>
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 5fb3f30..d5628f7 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -119,6 +119,7 @@ void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc )
SwChartLockController_Helper::SwChartLockController_Helper( SwDoc *pDocument ) :
pDoc( pDocument )
+ , bIsLocked( false )
{
aUnlockTimer.SetTimeout( 1500 );
aUnlockTimer.SetTimeoutHdl( LINK( this, SwChartLockController_Helper, DoUnlockAllCharts ));
More information about the Libreoffice-commits
mailing list