Please sign in to comment.
Moved repeatingness into Image and out of ImageLayer.
This eliminates one potential cause of wackiness (that undoubtedly no one ever ran into) which is that the same image could be used in a layer that repeats in x but not y and in another that repeats in y but not x and the image would end up repeating one of the two ways (depending on which was drawn first). This also makes it possible to draw a repeated image in a Surface by just drawing the image at a larger size, instead of having to do the cumbersome combination of setFillPattern and fillRect. It also allows Image to avoid using unnecessary GPU memory in the case of repeated images. Previously they would resolve the unrepeatable texture (which is needed to create the repeatable texture) and then leave it in memory because it wasn't easy to know whether the image would be used for repeatyness or not. Now an image *only* has either a repeatable texure or an unrepeatable texture. Lastly, it simplifies some things for a forthcoming change which will introduce SurfaceImage (which will further simplify the API and allow surfaces to be shared between multiple layers, which is currently not possible). This does prevent code from using the same image as a repeating image and a non-repeating image, but I highly doubt anyone is doing that. If you are, just make a copy of the image.
- Loading branch information...
Showing with 151 additions and 152 deletions.
- +2 −2 android/src/playn/android/AndroidCanvasImage.java
- +28 −13 core/src/playn/core/Image.java
- +0 −12 core/src/playn/core/ImageLayer.java
- +1 −1 core/src/playn/core/Surface.java
- +6 −6 core/src/playn/core/gl/AbstractSurfaceGL.java
- +52 −36 core/src/playn/core/gl/ImageGL.java
- +1 −12 core/src/playn/core/gl/ImageLayerGL.java
- +16 −20 core/src/playn/core/gl/ImageRegionGL.java
- +21 −1 flash/src/playn/flash/FlashImage.java
- +3 −17 flash/src/playn/flash/FlashImageLayer.java
- +2 −2 html/src/playn/html/HtmlCanvasImage.java
- +6 −17 html/src/playn/html/HtmlImageLayerCanvas.java
- +2 −2 ios/src/playn/ios/IOSCanvasImage.java
- +2 −2 java/src/playn/java/JavaCanvasImage.java
- +4 −4 tests/core/src/main/java/playn/tests/core/CanvasTest.java
- +5 −5 tests/core/src/main/java/playn/tests/core/SubImageTest.java
Oops, something went wrong.