/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include #include #include #include #include "cachedprimitivebase.hxx" #include using namespace ::com::sun::star; namespace cppcanvas::internal { CachedPrimitiveBase::CachedPrimitiveBase( const CanvasSharedPtr& rCanvas, bool bOnlyRedrawWithSameTransform ) : mpCanvas( rCanvas ), mxCachedPrimitive(), maLastTransformation(), mbOnlyRedrawWithSameTransform( bOnlyRedrawWithSameTransform ) { // TODO(F2): also store last view transform, and refuse to // redraw if changed. } bool CachedPrimitiveBase::render( const ::basegfx::B2DHomMatrix& rTransformation ) const { SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::CachedPrimitiveBase::render()" ); SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::CachedPrimitiveBase: 0x" << std::hex << this ); const rendering::ViewState& rViewState( mpCanvas->getViewState() ); ::basegfx::B2DHomMatrix aTotalTransform; ::canvas::tools::getViewStateTransform( aTotalTransform, rViewState ); aTotalTransform *= rTransformation; // can we use the cached primitive? For that, it must be // present in the first place, and, if // mbOnlyRedrawWithSameTransform is true, the overall // transformation must be the same. if( mxCachedPrimitive.is() && (!mbOnlyRedrawWithSameTransform || maLastTransformation == aTotalTransform) ) { if( mxCachedPrimitive->redraw( rViewState ) == rendering::RepaintResult::REDRAWN ) { // cached repaint succeeded, done. return true; } } maLastTransformation = aTotalTransform; // delegate rendering to derived classes return renderPrimitive( mxCachedPrimitive, rTransformation ); } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -24.04.6 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2016-01-10Fix typosAndrea Gelmini
2016-01-05RC4 encrypt some WMF and TIFF test filesMichael Stahl
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
2015-11-06loplugin:stringconstant: elide explicit ctor usage (manually due to macros)Stephan Bergmann
2015-11-06loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)Stephan Bergmann
2015-11-05use uno::Reference::set method instead of assignmentNoel Grandin
2015-11-04yyyyyNoel Grandin
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
2015-09-30Fix typosAndrea Gelmini
2015-09-15Use CPPUNIT_ASSERT_EQUALStephan Bergmann
2015-08-24Clean up outputStephan Bergmann
2015-08-24Make test order deterministicStephan Bergmann
2015-08-06unotest.py: call the magic bootstrap init function once onlyMichael Stahl
2015-07-30loplugin:unusedmethodsNoel Grandin
2015-06-26Python 2.7 compatibility for unotest.pyMatthew J. Francis
2015-06-25improve the error message when a java UNO test failsNoel Grandin
2015-06-23Uno api sidebar unit test tdf#91806Laurent Godard
2015-06-11java:remove more unnecessary catch/re-throwNoel Grandin
2015-04-01simplifyStephan Bergmann
2015-03-31MacrosTest::loadFromDesktop: use comphelper::containerToSequence()Miklos Vajna
2015-03-30WaE: passing [...] by value, rather pass by referenceTor Lillqvist
2015-03-30Unit tests for SkipImagesLászló Németh
2015-03-29The --nofirststartwizard option is a no-opTor Lillqvist
2015-03-19convert SFX_FILTER_ constants to enum classNoel Grandin
2015-03-18create new 'enum class' SotClipboardFormatId to unify typesNoel Grandin
2015-02-23unotest: unobootstrapprotector needs runtime dependency on unorcMichael Stahl
2015-02-09Adapt file URL hackery to WindowsStephan Bergmann
2015-02-05convert all remaining BOOST_STATIC_ASSERT to static_assertCaolán McNamara
2015-02-03copy test file to workdir to avoid overwritingLionel Elie Mamane
2015-01-12java: simplify sleeping and waiting in testsNoel Grandin
2015-01-05java: remove more dead codeNoel Grandin
2015-01-05java: remove dead codeNoel Grandin
2014-12-18unotest: Use appropriate OUString functions on string constantsStephan Bergmann
2014-12-11java: reduce visibility of fields and methodsNoel Grandin
2014-11-19tweak the assert message so its readable when an errors happensCaolán McNamara
2014-11-18java: make fields final where possibleNoel Grandin
2014-11-05markup with event type not checker typeCaolán McNamara
2014-10-30document array_vs_singleton dismissalsCaolán McNamara
2014-10-22framework, unotest: do not override UserInstallation from environmentMichael Stahl
2014-10-07fdo84315: add integration test for basic LibreOffice Base functionalityBjoern Michaelsen
2014-10-01unotest: the assigned value is never usedRobert Antoni Buj i Gelonch
2014-10-01fdo#82577: Handle TimeNoel Grandin
2014-09-29unotest: remove import from the same packageRobert Antoni Buj i Gelonch
2014-08-20java: remove unnecessary constructor declarationsNoel Grandin
2014-08-19java: no need to instantiate String objects directlyNoel Grandin
2014-08-19java: use 'Integer.valueOf' instead of 'new Integer'Noel Grandin
2014-08-12java: remove useless javadoc tagsNoel Grandin
2014-08-12java: add @Override annotation to overriding methodsNoel Grandin
2014-08-08java: remove exceptions from throws clauses that are notNoel Grandin
2014-08-08java: remove unnecessary semi-colonsNoel Grandin