summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-13 10:10:17 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-13 10:15:08 +0100
commitf6ef7e33b034d4ee5fb85ae4b72d8d255fbed2b6 (patch)
tree7b380ff59088c930d26432f015991975db1819b9
parent1c482cb54b4dab4c5b549ecd2395104f042e4101 (diff)
slideshow: add "glitter" slide transition
Change-Id: Ie89b64c4399cd0092eee579660c9fe85f8ca8e73
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu13
-rw-r--r--oox/source/ppt/slidetransition.cxx4
-rw-r--r--oox/source/ppt/slidetransitioncontext.cxx1
-rw-r--r--sd/qa/unit/data/AllTransitions.odpbin13630 -> 13684 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx5
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx16
-rw-r--r--sd/xml/transitions-ogl.xml3
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx67
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx1
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx4
10 files changed, 105 insertions, 9 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
index 0dd2fe92041e..f0fe30ec1704 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
@@ -1605,6 +1605,14 @@
<value xml:lang="en-US">Ripple</value>
</prop>
</node>
+ <node oor:name="glitter" oor:op="replace">
+ <prop oor:name="Group" oor:type="xs:string">
+ <value>exciting</value>
+ </prop>
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Glitter</value>
+ </prop>
+ </node>
</node>
<node oor:name="TransitionVariants">
<node oor:name="plain" oor:op="replace">
@@ -2348,6 +2356,11 @@
<value>ripple</value>
</prop>
</node>
+ <node oor:name="glitter" oor:op="replace">
+ <prop oor:name="Set" oor:type="xs:string">
+ <value>glitter</value>
+ </prop>
+ </node>
</node>
</node>
<node oor:name="Presets">
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index 0fe0b10a6fec..e5e87c9e6d72 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -413,6 +413,10 @@ namespace oox { namespace ppt {
mnTransitionType = TransitionType::MISCSHAPEWIPE;
mnTransitionSubType = TransitionSubType::HORIZONTAL;
break;
+ case P14_TOKEN(glitter):
+ mnTransitionType = TransitionType::MISCSHAPEWIPE;
+ mnTransitionSubType = TransitionSubType::DIAMOND;
+ break;
default:
mnTransitionType = 0;
break;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index a5d5496fe025..0d0c783d28f6 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -131,6 +131,7 @@ SlideTransitionContext::~SlideTransitionContext() throw()
case PPT_TOKEN( wedge ):
case P14_TOKEN( vortex ):
case P14_TOKEN( ripple ):
+ case P14_TOKEN( glitter ):
// CT_Empty
if (!mbHasTransition)
{
diff --git a/sd/qa/unit/data/AllTransitions.odp b/sd/qa/unit/data/AllTransitions.odp
index 35b7a49f79a1..11c7c9c520a0 100644
--- a/sd/qa/unit/data/AllTransitions.odp
+++ b/sd/qa/unit/data/AllTransitions.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index b0dcb74807a1..ba6c3092d3f7 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1424,8 +1424,11 @@ void SdExportTest::testExportTransitionsPPTX()
// RIPPLE
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 71, TransitionType::MISCSHAPEWIPE, TransitionSubType::HORIZONTAL));
+ // GLITTER
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 72, TransitionType::MISCSHAPEWIPE, TransitionSubType::DIAMOND));
+
// NEWSFLASH
- CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 72, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 73, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 257de7ca769f..95d6b38e7738 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -523,15 +523,17 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
sal_Int32 nTransition = 0;
const char* pDirection = nullptr;
- const char* pDirection14 = nullptr;
const char* pOrientation = nullptr;
const char* pThruBlk = nullptr;
const char* pSpokes = nullptr;
+
char pSpokesTmp[2] = "0";
// p14
sal_Int32 nTransition14 = 0;
+ const char* pDirection14 = nullptr;
const char* pInverted = nullptr;
+ const char* pPattern = nullptr; // diamond or hexagon
//p15
const char* pPresetTransition = nullptr;
@@ -581,13 +583,20 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
pPresetTransition = "fallOver";
bOOXmlSpecificTransition = true;
break;
- case animations::TransitionSubType::CORNERSIN:
+ case animations::TransitionSubType::CORNERSIN: // Inside turning cube
pInverted = "true";
- case animations::TransitionSubType::CORNERSOUT:
+ case animations::TransitionSubType::CORNERSOUT: // Outside turning cube
nTransition = XML_fade;
nTransition14 = XML_prism;
bOOXmlSpecificTransition = true;
break;
+ case animations::TransitionSubType::DIAMOND: // Glitter
+ nTransition = XML_fade;
+ nTransition14 = XML_glitter;
+ pDirection14 = "l";
+ pPattern = "hexagon";
+ bOOXmlSpecificTransition = true;
+ break;
}
break;
}
@@ -644,6 +653,7 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
pFS->singleElementNS(XML_p14, nTransition14,
XML_isInverted, pInverted,
XML_dir, pDirection14,
+ XML_pattern, pPattern,
FSEND );
}
else if (pPresetTransition)
diff --git a/sd/xml/transitions-ogl.xml b/sd/xml/transitions-ogl.xml
index d5411334117a..d149c21b9abb 100644
--- a/sd/xml/transitions-ogl.xml
+++ b/sd/xml/transitions-ogl.xml
@@ -65,6 +65,9 @@
<anim:par pres:preset-id="ripple">
<anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="horizontal"/>
</anim:par>
+ <anim:par pres:preset-id="glitter">
+ <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="diamond"/>
+ </anim:par>
<anim:par pres:preset-id="zoom-rotate-in">
<anim:transitionFilter smil:type="zoom" smil:subtype="rotateIn"/>
</anim:par>
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index cf79ead9ad27..3b3d581fb57f 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -836,6 +836,20 @@ std::shared_ptr<OGLTransitionImpl> makeHelix( sal_uInt16 nRows )
return makeSimpleTransition(aLeavingSlide, aEnteringSlide);
}
+float fdiv(int a, int b)
+{
+ return static_cast<float>(a)/b;
+}
+
+glm::vec2 vec(float x, float y, float nx, float ny)
+{
+ x = x < 0.0 ? 0.0 : x;
+ x = x > nx ? nx : x;
+ y = y < 0.0 ? 0.0 : y;
+ y = y > ny ? ny : y;
+ return glm::vec2(fdiv(x, nx), fdiv(y, ny));
+}
+
std::shared_ptr<OGLTransitionImpl> makeNByMTileFlip( sal_uInt16 n, sal_uInt16 m )
{
double invN(1.0/static_cast<double>(n));
@@ -1649,11 +1663,6 @@ std::shared_ptr<OGLTransitionImpl> makeDissolve()
namespace
{
-float fdiv(int a, int b)
-{
- return static_cast<float>(a)/b;
-}
-
class VortexTransition : public ShaderTransition
{
public:
@@ -1863,6 +1872,54 @@ std::shared_ptr<OGLTransitionImpl> makeRipple()
return makeRippleTransition(aLeavingSlide, aEnteringSlide, aSettings);
}
+std::shared_ptr<OGLTransitionImpl> makeGlitter()
+{
+ const int NX = 30, NY = 30;
+
+ Primitives_t aLeavingSlide;
+ Primitives_t aEnteringSlide;
+
+ for (int y = 0; y < NY+2; y+=2)
+ {
+ for (int x = 0; x < NX+2; x+=2)
+ {
+ Primitive Slide;
+
+ if (y % 4 == 0)
+ {
+ Slide.pushTriangle(vec(x-1, y-1, NX, NY), vec(x, y-2, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x, y-2, NX, NY), vec(x+1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x+1, y-1, NX, NY), vec(x+1, y, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x+1, y, NX, NY), vec(x, y+1, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x, y+1, NX, NY), vec(x-1, y, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x-1, y, NX, NY), vec(x-1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+ }
+ else
+ {
+ Slide.pushTriangle(vec(x-2, y-1, NX, NY), vec(x-1, y-2, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x-1, y-2, NX, NY), vec(x, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x, y-1, NX, NY), vec(x, y, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x, y, NX, NY), vec(x-1, y+1, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x-1, y+1, NX, NY), vec(x-2, y, NX, NY), vec(x, y+0.5, NX, NY));
+ Slide.pushTriangle(vec(x-2, y, NX, NY), vec(x-2, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+ }
+
+ glm::vec3 center = Slide.getVertices()[2];
+
+ float random = comphelper::rng::uniform_real_distribution(-0.2, std::nextafter(0.2, DBL_MAX));
+
+ Slide.Operations.push_back(makeSRotate(glm::vec3(0, 1, 0), center, 180 , true, fdiv(x, NX) + random , 1.0));
+
+ aLeavingSlide.push_back (Slide);
+
+ Slide.Operations.push_back(makeSRotate(glm::vec3(0, 1, 0), center, 180 , false, fdiv(x, NX) + random, 1.0));
+ aEnteringSlide.push_back (Slide);
+ }
+ }
+
+ return makeSimpleTransition(aLeavingSlide, aEnteringSlide);
+}
+
std::shared_ptr<OGLTransitionImpl> makeNewsflash()
{
Primitive Slide;
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
index 7193b6d98a93..f7e26651d517 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
@@ -236,6 +236,7 @@ std::shared_ptr<OGLTransitionImpl> makeStatic();
std::shared_ptr<OGLTransitionImpl> makeDissolve();
std::shared_ptr<OGLTransitionImpl> makeVortex();
std::shared_ptr<OGLTransitionImpl> makeRipple();
+std::shared_ptr<OGLTransitionImpl> makeGlitter();
std::shared_ptr<OGLTransitionImpl> makeNewsflash();
/** 2D replacements
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index be0686c82325..04c86b13260c 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -1432,6 +1432,7 @@ public:
case animations::TransitionSubType::CORNERSOUT: // 12
case animations::TransitionSubType::VERTICAL: // 13
case animations::TransitionSubType::HORIZONTAL: // 14
+ case animations::TransitionSubType::DIAMOND: // 26
case animations::TransitionSubType::CIRCLE: // 27
case animations::TransitionSubType::FANOUTHORIZONTAL: // 55
case animations::TransitionSubType::ACROSS: // 108
@@ -1520,6 +1521,9 @@ public:
case animations::TransitionSubType::ACROSS:
pTransition = makeNByMTileFlip(8,6);
break;
+ case animations::TransitionSubType::DIAMOND:
+ pTransition = makeGlitter();
+ break;
}
} else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) {
pTransition = makeFadeSmoothly();