Hajime Hoshi
ff62876552
Add Metal implementation
...
Fixes #621
2018-12-20 02:37:10 +09:00
Hajime Hoshi
5d0420cea0
graphicscommand: Simplify Image
...
First I thought Metal requried an initialization process by
replacing pixels, but now this is not needed. Initialize images by
the dummy texture.
2018-12-16 22:36:03 +09:00
Hajime Hoshi
f85a62c6a7
restorable: Rename dummyImage -> emptyImage
2018-12-01 21:49:41 +01:00
Hajime Hoshi
3f75da5f35
restorable: Refactoring: Remove newImageWithoutInit
2018-12-01 21:36:51 +01:00
Hajime Hoshi
c6dd0a75d9
graphicscommand: Optimize replace-image calls
...
Now ReplacePixels command is called only when necessary.
This also ensures that DrawImage must be called after ReplacePixels
is called since there is a potential problem that rendering images
on a texture without initializing by replacing pixels might cause
problems (escpecially on Metal. Perhaps #593 might be related).
2018-12-01 21:36:47 +01:00
Hajime Hoshi
247e4f5b6b
restorable: Skip initializing the screen image
2018-11-30 00:19:52 +01:00
Hajime Hoshi
962a11468b
restorable: Fix clearing logic
...
Fixes #740
2018-11-28 23:00:24 +01:00
Hajime Hoshi
1f538af440
restorable: Refactoring
2018-11-24 21:08:28 +09:00
Hajime Hoshi
14f5a03a79
Merge math and graphics packages
2018-11-17 20:23:12 +09:00
Hajime Hoshi
bc3ca38f76
opengl: Rename ResetGLState -> Reset and other functions
2018-11-01 03:02:08 +09:00
Hajime Hoshi
b2b09ccec0
restorable: Avoid memory allocating when an entire image is cleared
2018-10-30 11:08:38 +09:00
Hajime Hoshi
ce1c616f69
Merge graphics and graphicsutil
2018-10-28 23:03:06 +09:00
Hajime Hoshi
ff54d3b681
Move CompositeMode to graphics package
2018-10-28 21:49:47 +09:00
Hajime Hoshi
06f2052817
Add graphics package and move Filter to graphics
2018-10-28 20:25:52 +09:00
Hajime Hoshi
2da5192510
Rename graphics -> graphicscommand
2018-10-28 20:10:05 +09:00
Hajime Hoshi
690c3cf981
graphics: Embed 'scale' part of the color matrix
...
If the color matrix includes only 'scale' part, they are embedded
into vertices in order to reduce draw calls.
Fixes #662
2018-08-10 23:20:55 +09:00
Hajime Hoshi
1aabdd58f1
restorable: Fix comments
2018-08-09 01:27:38 +09:00
Hajime Hoshi
3daaef2cab
restorable: Refactoring: Use ReplacePixels(nil, ...) for clearing an image
2018-08-09 01:16:46 +09:00
Hajime Hoshi
c68c36b0b7
restoreable: Add ClearState to clear the state explicitly
...
Fixes #566
2018-08-09 00:12:45 +09:00
Hajime Hoshi
77e905eb25
Revert "graphics: Embed color matrices values to vertices ( #655 )"
...
This reverts commit 5a9235aaf9
.
2018-08-06 01:44:31 +09:00
Hajime Hoshi
d7d02e6d6a
Reland: graphics: mipmap images should be volatile when the base image is volatile
...
This is not a bug fix, but should improve performance.
2018-07-30 00:26:36 +09:00
Hajime Hoshi
5be58086b5
Revert "graphics: Bug fix: mipmap images should be volatile when the base image is volatile"
...
This reverts commit 0f82330009
.
2018-07-29 23:58:46 +09:00
Hajime Hoshi
0f82330009
graphics: Bug fix: mipmap images should be volatile when the base image is volatile
2018-07-29 23:54:46 +09:00
Hajime Hoshi
5a9235aaf9
graphics: Embed color matrices values to vertices ( #655 )
...
Fixes #531
2018-07-26 11:37:27 +09:00
Hajime Hoshi
5249afc06b
graphicsutil: Add QuadIndices
2018-07-21 03:40:37 +09:00
Hajime Hoshi
6c8b7f8e9c
graphics: Refactoring: Reduce error propagations
2018-07-12 03:08:50 +09:00
Hajime Hoshi
840c4d24df
graphicsutil: Accept matrix parameters directly for performance
2018-06-19 00:19:32 +09:00
Hajime Hoshi
a3c754d2cc
graphics: Restrict QuadVertices to allow only power of 2 sizes
...
Now QuadVertices can skip calculating power of 2 values.
2018-06-17 23:05:19 +09:00
Hajime Hoshi
ac24a8382f
graphicsutil: Extract matrix applying for performance
2018-06-17 19:45:09 +09:00
Hajime Hoshi
95561bbf6b
affine: Use float32 values for GeoM
...
float32 was slow on GopherJS, but not slow on Wasm.
2018-06-17 15:38:10 +09:00
Hajime Hoshi
4c2fc30311
graphicsutil: Don't allow nil GeoM
2018-06-17 01:48:56 +09:00
Hajime Hoshi
b4ace53596
affine: Remove GeoM to avoid GeoM allocations on the heap
2018-06-17 00:59:50 +09:00
Hajime Hoshi
3ee76ffd8e
graphicsutil: Move vertices.go to graphicsutil
2018-06-10 23:08:22 +09:00
Hajime Hoshi
9745ccee47
restorable: Make (*Image).DrawImage accept vertices and indices
2018-06-10 22:59:00 +09:00
Hajime Hoshi
97a54548df
restorable: Rename vertices -> quadVertices
2018-06-10 20:41:17 +09:00
Hajime Hoshi
600983e028
restorable: Record indices for restoring
2018-06-10 20:17:48 +09:00
Hajime Hoshi
2e5e7e6e24
restorable: Remove merging commands for code simplicity
2018-06-10 20:06:17 +09:00
Hajime Hoshi
03079ba067
restorable: Refactoring
2018-06-10 18:40:46 +09:00
Hajime Hoshi
c782380a1c
restorable: Specify indices from restorable package
2018-06-10 18:17:58 +09:00
Hajime Hoshi
2853895e6b
graphics: Refactoring: Rename functions
2018-06-10 17:53:57 +09:00
Hajime Hoshi
916c7aac8a
restorable: Fix comments
2018-04-29 13:49:33 +09:00
Hajime Hoshi
45afb6db67
Reland: restorable: Merge Clear to ReplacePixel
2018-04-29 13:40:18 +09:00
Hajime Hoshi
613f384cb5
graphics: Add EBITEN_DUMP_IMAGES_KEY
...
Fixes #589
2018-04-28 22:08:20 +09:00
Hajime Hoshi
eb357f61b5
restorable: Bug fix: Calling At must resolve the image's stale state
2018-04-28 21:56:20 +09:00
Hajime Hoshi
0bc712422f
restorable: Bug fix: Remove SetFinalizer for disposing
...
SetFinalizer causes concurrent issue
2018-04-27 12:08:59 +09:00
Hajime Hoshi
1cf4f30541
Revert "restorable: Merge Clear to ReplacePixels"
...
This reverts commit fb641d88cd
.
Reason: When restoring the image where ReplacePixels is called,
dummyImage might not be restored since there is no record of
relationships between this image and dummyImage. Now pixels is not
nil when reverting by chance, but this would cause problems in the
future.
2018-04-25 22:31:48 +09:00
Hajime Hoshi
fb641d88cd
restorable: Merge Clear to ReplacePixels
...
This can avoid unnecessary stale images that requires loading
pixels from GPU.
2018-04-25 01:30:57 +09:00
Hajime Hoshi
9902497e3d
test: Use flock to make tests exclusive
...
Fixes #575
2018-04-07 00:59:52 +09:00
Hajime Hoshi
cc725b99af
restorable: Replace emptyImage with dummyImage
2018-04-06 03:08:52 +09:00
Hajime Hoshi
70f16daafd
restorable: Fix tests (wrong assumption was used)
2018-04-06 02:15:49 +09:00
Hajime Hoshi
7b5ad46e49
shareable: NewImage* now returns a cleared image
2018-04-06 02:08:12 +09:00
Hajime Hoshi
24e20306f2
restorable: Move 'putting random-colored dot' to restorable
2018-04-05 11:18:28 +09:00
Hajime Hoshi
c767c0631e
restorable: Remove unneeded mutex
2018-03-25 23:40:39 +09:00
Hajime Hoshi
97ce612785
Refactoring: Don't access restorable package directly from ebiten package
2018-03-25 23:37:32 +09:00
Hajime Hoshi
125e5c4f32
restorable: Bug fix: Image must be protected with locks ( #567 )
2018-03-25 22:31:51 +09:00
Hajime Hoshi
e2632e358e
restorable: Add TestDoubleResolve
2018-03-25 21:09:26 +09:00
Hajime Hoshi
025fd00e6b
restorable: Bug fix: Make the image stale when pixels are partly replaced
2018-03-25 20:39:06 +09:00
Hajime Hoshi
fc47d2843a
restorable: Add TestRestoreChain2
2018-03-25 19:43:32 +09:00
Hajime Hoshi
c47b549fd1
restorable: Refactoring: Make functions more atomic
2018-03-25 18:21:43 +09:00
Hajime Hoshi
99f72a1b64
restorable: Bug fix: commands must be flushed at At
2018-03-25 01:26:43 +09:00
Hajime Hoshi
8149ace52c
restorable: Add TestDispose
2018-03-25 00:50:11 +09:00
Hajime Hoshi
0acf021e03
restorable: Dispose images explicitly when restoring ( #567 )
2018-03-24 23:27:08 +09:00
Hajime Hoshi
1616373819
restorable: Ensure the given image is not nil at makeStaleIfDependingOn
2018-03-24 21:57:22 +09:00
Hajime Hoshi
be4e3ab801
restorable: Bug fix: partial ReplacePixels broke the image state ( #562 )
2018-03-20 02:14:00 +09:00
Hajime Hoshi
9d37221743
restorable: Refactoring
2018-03-19 23:55:06 +09:00
Hajime Hoshi
b5d065151a
restorable: Don't flatten vertices until actually needed
2018-03-18 23:54:45 +09:00
Hajime Hoshi
de3a8d8893
restorable: Remove comments
2018-03-18 18:14:11 +09:00
Hajime Hoshi
00d8e793d9
restorable: Remove MaxImageSize
2018-03-09 02:50:38 +09:00
Hajime Hoshi
4ae9d5780c
graphics: Implement shared texture ( #514 )
2018-03-03 19:54:53 +09:00
Hajime Hoshi
247cd6e1c3
Add graphicsutil package
2018-03-02 12:34:56 +09:00
Hajime Hoshi
d4112004b0
graphics: Move calculating source region from restorable package
2018-03-02 12:20:44 +09:00
Hajime Hoshi
d0592d30e0
graphics: Improve clearing the offscreen performance
2018-03-02 01:55:40 +09:00
Hajime Hoshi
dada2e060a
restorable: Bug fix: Don't use graphics.Image for clearing framebuffer
2018-03-02 01:05:54 +09:00
Hajime Hoshi
cd8368deaf
restorable: Add TODO comment
2018-03-02 00:00:09 +09:00
Hajime Hoshi
db738676ce
restorable: Refactoring: clearIfVolatile
2018-03-01 23:13:23 +09:00
Hajime Hoshi
b8deabbd94
graphics: Reland: Bug fix: a too old frame was rendered at least on Android
...
Fixes #525
2018-03-01 23:05:28 +09:00
Hajime Hoshi
1a898dd1b9
Add comments
2018-03-01 02:49:45 +09:00
Hajime Hoshi
676a023a30
restorable: Remove unneeded NextPowerOf2Int usage
2018-03-01 02:45:23 +09:00
Hajime Hoshi
1068156215
restorable: Add restoring case to TestReplacePixels
2018-03-01 02:43:59 +09:00
Hajime Hoshi
127f6c09c8
graphics: Specify rect to glTexSubImage2D
2018-03-01 01:58:09 +09:00
Hajime Hoshi
9f6fd0db9a
graphics: Use the original width/height for glTexSubImage2D
2018-03-01 00:47:37 +09:00
Hajime Hoshi
02b4fc7917
graphics: Reduce num of Image.Clear() calls
2018-02-28 23:11:12 +09:00
Hajime Hoshi
9db042ae9e
graphics: Refactoring: easier way to clear framebuffer
2018-02-28 22:46:57 +09:00
Hajime Hoshi
8ef0f1ac6a
restorable: Avoid unneeded discarding images
2018-02-28 15:56:51 +09:00
Hajime Hoshi
2f1908b05c
restorable: Use nil instead of empty affine.ColorM
2018-02-28 02:14:10 +09:00
Hajime Hoshi
8c8e512059
affine: User nillable pattern for ColorM
2018-02-28 02:14:06 +09:00
Hajime Hoshi
adbd0db765
restorable: Accept source rect and geom instead of vertices
2018-02-27 01:35:30 +09:00
Hajime Hoshi
519a75e5a8
restorable: Bug fix: Clearing framebuffers was not complete
2018-02-25 23:53:27 +09:00
Hajime Hoshi
85b133dad0
graphics: Remove NewImageFromImage command
2018-02-25 23:22:49 +09:00
Hajime Hoshi
9adc1ac6a0
Revert "graphics: Refactoring: clearing framebuffer"
...
This reverts commit 58f5c9c1d0
.
Fixes #515
2018-02-25 22:04:04 +09:00
Hajime Hoshi
58f5c9c1d0
graphics: Refactoring: clearing framebuffer
2018-02-24 23:51:05 +09:00
Hajime Hoshi
a2d40e0908
graphics: Remove offsetX/offsetY from framebuffer
2018-02-24 23:35:55 +09:00
Hajime Hoshi
9da5099060
graphics: Refactoring: Flip Y by geometry matrix instead of projection matrix
2018-02-24 23:32:36 +09:00
Hajime Hoshi
a644e92298
restorable: Better calculation to clear restorable.Image
2018-02-24 21:16:30 +09:00
Hajime Hoshi
da20b3f49a
restorable: Bug fix: Clear screen framebuffer on fullscreen mode
...
Fixes #513
2018-02-24 20:48:47 +09:00
Hajime Hoshi
fe7aae32a0
restorable: Remove graphics.Image.Fill usage
2018-02-24 16:18:18 +09:00
Hajime Hoshi
2ba89591db
restorable: Remove Fill
2018-02-24 15:14:53 +09:00
Hajime Hoshi
2507379494
restorable: Skip resolving stale images when possible
2018-02-23 03:19:20 +09:00
Hajime Hoshi
6ef4bbde2d
graphics: Add FilterDefault; Make DrawImageOptions specify Filter ( #453 )
2018-02-14 02:59:44 +09:00
Hajime Hoshi
595e654123
graphics: Bug fix: pixels read from GPU might include errors ( #492 )
2018-02-03 16:43:42 +09:00
Hajime Hoshi
65b71ad79d
restorabel: uint8 -> byte
2018-02-03 16:36:43 +09:00
Hajime Hoshi
80596820cf
graphics: Replace []uint8 with []byte
2018-01-28 22:40:36 +09:00
seebs
0b7ba8e573
Do GeoM projection on CPU ( #477 )
...
Handling GeoM projection on CPU may seem like a weird choice, given
how fast GPU is, but it pays off:
* You only have to do a very small subset of the actual matrix
multiply.
* You don't have to construct a matrix in the vertex shader.
* Six fewer float32 values per vertex.
* You do still have to do the matrix computation for each vertex,
though.
Signed-off-by: Seebs <seebs@seebs.net>
2018-01-14 16:01:55 +09:00
Hajime Hoshi
723d153800
Reland(2): graphics: Appropriate rendering of edges on linear filter
2017-12-12 00:03:01 +09:00
Hajime Hoshi
362d1c417f
Revert 'graphics: Appropriate rendering of edges on linear filter (Reland)' ( #458 )
2017-12-11 20:30:54 +09:00
Hajime Hoshi
1152439e65
graphics: Appropriate rendering of edges on linear filter (Reland)
...
Fixes #456
2017-12-07 02:26:16 +09:00
Hajime Hoshi
8091aa5190
Revert 'graphics: Appropriate rendering of edges on linear filter' #456
2017-12-06 23:40:29 +09:00
Hajime Hoshi
bc0432f310
graphics: Appropriate rendering of edges on linear filter
...
Fixes #315
2017-12-06 21:40:24 +09:00
Hajime Hoshi
8e7e960b56
graphics: Limit source-rectangle range
...
Remove texture adjustment introduced due to #317
2017-12-02 23:13:44 +09:00
Hajime Hoshi
6145ecee74
graphics: Misspelling
2017-09-21 23:33:27 +09:00
Hajime Hoshi
b47e564762
graphics: Add comments
2017-09-20 01:35:56 +09:00
Hajime Hoshi
05d91eac09
restorable: Fix misspelling
2017-09-15 03:13:36 +09:00
Hajime Hoshi
f16b5d9c10
restorable: Rename variables
2017-09-15 01:14:09 +09:00
Hajime Hoshi
ccddf3c4ac
restorable: Refactoring: Remove arguments from NewImageFromImage
2017-09-15 00:51:17 +09:00
Hajime Hoshi
ca4a2d8209
restorable: Bug fix: Fix tests
2017-09-15 00:49:07 +09:00
Hajime Hoshi
2881d3fc4c
restorable: Add comments
2017-09-15 00:39:49 +09:00
Hajime Hoshi
80940f9070
restorable: Add comments
2017-09-15 00:24:18 +09:00
Hajime Hoshi
b51d93a707
restorable: Add comments
2017-09-12 03:14:13 +09:00
Hajime Hoshi
9ab517cf82
restorable: Refactoring
2017-08-07 00:06:35 +09:00
Hajime Hoshi
1fb7e123c2
Remove dependencies on internal/graphics from ebiten
2017-08-06 21:34:24 +09:00
Hajime Hoshi
c0ecb7a386
graphics: Move CopyImage to restorable
2017-08-06 21:21:38 +09:00
Hajime Hoshi
631264fce1
Add 'internal/math' package
2017-08-06 20:05:14 +09:00
Hajime Hoshi
c3202b8e58
audio: Adjust the buffer size
2017-07-13 23:48:03 +09:00
Hajime Hoshi
3a3a4af035
graphics: Avoid type assertions for Fill
2017-07-02 21:32:07 +09:00
Hajime Hoshi
364819f361
restorable: Disable restoring on desktops and mobile browsers ( #380 )
2017-07-02 15:58:00 +09:00
Hajime Hoshi
565a28ff04
restorable: Merge draw image history items if possible ( #379 )
2017-07-02 02:21:23 +09:00
Hajime Hoshi
979836d0f5
restorable: Refactoring: move and rename a const
2017-07-02 01:41:07 +09:00
Hajime Hoshi
c694851765
ui: Center the screen on fullscreen mode ( #374 )
2017-07-01 04:12:09 +09:00
Hajime Hoshi
ad1f1263f7
restorable: Bug fix: wrong topological sort ( #359 )
2017-06-03 02:41:37 +09:00
Hajime Hoshi
2680884566
restorable: Test bug fix
2017-06-02 22:00:02 +09:00
Hajime Hoshi
eb66f5c569
restorable: Add tests for complex graph ( #357 )
2017-06-02 21:58:26 +09:00
Hajime Hoshi
f41541a254
restorable: Enable TestRestoreRecursive again
2017-06-02 02:15:32 +09:00
Hajime Hoshi
1d66ebc854
restorable: Bug fix: topological sort is required to restore images correctly ( #357 )
2017-06-01 10:44:28 +09:00
Hajime Hoshi
967e737760
restorable: Temporarily disable a failed test
2017-06-01 02:42:43 +09:00
Hajime Hoshi
82f102c422
restorable: Add TestRestoreRecursive ( #265 ) ( #357 )
2017-06-01 02:37:57 +09:00
Hajime Hoshi
baeadfb7fe
restorable: Add tests ( #265 ) ( #357 )
2017-06-01 01:27:56 +09:00
Hajime Hoshi
7d181e3182
opengl: Hide OpenGL context usages into internal/graphics package
2017-05-31 02:18:04 +09:00
Hajime Hoshi
5a4a82ab50
restorable: Add TODO comments ( #357 )
2017-05-30 03:31:29 +09:00
Hajime Hoshi
d220e300ab
restorable: Fix doc
2017-05-30 02:06:45 +09:00
Hajime Hoshi
a5f80c3716
restorable: VRAM -> GPU
2017-05-30 01:28:23 +09:00
Hajime Hoshi
a816c9c7fe
Reduce defer sentences for performance
2017-05-27 21:35:38 +09:00
Hajime Hoshi
1b1b996817
graphics: Avoid copying ColorM
2017-05-27 16:17:49 +09:00
Hajime Hoshi
1b72263ce1
sync: Add sync package
2017-05-27 02:37:01 +09:00
Hajime Hoshi
951e5bccef
restorable: Remove Images()
2017-05-04 00:08:07 +09:00
Hajime Hoshi
8b48d010ed
restorable: Refactoring
2017-05-03 23:24:00 +09:00
Hajime Hoshi
bc105e7350
restorable: Unexport functions
2017-05-03 23:18:35 +09:00
Hajime Hoshi
aa5c278445
restorable: Unexport add
2017-05-03 23:15:18 +09:00
Hajime Hoshi
9f5cf48d24
restorable: Move Images to resotrable package
2017-05-03 23:11:43 +09:00
Hajime Hoshi
d94e9c9d86
restorable: Bug fix: Make limit to the number of draw-image command history ( #349 )
2017-05-03 22:16:32 +09:00
Hajime Hoshi
76ad9cf42b
doc: Fix comments
2017-05-03 01:08:27 +09:00