Auto merge of #12741 - changm:shader, r=ConnorGBrewster

update servo to use webrender shaders

<!-- Please describe your changes on the following line: -->
Pulls shaders from webrender and update the webrender commit.
---
<!-- 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 _____

<!-- 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/12741)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-08-05 10:33:08 -05:00 committed by GitHub
commit fc4fc773b4
9 changed files with 18 additions and 18 deletions

View file

@ -2554,7 +2554,7 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.1.0"
source = "git+https://github.com/servo/webrender#eebe599cab295271900d7fbbe3017232dcbba867"
source = "git+https://github.com/servo/webrender#66b7134918a56c561cbdf72ab284f5da83459ec4"
dependencies = [
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",

2
ports/cef/Cargo.lock generated
View file

@ -2416,7 +2416,7 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.1.0"
source = "git+https://github.com/servo/webrender#eebe599cab295271900d7fbbe3017232dcbba867"
source = "git+https://github.com/servo/webrender#66b7134918a56c561cbdf72ab284f5da83459ec4"
dependencies = [
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -28,7 +28,7 @@ vec4 draw_dotted_edge() {
// like firefox.
float circleSpacing = diameter * 2.2;
vec2 size = vec2(vBorders.z, vBorders.w);
vec2 size = vBorders.zw;
// Get our position within this specific segment
vec2 position = vDevicePos - vBorders.xy;
@ -68,15 +68,16 @@ vec2 get_dashed_nudge_factor(vec2 dash_size, bool is_corner) {
bool xAxisFudge = vBorders.z > vBorders.w;
if (xAxisFudge) {
return vec2(dash_size.x / 2.0, 0);
} else {
return vec2(0.0, dash_size.y / 2.0);
}
return vec2(0.0, dash_size.y / 2.0);
}
vec4 draw_dashed_edge(bool is_corner) {
// Everything here should be in device pixels.
// We want the dot to be roughly the size of the whole border spacing
// 5.5 here isn't a magic number, it's just what mostly looks like FF/Chrome
// TODO: Investigate exactly what FF does.
float dash_interval = min(vBorders.w, vBorders.z) * 5.5;
vec2 edge_size = vec2(vBorders.z, vBorders.w);
vec2 dash_size = vec2(dash_interval / 2.0, dash_interval / 2.0);
@ -143,6 +144,8 @@ void draw_dashed_border(void) {
}
}
// TODO: Investigate performance of this shader and see
// if it's worthwhile splitting it / removing branches etc.
void main(void) {
if (vRadii.x > 0.0 &&
(distance(vRefPoint, vLocalPos) > vRadii.x ||
@ -178,7 +181,6 @@ void main(void) {
default:
{
discard;
break;
}
}
}

View file

@ -107,7 +107,5 @@ void main(void) {
vDevicePos = vi.global_clamped_pos;
// These are in device space
vBorders = vec4(border.info.local_rect.x, border.info.local_rect.y,
border.info.local_rect.z,
border.info.local_rect.w) * uDevicePixelRatio;
vBorders = border.info.local_rect * uDevicePixelRatio;
}