diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-03-17 22:03:14 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-03-17 23:48:28 +0100 |
commit | 374efa7253703b054e4603c66aeba862e4e98574 (patch) | |
tree | 9a5dfebe75f425cfae3c264862c6acdb913dcd05 /drawinglayer | |
parent | ca25cdcb398f200ce5d53286eea02d49d8d1c5f4 (diff) |
Skeleton of drawinglayer object called OpenGLObject
- Shape name: com.sun.star.drawing.OpenGLObject
- Drawinglayer object: SdrOpenGLObject
- Uno object: SvxOpenGLObject
- View contact: ViewContactOfOpenGL
- Primitive: OpenGLPrimitive2D
Change-Id: I7fc0829d58cb4a8432d0e3007c90223707e5dd84
Diffstat (limited to 'drawinglayer')
5 files changed, 58 insertions, 2 deletions
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 21242a6e48dc..a4ef767f78e2 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -38,7 +38,7 @@ $(eval $(call gb_Library_use_libraries,drawinglayer,\ tk \ tl \ vcl \ - $(gb_UWINAPI) \ + $(gb_UWINAPI) \ )) $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ @@ -91,6 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/primitive2d/metafileprimitive2d \ drawinglayer/source/primitive2d/modifiedcolorprimitive2d \ drawinglayer/source/primitive2d/objectinfoprimitive2d \ + drawinglayer/source/primitive2d/openglprimitive2d \ drawinglayer/source/primitive2d/pagepreviewprimitive2d \ drawinglayer/source/primitive2d/patternfillprimitive2d \ drawinglayer/source/primitive2d/pointarrayprimitive2d \ diff --git a/drawinglayer/source/primitive2d/openglprimitive2d.cxx b/drawinglayer/source/primitive2d/openglprimitive2d.cxx new file mode 100644 index 000000000000..48724dfcf5b3 --- /dev/null +++ b/drawinglayer/source/primitive2d/openglprimitive2d.cxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <drawinglayer/primitive2d/openglprimitive2d.hxx> +#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx> + + +namespace drawinglayer +{ + namespace primitive2d + { + + OpenGLPrimitive2D::OpenGLPrimitive2D(const Point& rPos) + : m_aPos(rPos) + { + } + + bool OpenGLPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const + { + if(BasePrimitive2D::operator==(rPrimitive)) + { + const OpenGLPrimitive2D& rCompare = static_cast< const OpenGLPrimitive2D& >(rPrimitive); + return m_aPos == rCompare.getPos(); + } + return false; + } + + ImplPrimitive2DIDBlock(OpenGLPrimitive2D, PRIMITIVE2D_ID_OPENGLPRIMITIVE2D) + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index c1d83b90c679..5cc79818ea3c 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -44,6 +44,7 @@ #include <vcl/metaact.hxx> #include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx> #include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx> +#include <drawinglayer/primitive2d/openglprimitive2d.hxx> #include <comphelper/processfactory.hxx> #include <rtl/ustring.hxx> #include <com/sun/star/i18n/BreakIterator.hpp> @@ -2137,6 +2138,11 @@ namespace drawinglayer RenderEpsPrimitive2D(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate)); break; } + case PRIMITIVE2D_ID_OPENGLPRIMITIVE2D: + { + RenderOpenGLPrimitive2D(static_cast< const primitive2d::OpenGLPrimitive2D& >(rCandidate)); + break; + } default : { // process recursively diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 0063ad727085..a0e8b405df86 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -66,6 +66,8 @@ #include <basegfx/polygon/b2dtrapezoid.hxx> // <- for test +#include <drawinglayer/primitive2d/openglprimitive2d.hxx> + using namespace com::sun::star; namespace @@ -1584,6 +1586,14 @@ namespace drawinglayer } } + void VclProcessor2D::RenderOpenGLPrimitive2D(const primitive2d::OpenGLPrimitive2D& rCandidate) + { + // Just draw a dummy rect to see primitive rendering is working. + mpOutputDevice->SetLineColor(COL_BLACK); + mpOutputDevice->SetFillColor(COL_RED); + mpOutputDevice->DrawRect(Rectangle(rCandidate.getPos(),Size(2000,2000))); + } + // process support VclProcessor2D::VclProcessor2D( diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx b/drawinglayer/source/processor2d/vclprocessor2d.hxx index 38d96c83cc01..d4535fbc303b 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.hxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx @@ -52,6 +52,7 @@ namespace drawinglayer { namespace primitive2d { class EpsPrimitive2D; class SvgLinearAtomPrimitive2D; class SvgRadialAtomPrimitive2D; + class OpenGLPrimitive2D; }} @@ -107,7 +108,7 @@ namespace drawinglayer void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D& rCandidate); void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D& rCandidate); void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate); - + void RenderOpenGLPrimitive2D(const primitive2d::OpenGLPrimitive2D& rCandidate); // DrawMode adaption support void adaptLineToFillDrawMode() const; |