Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_shadingobject.cpp
Go to the documentation of this file.
1
// Copyright 2016 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"core/fpdfapi/page/cpdf_shadingobject.h"
8
9
#
include
<
utility
>
10
11
#
include
"core/fpdfapi/page/cpdf_shadingpattern.h"
12
13
CPDF_ShadingObject::
CPDF_ShadingObject
(int32_t content_stream,
14
RetainPtr
<CPDF_ShadingPattern> pattern,
15
const
CFX_Matrix
& matrix)
16
:
CPDF_PageObject
(
content_stream
)
,
17
m_pShading
(
std
::
move
(
pattern
)),
18
m_Matrix
(
matrix
)
{}
19
20
CPDF_ShadingObject::~
CPDF_ShadingObject
() =
default
;
21
22
CPDF_PageObject
::
Type
CPDF_ShadingObject::
GetType
()
const
{
23
return
Type
::
kShading
;
24
}
25
26
void
CPDF_ShadingObject::
Transform
(
const
CFX_Matrix
& matrix) {
27
CPDF_ClipPath
& clip_path =
mutable_clip_path
();
28
if
(clip_path
.
HasRef
(
)
) {
29
clip_path
.
Transform
(
matrix
)
;
30
}
31
32
m_Matrix
.
Concat
(
matrix
)
;
33
if
(clip_path
.
HasRef
(
)
) {
34
CalcBoundingBox
(
)
;
35
}
else
{
36
SetRect
(
matrix.TransformRect(
GetRect
())
)
;
37
}
38
SetDirty
(
true
);
39
}
40
41
bool
CPDF_ShadingObject::
IsShading
()
const
{
42
return
true
;
43
}
44
45
CPDF_ShadingObject* CPDF_ShadingObject::
AsShading
() {
46
return
this
;
47
}
48
49
const
CPDF_ShadingObject* CPDF_ShadingObject::
AsShading
()
const
{
50
return
this
;
51
}
52
53
void
CPDF_ShadingObject::
CalcBoundingBox
() {
54
if
(!
clip_path
().HasRef()) {
55
return
;
56
}
57
SetRect
(
clip_path
().GetClipBox()
)
;
58
}
CFX_Matrix
Definition
fx_coordinates.h:452
CFX_Matrix::Concat
void Concat(const CFX_Matrix &right)
Definition
fx_coordinates.h:490
CFX_Matrix::CFX_Matrix
CFX_Matrix(const CFX_Matrix &other)=default
CPDF_ClipPath
Definition
cpdf_clippath.h:22
CPDF_ClipPath::Transform
void Transform(const CFX_Matrix &matrix)
Definition
cpdf_clippath.cpp:121
CPDF_ClipPath::HasRef
bool HasRef() const
Definition
cpdf_clippath.h:32
CPDF_PageObject
Definition
cpdf_pageobject.h:27
CPDF_PageObject::SetRect
void SetRect(const CFX_FloatRect &rect)
Definition
cpdf_pageobject.h:70
CPDF_PageObject::SetDirty
void SetDirty(bool value)
Definition
cpdf_pageobject.h:63
CPDF_PageObject::CPDF_PageObject
CPDF_PageObject(int32_t content_stream)
Definition
cpdf_pageobject.cpp:13
CPDF_PageObject::Type
Type
Definition
cpdf_pageobject.h:30
CPDF_PageObject::Type::kShading
@ kShading
CPDF_PageObject::clip_path
const CPDF_ClipPath & clip_path() const
Definition
cpdf_pageobject.h:100
CPDF_PageObject::GetRect
const CFX_FloatRect & GetRect() const
Definition
cpdf_pageobject.h:71
CPDF_PageObject::mutable_clip_path
CPDF_ClipPath & mutable_clip_path()
Definition
cpdf_pageobject.h:101
CPDF_ShadingObject::IsShading
bool IsShading() const override
Definition
cpdf_shadingobject.cpp:41
CPDF_ShadingObject::~CPDF_ShadingObject
~CPDF_ShadingObject() override
CPDF_ShadingObject::AsShading
const CPDF_ShadingObject * AsShading() const override
Definition
cpdf_shadingobject.cpp:49
CPDF_ShadingObject::AsShading
CPDF_ShadingObject * AsShading() override
Definition
cpdf_shadingobject.cpp:45
CPDF_ShadingObject::CPDF_ShadingObject
CPDF_ShadingObject(int32_t content_stream, RetainPtr< CPDF_ShadingPattern > pattern, const CFX_Matrix &matrix)
Definition
cpdf_shadingobject.cpp:13
CPDF_ShadingObject::GetType
Type GetType() const override
Definition
cpdf_shadingobject.cpp:22
CPDF_ShadingObject::CalcBoundingBox
void CalcBoundingBox()
Definition
cpdf_shadingobject.cpp:53
CPDF_ShadingObject::Transform
void Transform(const CFX_Matrix &matrix) override
Definition
cpdf_shadingobject.cpp:26
fxcrt::RetainPtr
Definition
retain_ptr.h:29
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfapi
page
cpdf_shadingobject.cpp
Generated on Thu Nov 14 2024 00:55:56 for Qt by
1.12.0