Commit ce8da66
authored
Feat: Extend platform abstraction (#746)
Move Image creation and GL wrapper to Platform.
This PR changes:
* `createImageBitmap` support to `Platform`
* Image fetch to `Platform` (by default using `XMLHttpRequest`)
* `ImageWorker` handling to `Platform`
* `GLWrapper` to `Platform`
* Similar, support for TX compression and SVG handling has been moved to
`Platform`
Removed:
* `createImageBitmap` auto detection - this needs to be done by Platform
* Image Fallback handling - this is done by Platform
**NOTE: BREAKING CHANGES**
This requires a different Platform import / init to make it work.
The concept is you create a Platform that matches the functionality the
platform exposes. I.e. if the Platform does not support
`createImageBitmap` or a less version of `createImageBitmap` you should
extend the platform to match that.
@estobbart for ION you can create or upstream an ION specific platform
(or we can create one) that:
* Replace `loadImage` and `createImage` in Platform (possibly `Fetch`
too?)
* Replace the respective GL function
Todo:
- [x] Expose platforms in exports
- [x] Create Legacy Platform for non-`createImageBitmap` platform
- [x] Create Chrome 50 `createImageBitmap` platform
- [x] Create `fetch` supported platformFile tree
36 files changed
+1405
-851
lines changed- examples
- exports
- src
- core
- lib
- platforms
- web
- lib
- renderers
- canvas
- webgl
- internal
- textures
- main-api
36 files changed
+1405
-851
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
48 | 141 | | |
49 | 142 | | |
50 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
| |||
91 | 104 | | |
92 | 105 | | |
93 | 106 | | |
| 107 | + | |
94 | 108 | | |
95 | 109 | | |
96 | 110 | | |
| |||
105 | 119 | | |
106 | 120 | | |
107 | 121 | | |
| 122 | + | |
108 | 123 | | |
109 | 124 | | |
110 | 125 | | |
| |||
121 | 136 | | |
122 | 137 | | |
123 | 138 | | |
124 | | - | |
| 139 | + | |
125 | 140 | | |
126 | 141 | | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
130 | 145 | | |
131 | 146 | | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
158 | 174 | | |
159 | 175 | | |
160 | 176 | | |
| 177 | + | |
161 | 178 | | |
162 | 179 | | |
163 | 180 | | |
| |||
233 | 250 | | |
234 | 251 | | |
235 | 252 | | |
| 253 | + | |
236 | 254 | | |
237 | 255 | | |
238 | 256 | | |
| |||
256 | 274 | | |
257 | 275 | | |
258 | 276 | | |
| 277 | + | |
259 | 278 | | |
260 | 279 | | |
261 | 280 | | |
| |||
365 | 384 | | |
366 | 385 | | |
367 | 386 | | |
| 387 | + | |
368 | 388 | | |
369 | 389 | | |
370 | 390 | | |
371 | 391 | | |
372 | 392 | | |
373 | 393 | | |
| 394 | + | |
374 | 395 | | |
375 | 396 | | |
376 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2727 | 2727 | | |
2728 | 2728 | | |
2729 | 2729 | | |
2730 | | - | |
| 2730 | + | |
| 2731 | + | |
2731 | 2732 | | |
2732 | 2733 | | |
2733 | 2734 | | |
| |||
2741 | 2742 | | |
2742 | 2743 | | |
2743 | 2744 | | |
2744 | | - | |
| 2745 | + | |
2745 | 2746 | | |
2746 | 2747 | | |
2747 | 2748 | | |
| |||
0 commit comments