/src/libreoffice/vcl/source/outdev/fill.cxx
Line | Count | Source |
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 | | |
29 | | void OutputDevice::SetFillColor() |
30 | 455k | { |
31 | 455k | if ( mpMetaFile ) |
32 | 189k | mpMetaFile->AddAction( new MetaFillColorAction( Color(), false ) ); |
33 | | |
34 | 455k | if ( mbFillColor ) |
35 | 105k | { |
36 | 105k | mbInitFillColor = true; |
37 | 105k | mbFillColor = false; |
38 | 105k | maFillColor = COL_TRANSPARENT; |
39 | 105k | } |
40 | 455k | } |
41 | | |
42 | | void OutputDevice::SetFillColor( const Color& rColor ) |
43 | 3.70M | { |
44 | 3.70M | Color aColor(vcl::drawmode::GetFillColor(rColor, GetDrawMode(), GetSettings().GetStyleSettings())); |
45 | | |
46 | 3.70M | if ( mpMetaFile ) |
47 | 62.4k | mpMetaFile->AddAction( new MetaFillColorAction( aColor, true ) ); |
48 | | |
49 | 3.70M | if ( maFillColor != aColor ) |
50 | 114k | { |
51 | 114k | mbInitFillColor = true; |
52 | 114k | mbFillColor = true; |
53 | 114k | maFillColor = aColor; |
54 | 114k | } |
55 | 3.70M | } |
56 | | |
57 | | void OutputDevice::InitFillColor() |
58 | 26.2k | { |
59 | 26.2k | DBG_TESTSOLARMUTEX(); |
60 | | |
61 | 26.2k | if( mbFillColor ) |
62 | 24.6k | { |
63 | 24.6k | if( RasterOp::N0 == meRasterOp ) |
64 | 511 | mpGraphics->SetROPFillColor( SalROPColor::N0 ); |
65 | 24.1k | else if( RasterOp::N1 == meRasterOp ) |
66 | 687 | mpGraphics->SetROPFillColor( SalROPColor::N1 ); |
67 | 23.4k | else if( RasterOp::Invert == meRasterOp ) |
68 | 445 | mpGraphics->SetROPFillColor( SalROPColor::Invert ); |
69 | 22.9k | else |
70 | 22.9k | mpGraphics->SetFillColor( maFillColor ); |
71 | 24.6k | } |
72 | 1.64k | else |
73 | 1.64k | { |
74 | 1.64k | mpGraphics->SetFillColor(); |
75 | 1.64k | } |
76 | | |
77 | 26.2k | mbInitFillColor = false; |
78 | 26.2k | } |
79 | | |
80 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |