Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
04036b2b
Commit
04036b2b
authored
Jul 18, 2007
by
Sven Langkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a unittest where bltMask fails
svn path=/trunk/koffice/; revision=689390
parent
7faaa3b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
krita/image/tests/kis_painter_test.cpp
krita/image/tests/kis_painter_test.cpp
+37
-0
krita/image/tests/kis_painter_test.h
krita/image/tests/kis_painter_test.h
+2
-0
No files found.
krita/image/tests/kis_painter_test.cpp
View file @
04036b2b
...
@@ -168,6 +168,43 @@ void KisPainterTest::testPaintDeviceBltMaskIrregular()
...
@@ -168,6 +168,43 @@ void KisPainterTest::testPaintDeviceBltMaskIrregular()
allCsApplicator
(
&
KisPainterTest
::
testPaintDeviceBltMaskIrregular
);
allCsApplicator
(
&
KisPainterTest
::
testPaintDeviceBltMaskIrregular
);
}
}
void
KisPainterTest
::
testPaintDeviceBltMaskInverted
(
KoColorSpace
*
cs
)
{
KisPaintDeviceSP
dst
=
new
KisPaintDevice
(
cs
,
"dst"
);
KisPaintDeviceSP
src
=
new
KisPaintDevice
(
cs
,
"src"
);
src
->
fill
(
0
,
0
,
30
,
30
,
KoColor
(
Qt
::
red
,
128
,
cs
).
data
()
);
QCOMPARE
(
src
->
exactBounds
(),
QRect
(
0
,
0
,
30
,
30
)
);
KisPixelSelectionSP
mask
=
KisPixelSelectionSP
(
new
KisPixelSelection
(
dst
));
mask
->
select
(
QRect
(
10
,
10
,
20
,
20
));
mask
->
invert
();
QCOMPARE
(
mask
->
selectedExactRect
(),
QRect
(
10
,
10
,
20
,
20
)
);
KisPainter
painter
(
dst
);
painter
.
bltMask
(
0
,
0
,
dst
->
colorSpace
()
->
compositeOp
(
COMPOSITE_OVER
),
src
,
mask
,
OPACITY_OPAQUE
,
0
,
0
,
30
,
30
);
painter
.
end
();
QImage
img
=
dst
->
convertToQImage
(
0
);
img
.
save
(
"bla_"
+
cs
->
name
()
+
".png"
);
QCOMPARE
(
dst
->
exactBounds
(),
QRect
(
0
,
0
,
30
,
30
)
);
}
void
KisPainterTest
::
testPaintDeviceBltMaskInverted
()
{
allCsApplicator
(
&
KisPainterTest
::
testPaintDeviceBltMaskInverted
);
}
void
KisPainterTest
::
testSelectionBltMask
()
void
KisPainterTest
::
testSelectionBltMask
()
{
{
...
...
krita/image/tests/kis_painter_test.h
View file @
04036b2b
...
@@ -31,6 +31,7 @@ private:
...
@@ -31,6 +31,7 @@ private:
void
allCsApplicator
(
void
(
KisPainterTest
::*
funcPtr
)(
KoColorSpace
*
cs
)
);
void
allCsApplicator
(
void
(
KisPainterTest
::*
funcPtr
)(
KoColorSpace
*
cs
)
);
void
testPaintDeviceBltMask
(
KoColorSpace
*
cs
);
void
testPaintDeviceBltMask
(
KoColorSpace
*
cs
);
void
testPaintDeviceBltMaskIrregular
(
KoColorSpace
*
cs
);
void
testPaintDeviceBltMaskIrregular
(
KoColorSpace
*
cs
);
void
testPaintDeviceBltMaskInverted
(
KoColorSpace
*
cs
);
...
@@ -38,6 +39,7 @@ private slots:
...
@@ -38,6 +39,7 @@ private slots:
void
testPaintDeviceBltMask
();
// Square selection
void
testPaintDeviceBltMask
();
// Square selection
void
testPaintDeviceBltMaskIrregular
();
// Irregular selection
void
testPaintDeviceBltMaskIrregular
();
// Irregular selection
void
testPaintDeviceBltMaskInverted
();
// Inverted selection
void
testSelectionBltMask
();
// Square selection
void
testSelectionBltMask
();
// Square selection
void
testSelectionBltMaskIrregular
();
// Irregular selection
void
testSelectionBltMaskIrregular
();
// Irregular selection
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment