Commit 3aa442e
[graphite] Lift colortype to format choice out of backends
Adds a new PreferredFormatForColorType static function that takes an
SkColorType and removes the temporary `Caps::getFormatForColorType()`
function that took a color type and Renderable.
The PreferredFormatForColorType does not need to be filtered on
renderability. Instead, the Caps::getDefaultSampledTextureInfo() impl
filters the returned span by whether or not the WriteSwizzleForCT
function returns a non-empty swizzle. We could have the definition of
PreferredFormatForColorType have two separate tables, one for renderable
and one for non-renderable, which would make the
getDefaultSampledTextureInfo() function simpler but at the expense of
two nearly identical lookup tables.
The details of the PreferredFormatForColorType lookup table is the union
of all the different backend's setColorType() blocks from their format
table initialization.
The internal `Caps::getDefaultTextureInfo` function is updated to
iterate over a span of texture formats to automatically use the first
that is supported.
Bug: b/390473370
Change-Id: I554a1b6a09bbcc64d5bf732bc563e2cb8d0db286
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1165836
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>1 parent ea4fd0e commit 3aa442e
File tree
12 files changed
+151
-326
lines changed- src/gpu/graphite
- dawn
- mtl
- task
- vk
12 files changed
+151
-326
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
190 | | - | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
218 | 220 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
228 | 233 | | |
229 | | - | |
230 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | | - | |
| 243 | + | |
238 | 244 | | |
239 | 245 | | |
240 | 246 | | |
| |||
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
| 259 | + | |
| 260 | + | |
253 | 261 | | |
254 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
255 | 271 | | |
256 | 272 | | |
257 | 273 | | |
258 | | - | |
| 274 | + | |
259 | 275 | | |
260 | 276 | | |
261 | 277 | | |
262 | 278 | | |
263 | 279 | | |
264 | 280 | | |
265 | 281 | | |
| 282 | + | |
266 | 283 | | |
267 | | - | |
| 284 | + | |
268 | 285 | | |
269 | 286 | | |
270 | 287 | | |
| |||
275 | 292 | | |
276 | 293 | | |
277 | 294 | | |
| 295 | + | |
278 | 296 | | |
279 | | - | |
| 297 | + | |
280 | 298 | | |
281 | 299 | | |
282 | 300 | | |
| |||
289 | 307 | | |
290 | 308 | | |
291 | 309 | | |
292 | | - | |
| 310 | + | |
293 | 311 | | |
294 | 312 | | |
295 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
557 | 565 | | |
558 | 566 | | |
559 | 567 | | |
| |||
563 | 571 | | |
564 | 572 | | |
565 | 573 | | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | 574 | | |
574 | 575 | | |
575 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
797 | 804 | | |
798 | 805 | | |
799 | | - | |
| 806 | + | |
| 807 | + | |
800 | 808 | | |
801 | 809 | | |
802 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
426 | 479 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
0 commit comments