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
d2a2eab9
Unverified
Commit
d2a2eab9
authored
Sep 11, 2023
by
Nikolai Rykunov
Committed by
GitHub
Sep 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change ordering of colors from RGBA to BGRA on DirectX offscreen rendering (#801)
parent
485fde3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
ClocksAwt.kt
.../SkiaAwtSample/src/main/kotlin/SkiaAwtSample/ClocksAwt.kt
+1
-1
directXSwingRedrawer.cc
skiko/src/awtMain/cpp/windows/directXSwingRedrawer.cc
+4
-4
Direct3DSwingRedrawer.kt
...kotlin/org/jetbrains/skiko/swing/Direct3DSwingRedrawer.kt
+1
-1
No files found.
samples/SkiaAwtSample/src/main/kotlin/SkiaAwtSample/ClocksAwt.kt
View file @
d2a2eab9
...
...
@@ -30,7 +30,7 @@ open class ClocksAwt(private val scaleProvider: () -> Float) : SkikoView {
override
fun
onRender
(
canvas
:
Canvas
,
width
:
Int
,
height
:
Int
,
nanoTime
:
Long
)
{
val
watchFill
=
Paint
().
apply
{
color
=
0
xFFFFFFFF
.
toInt
()
}
val
watchStroke
=
Paint
().
apply
{
color
=
0
xFF000000
.
toInt
()
color
=
Color
.
RED
mode
=
PaintMode
.
STROKE
strokeWidth
=
1f
}
...
...
skiko/src/awtMain/cpp/windows/directXSwingRedrawer.cc
View file @
d2a2eab9
...
...
@@ -57,7 +57,7 @@ public:
};
UINT
calculateRowPitch
(
UINT
width
)
{
UINT
rowPitch
=
width
*
4
;
// 4 bytes per pixel for DXGI_FORMAT_
R8G8B
8A8_UNORM
UINT
rowPitch
=
width
*
4
;
// 4 bytes per pixel for DXGI_FORMAT_
B8G8R
8A8_UNORM
rowPitch
=
(
rowPitch
+
(
D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
-
1
))
&
~
(
D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
-
1
);
return
rowPitch
;
}
...
...
@@ -79,7 +79,7 @@ public:
textureDesc
.
Height
=
_height
;
textureDesc
.
DepthOrArraySize
=
1
;
textureDesc
.
MipLevels
=
1
;
textureDesc
.
Format
=
DXGI_FORMAT_
R8G8B
8A8_UNORM
;
textureDesc
.
Format
=
DXGI_FORMAT_
B8G8R
8A8_UNORM
;
textureDesc
.
SampleDesc
.
Count
=
1
;
textureDesc
.
SampleDesc
.
Quality
=
0
;
textureDesc
.
Layout
=
D3D12_TEXTURE_LAYOUT_UNKNOWN
;
...
...
@@ -268,7 +268,7 @@ extern "C"
GrD3DTextureResourceInfo
texResInfo
=
{};
texResInfo
.
fResource
.
retain
(
resource
);
texResInfo
.
fResourceState
=
D3D12_RESOURCE_STATE_COMMON
;
texResInfo
.
fFormat
=
DXGI_FORMAT_
R8G8B
8A8_UNORM
;
texResInfo
.
fFormat
=
DXGI_FORMAT_
B8G8R
8A8_UNORM
;
texResInfo
.
fSampleCount
=
1
;
texResInfo
.
fLevelCount
=
1
;
GrBackendRenderTarget
*
renderTarget
=
new
GrBackendRenderTarget
(
texture
->
width
,
texture
->
height
,
texResInfo
);
...
...
@@ -346,7 +346,7 @@ extern "C"
dst
.
pResource
=
texture
->
readbackBufferResource
;
dst
.
Type
=
D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT
;
dst
.
PlacedFootprint
.
Offset
=
0
;
dst
.
PlacedFootprint
.
Footprint
.
Format
=
DXGI_FORMAT_
R8G8B
8A8_UNORM
;
dst
.
PlacedFootprint
.
Footprint
.
Format
=
DXGI_FORMAT_
B8G8R
8A8_UNORM
;
dst
.
PlacedFootprint
.
Footprint
.
Width
=
texture
->
width
;
dst
.
PlacedFootprint
.
Footprint
.
Height
=
texture
->
height
;
dst
.
PlacedFootprint
.
Footprint
.
Depth
=
1
;
...
...
skiko/src/awtMain/kotlin/org/jetbrains/skiko/swing/Direct3DSwingRedrawer.kt
View file @
d2a2eab9
...
...
@@ -66,7 +66,7 @@ internal class Direct3DSwingRedrawer(
context
,
renderTarget
,
SurfaceOrigin
.
TOP_LEFT
,
SurfaceColorFormat
.
RGB
A_8888
,
SurfaceColorFormat
.
BGR
A_8888
,
ColorSpace
.
sRGB
,
SurfaceProps
(
pixelGeometry
=
PixelGeometry
.
UNKNOWN
)
)
?.
autoClose
()
?:
throw
RenderException
(
"Cannot create surface"
)
...
...
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