LibreOffice Module cppcanvas (master) 1
cachedprimitivebase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/uno/Reference.hxx>
23#include <com/sun/star/rendering/XCachedPrimitive.hpp>
24
26#include <cppcanvas/canvas.hxx>
27
28#include <action.hxx>
29
30namespace basegfx { class B2DHomMatrix; }
31
32
33/* Definition of internal::CachedPrimitiveBase class */
34
35namespace cppcanvas::internal
36 {
47 {
48 public:
61 bool bOnlyRedrawWithSameTransform );
62
65
66 virtual bool render( const ::basegfx::B2DHomMatrix& rTransformation ) const override;
67
68 protected:
69 using Action::render;
70
71 private:
72 virtual bool renderPrimitive( css::uno::Reference< css::rendering::XCachedPrimitive >& rCachedPrimitive,
73 const ::basegfx::B2DHomMatrix& rTransformation ) const = 0;
74
76 mutable css::uno::Reference< css::rendering::XCachedPrimitive > mxCachedPrimitive;
77 mutable ::basegfx::B2DHomMatrix maLastTransformation;
79 };
80
81}
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface for internal render actions.
Definition: action.hxx:42
virtual bool render(const ::basegfx::B2DHomMatrix &rTransformation) const =0
Render this action to the associated canvas.
Base class providing cached re-rendering, if XCanvas returns XCachedPrimitive.
mutable::basegfx::B2DHomMatrix maLastTransformation
css::uno::Reference< css::rendering::XCachedPrimitive > mxCachedPrimitive
virtual bool render(const ::basegfx::B2DHomMatrix &rTransformation) const override
Render this action to the associated canvas.
virtual bool renderPrimitive(css::uno::Reference< css::rendering::XCachedPrimitive > &rCachedPrimitive, const ::basegfx::B2DHomMatrix &rTransformation) const =0
CachedPrimitiveBase(const CachedPrimitiveBase &)=delete
CachedPrimitiveBase(CanvasSharedPtr xCanvas, bool bOnlyRedrawWithSameTransform)
Constructor.
const CachedPrimitiveBase & operator=(const CachedPrimitiveBase &)=delete
std::shared_ptr< Canvas > CanvasSharedPtr