Commit Graph

1734 Commits

Author SHA1 Message Date
Hajime Hoshi
9467a67136 restorable: Bug fix: Skip clearImage on emptyImage when restoring 2019-08-15 21:53:43 +09:00
Hajime Hoshi
01297fe015 graphicsdriver: Fix a panic message 2019-08-15 21:29:37 +09:00
Hajime Hoshi
900af20617 shareable: Misspelling 2019-08-15 12:59:50 +09:00
Hajime Hoshi
f835c8ce7f uidriver/mobile: Convert a panic to an error for handling
This is a dirty hack but there is no other way to handle panics to
report to Crashlytics.
2019-08-13 11:30:50 +09:00
Hajime Hoshi
4373bd8b89 restorable: Unify locks with shareable's backendsM and fix the deadlock
This change should make Image operations cuncurrent safe.

Updates #913
Fixes #915
2019-08-13 00:49:47 +09:00
Hajime Hoshi
14ce0c1bcb restorable: Bug fix: Lock before resolving stale states 2019-08-12 23:31:17 +09:00
Hajime Hoshi
9dd501720e restorable: Bug fix: Unlocking should happen after restoring 2019-08-12 23:19:03 +09:00
Hajime Hoshi
1f66c155ae shareable: Bug fix: Lock when backends are allocated 2019-08-12 22:48:48 +09:00
Hajime Hoshi
cbf36734f8 shareable: Bug fix: mutex should not be used at finalizers
Updates #913
2019-08-12 21:01:33 +09:00
Hajime Hoshi
28dd2f6e19 shareable: Refactoring: only finalizers have to be cared
Only finalizers are problematic since they can stop everything,
but other things are not. Let's care finalizers and just use
regular locks.

Updates #913
2019-08-12 20:17:40 +09:00
Hajime Hoshi
eb5ab57cdc shareable: Bug fix: Defer Dispose so that ClearPixels doesn't affect other images later
Updates #913
2019-08-12 19:37:23 +09:00
Hajime Hoshi
613b9bc02a restorable: Panic if an image is stale when restoring 2019-08-12 17:45:43 +09:00
Hajime Hoshi
1156dfdc7e restorable: Lock At operation between frames
Updates #913
2019-08-12 16:54:17 +09:00
Hajime Hoshi
d2719188b4 restorable: Do not call resolveDeferred at the end of a frame
This does not make sense.
2019-08-12 16:48:04 +09:00
Hajime Hoshi
628a8d559a restorable: Bug fix: Dispose should be deferred between frames (again)
Updates #913
2019-08-12 16:27:07 +09:00
Hajime Hoshi
4717baa840 restorable: Bug fix: Dispose should be deferred between frames
Updates #913
2019-08-12 16:26:07 +09:00
Hajime Hoshi
1a2a0aeb76 restorable: Defer operations between the end and the beginning of frames
Updates #913
2019-08-12 16:08:21 +09:00
Hajime Hoshi
df8fdc855a Bug fix: Compile error on GOOS=linux CGO_ENABLED=0 2019-08-01 08:17:58 +09:00
Hajime Hoshi
2003b7d292 Fix misspellings 2019-08-01 01:07:23 +09:00
Hajime Hoshi
de915a1736 Move driver getters to graphicsdriver/uidriver packages
This enables to add internal functions to these packages so that
the driver selector logics can be modified.
2019-08-01 00:40:59 +09:00
Hajime Hoshi
4a9a7f936d Make go vet a little happier on macOS
Updates #889
2019-07-22 20:16:22 +09:00
Hajime Hoshi
e6a88a7d1f uidriver/glfw: Add panic in the case of Windows Remote Desktop
Updates #903
2019-07-21 23:41:55 +09:00
Hajime Hoshi
b348223297 restorable: Refactoring
Reduces accesses to Image member from outside.
2019-07-21 16:44:00 +09:00
Hajime Hoshi
434802af6e restorable: Reland: Refactoring
This is reland of 7917b423f4be9494125c8de76a8a3def15561594

Fixed a bug that an image passed to Apply might not be initialized,
and there was no correct way to treat such an image. Now Apply
accepts only an initialized image.
2019-07-21 14:18:27 +09:00
Hajime Hoshi
a3b35e5fba Revert "restorable: Refactoring"
This reverts commit 777cab5cc3.

Reason: Test failures: https://travis-ci.org/hajimehoshi/ebiten/builds/561553656
2019-07-21 14:03:14 +09:00
Hajime Hoshi
777cab5cc3 restorable: Refactoring 2019-07-21 11:05:02 +09:00
Hajime Hoshi
0cf11d9af8 graphicscommand: Improve debug messages
This change also enables to dump volatile images.
2019-07-20 14:31:28 +09:00
Hajime Hoshi
2d079b123f restorable: Add ResetRestoringState to reset the state
After Fill command, the image doesn't have to keep the restoring
information. Now Fill command is as same as DrawTriangles, there
is no way for restorable.Image to know whether it can reset the
state or not. ResetRestoringState clears the state explicitly.
2019-07-20 14:04:02 +09:00
Hajime Hoshi
3f6628f1cc restorable: Replace Fill with Clear 2019-07-20 05:00:05 +09:00
Hajime Hoshi
0dc1d0eba5 graphics: Clear/Fill is now implemented with DrawImage
Only clearing the screen still requires the special method.
2019-07-20 04:34:42 +09:00
Hajime Hoshi
0bf12d5519 graphics: Unify dumping logic 2019-07-20 01:46:33 +09:00
Hajime Hoshi
d78db1738d graphicscommand: Fix comments 2019-07-20 01:22:13 +09:00
Hajime Hoshi
94852b07b2 graphics: Use ID for dumped internal images
Updates #900
2019-07-19 23:41:56 +09:00
Hajime Hoshi
0793d35c40 graphicscommand: Improve debug messages
Fixes #900
2019-07-19 23:35:13 +09:00
Hajime Hoshi
38a1ee7f57 restorable: Split pixel records into regions
Fixes #897
2019-07-19 10:59:48 +09:00
Hajime Hoshi
b4dddd330a restorable: Refactoring: Use width/height instead of length at Pixels 2019-07-17 23:20:03 +09:00
Hajime Hoshi
efb6f9c453 graphicscommand: Remove CopyPixels command
This is an optimization. This change enables to avoid reading
pixels from GPU when extending an image.

Updates #897
2019-07-17 23:19:57 +09:00
Hajime Hoshi
736a840d53 restorable: More restricted Extend
As a side effect, ReplacePixels always record pixels even when
restoring is not needed. As CopyPixels reads pixels in any cases,
this shortcut was originally useless.
2019-07-17 22:15:37 +09:00
Hajime Hoshi
353d81fd58 restorable: Rename NewImageFromImage to Extend 2019-07-17 03:32:08 +09:00
Hajime Hoshi
91a4329f0d restorable: Disallow ReplacePixels for a part after Fill
This simplifies Pixels struct. This is a preparation to change
how to record pixels.

Updates #897
2019-07-17 03:15:03 +09:00
Hajime Hoshi
2735f4eddc restorable: Fix comments 2019-07-17 02:42:26 +09:00
Hajime Hoshi
349a290aa3 restorable: Refactoring 2019-07-16 03:08:26 +09:00
Hajime Hoshi
8ae2fef817 restorable: Refactoring: Do not have to update basePixels in some cases
If there is no draw-traiangles command, the image can keep its
basePixels.
2019-07-16 02:48:52 +09:00
Hajime Hoshi
6d20e3f951 restorable: Add assertion at fillImage 2019-07-16 02:18:52 +09:00
Hajime Hoshi
2b632d0707 restorable: Remove Pixels.Slice() 2019-07-16 02:03:15 +09:00
Hajime Hoshi
f3fa535afb restorable: Refactoring: Disallow nil at ReplacePixels 2019-07-16 01:44:56 +09:00
Hajime Hoshi
84aabd075f restorable: Use DrawTriangles to restore the image
This can avoid allocating a big byte slice.
2019-07-15 05:03:46 +09:00
Hajime Hoshi
7e4e9cc893 restorable: Refactoring 2019-07-15 04:17:52 +09:00
Hajime Hoshi
701c4eeb7c restorable: Fix comments 2019-07-15 03:24:18 +09:00
Hajime Hoshi
a7e7e007ca restorable: Bug fix: PutQuadVertices should take the source image
Fixes #898
2019-07-15 03:10:03 +09:00