LibreOffice Module vcl (master) 1
fill.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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#include <tools/debug.hxx>
21
22#include <vcl/metaact.hxx>
23#include <vcl/settings.hxx>
24#include <vcl/virdev.hxx>
25
26#include <drawmode.hxx>
27#include <salgdi.hxx>
28
30{
31
32 if ( mpMetaFile )
34
35 if ( mbFillColor )
36 {
37 mbInitFillColor = true;
38 mbFillColor = false;
40 }
41
42 if( mpAlphaVDev )
44}
45
46void OutputDevice::SetFillColor( const Color& rColor )
47{
48 Color aColor(vcl::drawmode::GetFillColor(rColor, GetDrawMode(), GetSettings().GetStyleSettings()));
49
50 if ( mpMetaFile )
51 mpMetaFile->AddAction( new MetaFillColorAction( aColor, true ) );
52
53 if ( aColor.IsTransparent() )
54 {
55 if ( mbFillColor )
56 {
57 mbInitFillColor = true;
58 mbFillColor = false;
60 }
61 }
62 else
63 {
64 if ( maFillColor != aColor )
65 {
66 mbInitFillColor = true;
67 mbFillColor = true;
68 maFillColor = aColor;
69 }
70 }
71
72 if( mpAlphaVDev )
74}
75
77{
79
80 if( mbFillColor )
81 {
84 else if( RasterOp::N1 == meRasterOp )
86 else if( RasterOp::Invert == meRasterOp )
88 else
90 }
91 else
92 {
94 }
95
96 mbInitFillColor = false;
97}
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
bool IsTransparent() const
void AddAction(const rtl::Reference< MetaAction > &pAction)
Definition: gdimtf.cxx:585
bool mbFillColor
Definition: outdev.hxx:247
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:185
SAL_DLLPRIVATE void InitFillColor()
Definition: fill.cxx:76
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:182
RasterOp meRasterOp
Definition: outdev.hxx:232
void SetFillColor()
Definition: fill.cxx:29
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:196
DrawModeFlags GetDrawMode() const
Definition: outdev.hxx:487
Color maFillColor
Definition: outdev.hxx:227
const AllSettings & GetSettings() const
Definition: outdev.hxx:288
bool mbInitFillColor
Definition: outdev.hxx:249
virtual void SetFillColor()=0
virtual void SetROPFillColor(SalROPColor nROPColor)=0
constexpr ::Color COL_ALPHA_OPAQUE(0xff, 0xff, 0xff)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_TESTSOLARMUTEX()
Color GetFillColor(Color const &rColor, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
Definition: drawmode.cxx:67