Skip to content

Commit 81be210

Browse files
committed
Bug 1612440 - Separate scene and frame related data in DocumentView. r=gw
DocumentView has a mix of members that affect scene building and memebers that change frame to frame. These need to be updated at different rates and more importantly follow the respective flow of scene and frame transactions, which wasn't done properly before this change. Depends on D71781 Differential Revision: https://phabricator.services.mozilla.com/D71927 UltraBlame original commit: 4933e4b66edb70f5b8f682abc6025e9f50f14e4b
1 parent b903513 commit 81be210

File tree

3 files changed

+170
-72
lines changed

3 files changed

+170
-72
lines changed

gfx/wr/webrender/src/render_backend.rs

Lines changed: 163 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -646,13 +646,63 @@ Deserialize
646646
[
647647
derive
648648
(
649+
Copy
649650
Clone
650651
)
651652
]
652653
pub
653654
struct
654655
DocumentView
655656
{
657+
scene
658+
:
659+
SceneView
660+
frame
661+
:
662+
FrameView
663+
}
664+
#
665+
[
666+
cfg_attr
667+
(
668+
feature
669+
=
670+
"
671+
capture
672+
"
673+
derive
674+
(
675+
Serialize
676+
)
677+
)
678+
]
679+
#
680+
[
681+
cfg_attr
682+
(
683+
feature
684+
=
685+
"
686+
replay
687+
"
688+
derive
689+
(
690+
Deserialize
691+
)
692+
)
693+
]
694+
#
695+
[
696+
derive
697+
(
698+
Copy
699+
Clone
700+
)
701+
]
702+
pub
703+
struct
704+
SceneView
705+
{
656706
pub
657707
device_rect
658708
:
@@ -662,10 +712,6 @@ layer
662712
:
663713
DocumentLayer
664714
pub
665-
pan
666-
:
667-
DeviceIntPoint
668-
pub
669715
device_pixel_ratio
670716
:
671717
f32
@@ -674,20 +720,16 @@ page_zoom_factor
674720
:
675721
f32
676722
pub
677-
pinch_zoom_factor
678-
:
679-
f32
680-
pub
681723
quality_settings
682724
:
683725
QualitySettings
684726
}
685727
impl
686-
DocumentView
728+
SceneView
687729
{
688730
pub
689731
fn
690-
accumulated_scale_factor
732+
accumulated_scale_factor_for_snapping
691733
(
692734
&
693735
self
@@ -708,15 +750,64 @@ device_pixel_ratio
708750
self
709751
.
710752
page_zoom_factor
711-
*
712-
self
713-
.
714-
pinch_zoom_factor
715753
)
716754
}
755+
}
756+
#
757+
[
758+
cfg_attr
759+
(
760+
feature
761+
=
762+
"
763+
capture
764+
"
765+
derive
766+
(
767+
Serialize
768+
)
769+
)
770+
]
771+
#
772+
[
773+
cfg_attr
774+
(
775+
feature
776+
=
777+
"
778+
replay
779+
"
780+
derive
781+
(
782+
Deserialize
783+
)
784+
)
785+
]
786+
#
787+
[
788+
derive
789+
(
790+
Copy
791+
Clone
792+
)
793+
]
794+
pub
795+
struct
796+
FrameView
797+
{
798+
pan
799+
:
800+
DeviceIntPoint
801+
pinch_zoom_factor
802+
:
803+
f32
804+
}
805+
impl
806+
DocumentView
807+
{
717808
pub
718809
fn
719-
accumulated_scale_factor_for_snapping
810+
accumulated_scale_factor
720811
(
721812
&
722813
self
@@ -732,11 +823,21 @@ new
732823
(
733824
self
734825
.
826+
scene
827+
.
735828
device_pixel_ratio
736829
*
737830
self
738831
.
832+
scene
833+
.
739834
page_zoom_factor
835+
*
836+
self
837+
.
838+
frame
839+
.
840+
pinch_zoom_factor
740841
)
741842
}
742843
}
@@ -2193,6 +2294,10 @@ view
21932294
:
21942295
DocumentView
21952296
{
2297+
scene
2298+
:
2299+
SceneView
2300+
{
21962301
device_rect
21972302
:
21982303
size
@@ -2201,24 +2306,11 @@ into
22012306
(
22022307
)
22032308
layer
2204-
pan
2205-
:
2206-
DeviceIntPoint
2207-
:
2208-
:
2209-
zero
2210-
(
2211-
)
22122309
page_zoom_factor
22132310
:
22142311
1
22152312
.
22162313
0
2217-
pinch_zoom_factor
2218-
:
2219-
1
2220-
.
2221-
0
22222314
device_pixel_ratio
22232315
:
22242316
default_device_pixel_ratio
@@ -2231,6 +2323,27 @@ default
22312323
(
22322324
)
22332325
}
2326+
frame
2327+
:
2328+
FrameView
2329+
{
2330+
pan
2331+
:
2332+
DeviceIntPoint
2333+
:
2334+
:
2335+
new
2336+
(
2337+
0
2338+
0
2339+
)
2340+
pinch_zoom_factor
2341+
:
2342+
1
2343+
.
2344+
0
2345+
}
2346+
}
22342347
stamp
22352348
:
22362349
FrameStamp
@@ -2377,6 +2490,8 @@ self
23772490
.
23782491
view
23792492
.
2493+
scene
2494+
.
23802495
device_rect
23812496
.
23822497
size
@@ -2670,6 +2785,8 @@ self
26702785
.
26712786
view
26722787
.
2788+
frame
2789+
.
26732790
pan
26742791
!
26752792
=
@@ -2679,6 +2796,8 @@ self
26792796
.
26802797
view
26812798
.
2799+
frame
2800+
.
26822801
pan
26832802
=
26842803
pan
@@ -2850,6 +2969,8 @@ self
28502969
.
28512970
view
28522971
.
2972+
frame
2973+
.
28532974
pinch_zoom_factor
28542975
!
28552976
=
@@ -2863,6 +2984,8 @@ self
28632984
.
28642985
view
28652986
.
2987+
frame
2988+
.
28662989
pinch_zoom_factor
28672990
=
28682991
factor
@@ -3010,6 +3133,8 @@ self
30103133
.
30113134
view
30123135
.
3136+
frame
3137+
.
30133138
pan
30143139
.
30153140
to_f32
@@ -3083,11 +3208,15 @@ self
30833208
.
30843209
view
30853210
.
3211+
scene
3212+
.
30863213
layer
30873214
self
30883215
.
30893216
view
30903217
.
3218+
scene
3219+
.
30913220
device_rect
30923221
.
30933222
origin
@@ -3170,6 +3299,8 @@ self
31703299
.
31713300
view
31723301
.
3302+
frame
3303+
.
31733304
pan
31743305
.
31753306
to_f32
@@ -4681,6 +4812,8 @@ removed_pipelines
46814812
doc
46824813
.
46834814
view
4815+
.
4816+
scene
46844817
=
46854818
txn
46864819
.
@@ -8543,10 +8676,6 @@ id
85438676
doc
85448677
.
85458678
view
8546-
.
8547-
clone
8548-
(
8549-
)
85508679
)
85518680
)
85528681
.
@@ -9512,10 +9641,6 @@ id
95129641
doc
95139642
.
95149643
view
9515-
.
9516-
clone
9517-
(
9518-
)
95199644
)
95209645
)
95219646
.
@@ -10346,10 +10471,6 @@ doc
1034610471
view
1034710472
=
1034810473
view
10349-
.
10350-
clone
10351-
(
10352-
)
1035310474
;
1035410475
doc
1035510476
.
@@ -10428,12 +10549,6 @@ new
1042810549
(
1042910550
)
1043010551
view
10431-
:
10432-
view
10433-
.
10434-
clone
10435-
(
10436-
)
1043710552
stamp
1043810553
:
1043910554
FrameStamp
@@ -10717,6 +10832,8 @@ view
1071710832
:
1071810833
view
1071910834
.
10835+
scene
10836+
.
1072010837
clone
1072110838
(
1072210839
)

0 commit comments

Comments
 (0)