@@ -34,7 +34,7 @@ use style_traits::viewport::ViewportConstraints;
34
34
use time:: { precise_time_ns, precise_time_s} ;
35
35
use touch:: { TouchHandler , TouchAction } ;
36
36
use webrender;
37
- use webrender_traits :: { self , ClipId , LayoutPoint , LayoutVector2D , ScrollEventPhase , ScrollLocation , ScrollClamping } ;
37
+ use webrender_api :: { self , ClipId , LayoutPoint , LayoutVector2D , ScrollEventPhase , ScrollLocation , ScrollClamping } ;
38
38
use windowing:: { self , MouseWindowEvent , WindowEvent , WindowMethods , WindowNavigateMsg } ;
39
39
40
40
#[ derive( Debug , PartialEq ) ]
@@ -58,7 +58,7 @@ trait ConvertPipelineIdFromWebRender {
58
58
fn from_webrender ( & self ) -> PipelineId ;
59
59
}
60
60
61
- impl ConvertPipelineIdFromWebRender for webrender_traits :: PipelineId {
61
+ impl ConvertPipelineIdFromWebRender for webrender_api :: PipelineId {
62
62
fn from_webrender ( & self ) -> PipelineId {
63
63
PipelineId {
64
64
namespace_id : PipelineNamespaceId ( self . 0 ) ,
@@ -180,7 +180,7 @@ pub struct IOCompositor<Window: WindowMethods> {
180
180
webrender : webrender:: Renderer ,
181
181
182
182
/// The webrender interface, if enabled.
183
- webrender_api : webrender_traits :: RenderApi ,
183
+ webrender_api : webrender_api :: RenderApi ,
184
184
185
185
/// GL functions interface (may be GL or GLES)
186
186
gl : Rc < gl:: Gl > ,
@@ -315,7 +315,7 @@ impl RenderNotifier {
315
315
}
316
316
}
317
317
318
- impl webrender_traits :: RenderNotifier for RenderNotifier {
318
+ impl webrender_api :: RenderNotifier for RenderNotifier {
319
319
fn new_frame_ready ( & mut self ) {
320
320
self . compositor_proxy . recomposite ( CompositingReason :: NewWebRenderFrame ) ;
321
321
}
@@ -330,7 +330,7 @@ struct CompositorThreadDispatcher {
330
330
compositor_proxy : CompositorProxy
331
331
}
332
332
333
- impl webrender_traits :: RenderDispatcher for CompositorThreadDispatcher {
333
+ impl webrender_api :: RenderDispatcher for CompositorThreadDispatcher {
334
334
fn dispatch ( & self , f : Box < Fn ( ) + Send > ) {
335
335
self . compositor_proxy . send ( Msg :: Dispatch ( f) ) ;
336
336
}
@@ -704,12 +704,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
704
704
let dppx = self . page_zoom * self . hidpi_factor ( ) ;
705
705
706
706
let window_rect = {
707
- let offset = webrender_traits :: DeviceUintPoint :: new ( self . window_rect . origin . x , self . window_rect . origin . y ) ;
708
- let size = webrender_traits :: DeviceUintSize :: new ( self . window_rect . size . width , self . window_rect . size . height ) ;
709
- webrender_traits :: DeviceUintRect :: new ( offset, size)
707
+ let offset = webrender_api :: DeviceUintPoint :: new ( self . window_rect . origin . x , self . window_rect . origin . y ) ;
708
+ let size = webrender_api :: DeviceUintSize :: new ( self . window_rect . size . width , self . window_rect . size . height ) ;
709
+ webrender_api :: DeviceUintRect :: new ( offset, size)
710
710
} ;
711
711
712
- let frame_size = webrender_traits :: DeviceUintSize :: new ( self . frame_size . width , self . frame_size . height ) ;
712
+ let frame_size = webrender_api :: DeviceUintSize :: new ( self . frame_size . width , self . frame_size . height ) ;
713
713
self . webrender_api . set_window_parameters ( frame_size, window_rect) ;
714
714
715
715
let initial_viewport = self . window_rect . size . to_f32 ( ) / dppx;
@@ -988,7 +988,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
988
988
let cursor = TypedPoint2D :: new ( -1 , -1 ) ; // Make sure this hits the base layer.
989
989
self . pending_scroll_zoom_events . push ( ScrollZoomEvent {
990
990
magnification : magnification,
991
- scroll_location : ScrollLocation :: Delta ( webrender_traits :: LayoutVector2D :: from_untyped (
991
+ scroll_location : ScrollLocation :: Delta ( webrender_api :: LayoutVector2D :: from_untyped (
992
992
& scroll_delta. to_untyped ( ) ) ) ,
993
993
cursor : cursor,
994
994
phase : ScrollEventPhase :: Move ( true ) ,
@@ -1128,8 +1128,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
1128
1128
1129
1129
let cursor =
1130
1130
( combined_event. cursor . to_f32 ( ) / self . scale ) . to_untyped ( ) ;
1131
- let location = webrender_traits :: ScrollLocation :: Delta ( delta) ;
1132
- let cursor = webrender_traits :: WorldPoint :: from_untyped ( & cursor) ;
1131
+ let location = webrender_api :: ScrollLocation :: Delta ( delta) ;
1132
+ let cursor = webrender_api :: WorldPoint :: from_untyped ( & cursor) ;
1133
1133
self . webrender_api . scroll ( location, cursor, combined_event. phase ) ;
1134
1134
last_combined_event = None
1135
1135
}
@@ -1139,7 +1139,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
1139
1139
( last_combined_event @ & mut None , _) => {
1140
1140
* last_combined_event = Some ( ScrollZoomEvent {
1141
1141
magnification : scroll_event. magnification ,
1142
- scroll_location : ScrollLocation :: Delta ( webrender_traits :: LayoutVector2D :: from_untyped (
1142
+ scroll_location : ScrollLocation :: Delta ( webrender_api :: LayoutVector2D :: from_untyped (
1143
1143
& this_delta. to_untyped ( ) ) ) ,
1144
1144
cursor : this_cursor,
1145
1145
phase : scroll_event. phase ,
@@ -1178,14 +1178,14 @@ impl<Window: WindowMethods> IOCompositor<Window> {
1178
1178
ScrollLocation :: Delta ( delta) => {
1179
1179
let scaled_delta = ( TypedVector2D :: from_untyped ( & delta. to_untyped ( ) ) / self . scale )
1180
1180
. to_untyped ( ) ;
1181
- let calculated_delta = webrender_traits :: LayoutVector2D :: from_untyped ( & scaled_delta) ;
1181
+ let calculated_delta = webrender_api :: LayoutVector2D :: from_untyped ( & scaled_delta) ;
1182
1182
ScrollLocation :: Delta ( calculated_delta)
1183
1183
} ,
1184
1184
// Leave ScrollLocation unchanged if it is Start or End location.
1185
1185
sl @ ScrollLocation :: Start | sl @ ScrollLocation :: End => sl,
1186
1186
} ;
1187
1187
let cursor = ( combined_event. cursor . to_f32 ( ) / self . scale ) . to_untyped ( ) ;
1188
- let cursor = webrender_traits :: WorldPoint :: from_untyped ( & cursor) ;
1188
+ let cursor = webrender_api :: WorldPoint :: from_untyped ( & cursor) ;
1189
1189
self . webrender_api . scroll ( scroll_location, cursor, combined_event. phase ) ;
1190
1190
self . waiting_for_results_of_scroll = true
1191
1191
}
@@ -1283,7 +1283,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
1283
1283
}
1284
1284
1285
1285
fn update_page_zoom_for_webrender ( & mut self ) {
1286
- let page_zoom = webrender_traits :: ZoomFactor :: new ( self . page_zoom . get ( ) ) ;
1286
+ let page_zoom = webrender_api :: ZoomFactor :: new ( self . page_zoom . get ( ) ) ;
1287
1287
self . webrender_api . set_page_zoom ( page_zoom) ;
1288
1288
}
1289
1289
@@ -1381,8 +1381,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
1381
1381
let mut pipeline_epochs = HashMap :: new ( ) ;
1382
1382
for ( id, _) in & self . pipeline_details {
1383
1383
let webrender_pipeline_id = id. to_webrender ( ) ;
1384
- if let Some ( webrender_traits :: Epoch ( epoch) ) = self . webrender
1385
- . current_epoch ( webrender_pipeline_id) {
1384
+ if let Some ( webrender_api :: Epoch ( epoch) ) = self . webrender
1385
+ . current_epoch ( webrender_pipeline_id) {
1386
1386
let epoch = Epoch ( epoch) ;
1387
1387
pipeline_epochs. insert ( * id, epoch) ;
1388
1388
}
@@ -1475,7 +1475,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
1475
1475
debug ! ( "compositor: compositing" ) ;
1476
1476
1477
1477
// Paint the scene.
1478
- let size = webrender_traits :: DeviceUintSize :: from_untyped ( & self . frame_size . to_untyped ( ) ) ;
1478
+ let size = webrender_api :: DeviceUintSize :: from_untyped ( & self . frame_size . to_untyped ( ) ) ;
1479
1479
self . webrender . render ( size) ;
1480
1480
} ) ;
1481
1481
0 commit comments