Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
bfcb29f0
Unverified
Commit
bfcb29f0
authored
Oct 13, 2021
by
Nikolay Igotti
Committed by
GitHub
Oct 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix image pixels getter (#266)
parent
1239ae22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
Bitmap.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Bitmap.kt
+1
-1
Bitmap.cc
skiko/src/jvmMain/cpp/common/Bitmap.cc
+8
-11
No files found.
skiko/src/commonMain/kotlin/org/jetbrains/skia/Bitmap.kt
View file @
bfcb29f0
...
...
@@ -904,7 +904,7 @@ class Bitmap internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
srcY
:
Int
=
0
):
ByteArray
?
{
return
try
{
val
size
=
min
(
dstInfo
.
height
,
height
-
srcY
)
*
r
owBytes
val
size
=
min
(
dstInfo
.
height
,
height
-
srcY
)
*
dstR
owBytes
Stats
.
onNativeCall
()
withNullableResult
(
ByteArray
(
size
))
{
...
...
skiko/src/jvmMain/cpp/common/Bitmap.cc
View file @
bfcb29f0
...
...
@@ -237,12 +237,9 @@ extern "C" JNIEXPORT jboolean JNICALL Java_org_jetbrains_skia_BitmapKt__1nReadPi
static_cast
<
SkColorType
>
(
colorType
),
static_cast
<
SkAlphaType
>
(
alphaType
),
sk_ref_sp
<
SkColorSpace
>
(
colorSpace
));
if
(
instance
->
readPixels
(
imageInfo
,
result_bytes
,
rowBytes
,
srcX
,
srcY
))
{
jboolean
result
=
instance
->
readPixels
(
imageInfo
,
result_bytes
,
rowBytes
,
srcX
,
srcY
);
env
->
ReleaseByteArrayElements
(
readBytes
,
result_bytes
,
0
);
return
true
;
}
else
{
return
false
;
}
return
result
;
}
extern
"C"
JNIEXPORT
jboolean
JNICALL
Java_org_jetbrains_skia_BitmapKt__1nExtractAlpha
...
...
@@ -253,14 +250,14 @@ extern "C" JNIEXPORT jboolean JNICALL Java_org_jetbrains_skia_BitmapKt__1nExtrac
SkIPoint
offset
;
jint
*
result_int
=
env
->
GetIntArrayElements
(
resultPoint
,
NULL
);
if
(
instance
->
extractAlpha
(
dst
,
paint
,
&
offset
))
{
jboolean
result
=
instance
->
extractAlpha
(
dst
,
paint
,
&
offset
);
if
(
result
)
{
result_int
[
0
]
=
offset
.
fX
;
result_int
[
1
]
=
offset
.
fY
;
env
->
ReleaseIntArrayElements
(
resultPoint
,
result_int
,
0
);
return
true
;
}
else
{
return
false
;
}
env
->
ReleaseIntArrayElements
(
resultPoint
,
result_int
,
0
);
return
result
;
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_BitmapKt__1nPeekPixels
...
...
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