Auto merge of #16590 - MortimerGoro:texture_rgb, r=emilio

Fix WebGL premultiplied alpha. Fix texImage2D calls with RGB images.

Fix WebGL premultiplied alpha testcases.

Fix broken textures in some WebGL demos (e.g. Three.js). This was caused by WebGL::texImage2D calls with RGB formats. Alpha must be removed from the rgba8 pixel vector before submitting the data to the GPU.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16590)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-28 07:12:05 -05:00 committed by GitHub
commit 3b516af783
2 changed files with 83 additions and 99 deletions

View file

@ -1,71 +0,0 @@
[gl-teximage.html]
type: testharness
[WebGL test #2: at (0, 15) expected: 0,0,0,255 was 255,0,0,255]
expected: FAIL
[WebGL test #3: at (128, 15) expected: 255,0,255,255 was 255,255,0,255]
expected: FAIL
[WebGL test #4: at (255, 15) expected: 0,0,255,255 was 0,0,0,255]
expected: FAIL
[WebGL test #5: at (0, 8) expected: 128,128,128,255 was 255,0,0,255]
expected: FAIL
[WebGL test #6: at (128, 8) expected: 255,255,255,255 was 128,128,128,255]
expected: FAIL
[WebGL test #9: at (128, 0) expected: 255,255,0,255 was 0,255,255,255]
expected: FAIL
[WebGL test #10: at (255, 0) expected: 0,255,0,255 was 0,0,0,255]
expected: FAIL
[WebGL test #38: Half the pixels in channel 0 should be >= 128,128,128. found 25%]
expected: FAIL
[WebGL test #40: Half the pixels in channel 1 should be >= 128,128,128. found 25%]
expected: FAIL
[WebGL test #42: Half the pixels in channel 2 should be >= 128,128,128. found 25%]
expected: FAIL
[WebGL test #52: at (0, 0) expected: 255,255,255,127 was 128,128,128,128]
expected: FAIL
[WebGL test #54: at (0, 0) expected: 127,127,127,127 was 64,64,64,128]
expected: FAIL
[WebGL test #59: at (128, 15) expected: 255,255,0,255 was 255,255,255,255]
expected: FAIL
[WebGL test #60: at (255, 15) expected: 255,0,0,255 was 0,255,255,255]
expected: FAIL
[WebGL test #61: at (0, 8) expected: 255,0,255,255 was 0,0,255,255]
expected: FAIL
[WebGL test #62: at (128, 8) expected: 255,0,0,255 was 255,0,255,255]
expected: FAIL
[WebGL test #63: at (255, 8) expected: 0,255,0,255 was 255,255,0,255]
expected: FAIL
[WebGL test #64: at (0, 0) expected: 0,0,0,255 was 0,255,0,255]
expected: FAIL
[WebGL test #65: at (128, 0) expected: 0,0,255,255 was 255,0,255,255]
expected: FAIL
[WebGL test #66: at (255, 0) expected: 255,0,0,255 was 0,0,0,255]
expected: FAIL
[WebGL test #71: at (128, 8) expected: 15,121,0,255 was 133,0,255,255]
expected: FAIL
[WebGL test #74: at (128, 8) expected: 0,0,255,255 was 1,255,255,255]
expected: FAIL
[WebGL test #76: at (128, 8) expected: 0,0,255,255 was 1,255,255,255]
expected: FAIL