Commit Graph

543 Commits

Author SHA1 Message Date
Hajime Hoshi
673556d03f internal/ui: move the error handlings to the ui package 2022-03-20 16:26:26 +09:00
Hajime Hoshi
cc574ad67e internal/atlas: rename functions: Area -> Region 2022-03-20 04:20:23 +09:00
Hajime Hoshi
b59dd45239 internal/buffered: separate ReplacePixels with the large-area and small-area versions
For the large-area version, this doesn't require a graphics driver.
This is necessary to ensure that ReplacePixels never needs a graphics
driver.
2022-03-20 04:13:31 +09:00
Hajime Hoshi
e78f34aa26 internal/ui: add Image
This is a preparation for a refactoring. Image will be a proxy to
pass a graphics driver to the lower layer.
2022-03-20 01:39:05 +09:00
Hajime Hoshi
86698481f6 ebiten: add a comment 2022-03-05 01:58:44 +09:00
Hajime Hoshi
4610505fc5 ebiten: check the current error at Set and ReplacePixels 2022-03-05 01:52:55 +09:00
Hajime Hoshi
9c6b7aaca3 internal/ui: catch the error at At correctly 2022-03-05 01:44:59 +09:00
divVerent
f2209a0b51
internal/atlas: optimization: send premultiplied alpha from vertex to fragment shader. (#1996)
Note that this applies only to the builtin shaders - interface for Kage stays
unchanged for compatibility.

Minor compatibility delta: when interpolating alpha values, previous code has
created nonsense values, such as, when interpolating from
fully-transparent-black (0,0,0,0) to opaque-white (1,1,1,1), something like
half-transparent-grey (0.25,0.25,0.25,0.5) where half-transparent-white
(0.5,0.5,0.5,0.5) is used by the new code.

I assume this is a strict improvement, however this may warrant some testing.

Possible later improvement could be moving the premultiplication from fragment
shader to CPU. Did not do this as it makes the code rather inconsistent of Kage
vs built-in shader usage.

Updates #1772
2022-02-24 02:27:50 +09:00
Hajime Hoshi
b282b1805b internal/ui: refactoring: add ui.SetError
This is a preparation to move uiContext to the package internal/ui.
2022-02-13 17:17:08 +09:00
Hajime Hoshi
df60c4c92d internal/driver: rename to internal/graphicsdriver 2022-02-06 20:41:32 +09:00
Bertrand Jung
8a2965ba4a
ebiten: fixed a wrong function name mentioned in panic (#1953) 2022-01-13 03:33:59 +09:00
Hajime Hoshi
e687865c8c ebiten: add ColorM.ScaleWithColor
Updates #1944
2022-01-10 17:36:46 +09:00
Hajime Hoshi
5f942150e0 ebiten: update comments about DrawImage 2021-12-14 20:37:29 +09:00
Hajime Hoshi
9787e076bc ebiten: Add comments about NewImage*
Closes #1894
2021-12-09 21:03:25 +09:00
Hajime Hoshi
42cd923418 ebiten: Add FillRule
Closes #1715
2021-09-19 17:17:00 +09:00
Hajime Hoshi
ba8ea50d57 ebiten: Follow image.RGBA64Image's aim
image.RGBA64Image aims to get 64bit color values efficiently to avoid
allocating an original color value and converting it to colorRGBA64.
Thus, we should avoid allocating color.RGBA for RGBA64At.

Updates #1769
2021-08-21 15:22:38 +09:00
Trevor Slocum
92d8562b1d
ebiten: Add (*Image).RGBA64At (#1773)
Closes #1769.
2021-08-21 15:15:48 +09:00
Hajime Hoshi
21aa96f9f5 internal/affine: Refactoring: Make ColorM interface 2021-07-27 12:10:22 +09:00
Hajime Hoshi
b466a0cbd7 ebiten: Add EvenOdd to DrawTrianglesOptions and DrawShaderTrianglesOptions
Updates #844
Closes #1684
2021-07-05 03:35:55 +09:00
Hajime Hoshi
66be53804d ebiten: Bug fix: Fill on a sub-image didn't work correctly
Closes #1691
2021-07-02 22:42:28 +09:00
Hajime Hoshi
d94a89f37b ebiten: Update the comments of (*Image).SubImage
Closes #1643
2021-05-13 21:23:17 +09:00
Hajime Hoshi
5c8d8ab2eb ebiten: Make NewImage/NewImageFromImage panic when RunGame finishes
Closes #1149
2021-04-03 18:44:43 +09:00
Hajime Hoshi
41f060b1d2 ebiten: Use the common vertices backend at DrawTriangles 2021-03-20 20:25:42 +09:00
Hajime Hoshi
26b9fa20c1 internal/graphics: Bug fix: Race condition at QuadVertices
QuadVertices or verticesBackend.slice reused its backend slice.
This caused a race condition. QuadVertices can be accessed from
multiple goroutines, and resetting the head and copying the data
at internal/graphicscommand might not be synced.

This change fixes this issue by basically reverting
9cb631e30f.

Closes #1546
2021-03-20 16:32:13 +09:00
Hajime Hoshi
b23dfff2ff ebiten: Refactoring 2021-01-31 22:45:47 +09:00
Hajime Hoshi
5a62587df5 ebiten: Bug fix: The vertex backend was not flushed when the screen is shrunk
The last parameter of QuadVertices represents whether we can flush
the backend vertices (on Wasm). The problem was that this was
unexpectedly false even though the image is the screen, when the
screen rendering is done with FilterLinear instead of FilterScreen.

Closes #1479
2021-01-31 22:37:18 +09:00
Hajime Hoshi
569964d7e4 Cache SubImage for the empty images 2021-01-25 01:31:18 +09:00
Hajime Hoshi
170ddd70a5 ebiten: Add comments 2020-11-08 04:12:48 +09:00
Hajime Hoshi
c7330883ef restorable: Remove Fill and make (*ebiten.Image).Fill available for sub-images
Now a scissor (a clipping region) can be specified, we don't have to
worry about the rendering results out of the specified region.
Replace the implmenetation of the Fill with just a DrawTriangles with
an empty white image.

As a side effect, SubImage is avilable for Fill.

Fixes #1416
2020-11-08 02:50:06 +09:00
Hajime Hoshi
ed028110cf ebiten: Allow rendering on a sub-image by scissor test
Fixes #1255
2020-11-08 00:58:44 +09:00
Hajime Hoshi
9464dc2f58 ebiten: Refactoring: canSkipMipmap 2020-10-31 02:59:48 +09:00
Hajime Hoshi
2259378430 ebiten: Panic immediately when zero size is given to NewImage(FromImage) 2020-10-23 00:42:57 +09:00
Hajime Hoshi
1b816eb249 ebiten: Remove the error returning value from NewImageFromImage
Updates #1380
2020-10-06 01:03:33 +09:00
Hajime Hoshi
c6053bcf14 ebiten: Remove the error returning value from NewImage
Updates #1380
2020-10-06 00:48:56 +09:00
Hajime Hoshi
54da0d9763 ebiten: Remove the returning value from (*Image).DrawImage
Updates #1380
2020-10-06 00:21:17 +09:00
Hajime Hoshi
04bbe1ebb6 ebiten: Remove the returning value from (*Image).ReplacePixels
Updates #1380
2020-10-06 00:16:18 +09:00
Hajime Hoshi
525d16bec8 ebiten: Remove the returning value from (*Image).Dispose
Updates #1380
2020-10-06 00:13:23 +09:00
Hajime Hoshi
c2ee8e8d59 ebiten: Remove returning values from (*Image).Clear and Fill
Updates #1380
2020-10-06 00:08:55 +09:00
Hajime Hoshi
83ead375a4 ebiten: Update comments 2020-10-05 02:00:50 +09:00
Hajime Hoshi
448a863eb1 ebiten: Remove FilterDefault
Fixes #503
2020-10-05 01:48:47 +09:00
Hajime Hoshi
fe97e7b0a5 ebiten: Remove the filter argument from NewImage and NewImageFromImage
Updates #503
2020-10-05 01:40:44 +09:00
Hajime Hoshi
2dadc6a7a9 ebiten: Make AddressUnsafe default
Fixes #1228
2020-10-04 23:49:35 +09:00
Hajime Hoshi
0c85100898 ebiten: Remove some deprecated members from DrawImageOptions
Updates #1127
2020-10-04 04:51:56 +09:00
Hajime Hoshi
1d4ff9a906 ebiten: Remove the deprecated functions and constants
Updates #1127
2020-10-04 04:47:24 +09:00
Hajime Hoshi
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
Bui Quoc Trong
0d29979296
Fix the comment style cause heading in pkgsite (#1369) 2020-09-29 16:55:39 +09:00
Hajime Hoshi
9f49e68fea ebiten: Add links to documents/shader.html 2020-09-23 16:45:00 +09:00
Hajime Hoshi
76b701a03d ebiten: Better comments about uniform variables 2020-09-23 16:24:41 +09:00
Hajime Hoshi
b2f6cc5791 ebiten: Revive DrawTrianglesShader
Updates #1325
2020-09-20 18:55:24 +09:00
Hajime Hoshi
938d78122f ebiten: Remove shaders from DrawImage
Updates #1325
2020-09-20 18:14:01 +09:00