[Libreoffice-commits] core.git: 2 commits - sdext/README slideshow/source

Michael Stahl mstahl at redhat.com
Fri Nov 10 22:55:41 UTC 2017


 sdext/README                                 |    5 +++++
 slideshow/source/engine/shapes/drawshape.cxx |   23 +++++++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit 99e373cd4c78084ded349f3e3de7b0504af2dd90
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Nov 10 23:28:19 2017 +0100

    slideshow: clip shapes in secondary screen window
    
    When using the presenter console, the secondary screen has
    a small view of the current slide.
    
    Currently nothing clips the shapes that are on the slide,
    so they may be rendered outside the slide rectangle,
    because there's a single VCL-canvas and OutPutDevice that covers
    the entire screen.
    
    Set up some brute force clipping in DrawShape::getViewRenderArgs().
    
    Change-Id: I3b21f08c12718254b6cf166b7fb1540e9381b243

diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx
index 00a8894f5ef0..c023119ded06 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -133,11 +133,26 @@ namespace slideshow
 
         ViewShape::RenderArgs DrawShape::getViewRenderArgs() const
         {
+            uno::Reference<beans::XPropertySet> const xPropSet(mxPage,
+                    uno::UNO_QUERY_THROW);
+            sal_Int32 nWidth = 0;
+            sal_Int32 nHeight = 0;
+            xPropSet->getPropertyValue("Width") >>= nWidth;
+            xPropSet->getPropertyValue("Height") >>= nHeight;
+            basegfx::B2DRectangle slideRect(0, 0, nWidth, nHeight);
+            basegfx::B2DRectangle origBounds(maBounds);
+            origBounds.intersect(slideRect);
+            basegfx::B2DRectangle updateBounds(getUpdateArea());
+            updateBounds.intersect(slideRect);
+            basegfx::B2DRectangle bounds(getBounds());
+            bounds.intersect(slideRect);
+            basegfx::B2DRectangle unitBounds(getActualUnitShapeBounds());
+            unitBounds.intersect(slideRect);
             return ViewShape::RenderArgs(
-                maBounds,
-                getUpdateArea(),
-                getBounds(),
-                getActualUnitShapeBounds(),
+                origBounds,
+                updateBounds,
+                bounds,
+                unitBounds,
                 mpAttributeLayer,
                 maSubsetting.getActiveSubsets(),
                 mnPriority);
commit 3c18e816c23f1e49a44b12cf7aee10c47af7e2ec
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Nov 10 23:27:02 2017 +0100

    sdext: document 2 different canvases
    
    Change-Id: Icb8815ed20b06d2f43fbfb0088e6bdd0d5b389f6

diff --git a/sdext/README b/sdext/README
index b43d62b1fa92..a4f5cf654a11 100644
--- a/sdext/README
+++ b/sdext/README
@@ -18,3 +18,8 @@ source/presenter/ - Impress / Presenter Console.
 	ridiculous situations. Activating in response to
 	configuration keys (for example), and the 'XPresenterHelper'
 	interface inside sd/ used to create and manage windows.
+
+    The main screen uses a hardware-accelerated
+    canvas (e.g. cairo canvas), while the entire secondary screen
+    uses a VCL-canvas that is created in
+    sd::framework::FullScreenPane::CreateCanvas().


More information about the Libreoffice-commits mailing list