servo: Merge #14007 - Update WR - fixes for local clip rect + 3d transformed content (from glennw:update-wr-3d-text); r=pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: c69c6cf58bb31de36af98d4b84dfdec2724d5b5b
This commit is contained in:
Glenn Watson 2016-10-31 18:11:37 -05:00
Родитель a751d5bb5b
Коммит 153e88778c
3 изменённых файлов: 17 добавлений и 14 удалений

4
servo/components/servo/Cargo.lock сгенерированный
Просмотреть файл

@ -2658,7 +2658,7 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.8.0"
source = "git+https://github.com/servo/webrender#97e5a6eeb5b0e399fa091091c193a146e5805d78"
source = "git+https://github.com/servo/webrender#cbdd312a88e80f8cca457f7d49128f51e819ebf1"
dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2683,7 +2683,7 @@ dependencies = [
[[package]]
name = "webrender_traits"
version = "0.8.0"
source = "git+https://github.com/servo/webrender#97e5a6eeb5b0e399fa091091c193a146e5805d78"
source = "git+https://github.com/servo/webrender#cbdd312a88e80f8cca457f7d49128f51e819ebf1"
dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",

4
servo/ports/cef/Cargo.lock сгенерированный
Просмотреть файл

@ -2516,7 +2516,7 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.8.0"
source = "git+https://github.com/servo/webrender#97e5a6eeb5b0e399fa091091c193a146e5805d78"
source = "git+https://github.com/servo/webrender#cbdd312a88e80f8cca457f7d49128f51e819ebf1"
dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2541,7 +2541,7 @@ dependencies = [
[[package]]
name = "webrender_traits"
version = "0.8.0"
source = "git+https://github.com/servo/webrender#97e5a6eeb5b0e399fa091091c193a146e5805d78"
source = "git+https://github.com/servo/webrender#cbdd312a88e80f8cca457f7d49128f51e819ebf1"
dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",

Просмотреть файл

@ -439,6 +439,10 @@ vec4 get_layer_pos(vec2 pos, Layer layer) {
return untransform(pos, n, a, layer.inv_transform);
}
vec2 clamp_rect(vec2 point, vec4 rect) {
return clamp(point, rect.xy, rect.xy + rect.zw);
}
struct Rect {
vec2 p0;
vec2 p1;
@ -463,9 +467,7 @@ VertexInfo write_vertex(vec4 instance_rect,
vec2 cp1 = floor(0.5 + (local_clip_rect.xy + local_clip_rect.zw) * uDevicePixelRatio) / uDevicePixelRatio;
local_pos = clamp(local_pos, cp0, cp1);
local_pos = clamp(local_pos,
layer.local_clip_rect.xy,
layer.local_clip_rect.xy + layer.local_clip_rect.zw);
local_pos = clamp_rect(local_pos, layer.local_clip_rect);
vec4 world_pos = layer.transform * vec4(local_pos, 0, 1);
world_pos.xyz /= world_pos.w;
@ -495,15 +497,16 @@ struct TransformVertexInfo {
};
TransformVertexInfo write_transform_vertex(vec4 instance_rect,
vec4 local_clip_rect, //unused
vec4 local_clip_rect,
Layer layer,
Tile tile) {
vec2 lp0 = clamp(instance_rect.xy,
layer.local_clip_rect.xy,
layer.local_clip_rect.xy + layer.local_clip_rect.zw);
vec2 lp1 = clamp(instance_rect.xy + instance_rect.zw,
layer.local_clip_rect.xy,
layer.local_clip_rect.xy + layer.local_clip_rect.zw);
vec2 lp0_base = instance_rect.xy;
vec2 lp1_base = instance_rect.xy + instance_rect.zw;
vec2 lp0 = clamp_rect(clamp_rect(lp0_base, local_clip_rect),
layer.local_clip_rect);
vec2 lp1 = clamp_rect(clamp_rect(lp1_base, local_clip_rect),
layer.local_clip_rect);
vec4 clipped_local_rect = vec4(lp0, lp1 - lp0);