Skip to content

Sync changes from mozilla-central #3573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
db13831
Bug 1530576 - WR track vao bindings better r=gw
kvark Feb 26, 2019
d7418ac
Bug 1505871. Write component transfer filter data into the webrender …
tnikkel Feb 26, 2019
9860dc4
Bug 1505871. Implement yaml reader/writer for component transfer. r=j…
tnikkel Feb 26, 2019
52ab6d4
Bug 1505871. Implement the necessary things for interning of filter d…
tnikkel Feb 26, 2019
bc4b734
Bug 1505871. Don't borrow frame_state.surface for the duration of pre…
tnikkel Feb 26, 2019
cd2e5ae
Backed out changeset 1206e1a32e5f
tnikkel Feb 26, 2019
ec09ace
Backed out changeset 11c9d5a64a30
tnikkel Feb 26, 2019
8b28d1d
Backed out changeset def812790f5c
tnikkel Feb 26, 2019
b681194
Backed out changeset 90660632d641
tnikkel Feb 26, 2019
cd78084
Bug 1505871. Write component transfer filter data into the webrender …
tnikkel Feb 26, 2019
1e0c50f
Bug 1505871. Implement yaml reader/writer for component transfer. r=j…
tnikkel Feb 26, 2019
73e5134
Bug 1505871. Implement the necessary things for interning of filter d…
tnikkel Feb 26, 2019
1eb8b68
Bug 1505871. Don't borrow frame_state.surface for the duration of pre…
tnikkel Feb 26, 2019
c04f341
Bug 1505871. Pass DataStores to prepare_for_render. r=gw
tnikkel Feb 26, 2019
bbd532c
Bug 1505871. Implement putting the required data in the gpu cache for…
tnikkel Feb 26, 2019
e636dce
Bug 1505871. Implementation of shaders. r=gw
tnikkel Feb 26, 2019
54f4ce7
Bug 1505871. Work around a suspected shader miscompilation on Windows…
tnikkel Feb 26, 2019
b0eaa91
Bug 1505871. Fix comment to not trigger angle_shader_validation.rs.
tnikkel Feb 26, 2019
a6a6ecb
Bug 1505871. Add a wrench reftest.
tnikkel Feb 26, 2019
9351220
Merge
staktrace Feb 28, 2019
5c5d4a2
Bug 1441308 - Ensure lazy init of debug renderer in draw_frame_debug_…
squarewave Feb 26, 2019
05c9bb2
Bug 1530915 - Change external scroll offset to be a vector. r=emilio
gw3583 Feb 27, 2019
7340c3e
Bug 1529117 - Bump serde and serde_derive to branch from 1.0.88. r=jr…
staktrace Feb 27, 2019
84c218f
Backed out 2 changesets (bug 1529117) for build bustage
dgluca Feb 27, 2019
0508110
Bug 1441308 - Fix picture-caching interaction with doc spitting r=gw
squarewave Feb 28, 2019
34db10a
Bug 1531248 - Reduce the number of resolve / copy steps in WR on mobi…
gw3583 Feb 28, 2019
c8a20f7
Bug 1531512 - Mark unused variables as unused for non-windows. r=kvark
staktrace Mar 1, 2019
64173d7
Bug 1530730 - Update plane-split to 0.13.7. r=kvark
nical Feb 28, 2019
8e13bb5
Bug 1530978 - Show profiler stats averaged over half a second instead…
nical Feb 27, 2019
471b60c
Bug 1531217 - Document origin rewrite and framebuffer coordinates r=g…
kvark Mar 1, 2019
1a025c0
Bug 1531776 - Spew debug messages on GL error r=nical
kvark Mar 1, 2019
068d6b0
Backed out changeset 93f7dc3084a1 (bug 1531217) for wrench failures. …
ncsoregi Mar 1, 2019
d33e637
Bug 1531217 - Document origin rewrite and framebuffer coordinates r=g…
kvark Mar 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions direct-composition/src/main_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern crate gleam;
extern crate webrender;
extern crate winit;

use euclid::size2;
use direct_composition::DirectComposition;
use std::sync::mpsc;
use webrender::api;
Expand All @@ -34,10 +35,9 @@ fn main() {

let mut clicks: usize = 0;
let mut offset_y = 100.;
let size = api::DeviceIntSize::new;
let mut rects = [
Rectangle::new(&composition, &notifier, factor, size(300, 200), 0., 0.2, 0.4, 1.),
Rectangle::new(&composition, &notifier, factor, size(400, 300), 0., 0.5, 0., 0.5),
Rectangle::new(&composition, &notifier, factor, size2(300, 200), 0., 0.2, 0.4, 1.),
Rectangle::new(&composition, &notifier, factor, size2(400, 300), 0., 0.5, 0., 0.5),
];
rects[0].render(factor, &rx);
rects[1].render(factor, &rx);
Expand Down Expand Up @@ -95,13 +95,13 @@ struct Rectangle {
renderer: Option<webrender::Renderer>,
api: api::RenderApi,
document_id: api::DocumentId,
size: api::DeviceIntSize,
size: api::FramebufferIntSize,
color: api::ColorF,
}

impl Rectangle {
fn new(composition: &DirectComposition, notifier: &Box<Notifier>,
device_pixel_ratio: f32, size: api::DeviceIntSize, r: f32, g: f32, b: f32, a: f32)
device_pixel_ratio: f32, size: api::FramebufferIntSize, r: f32, g: f32, b: f32, a: f32)
-> Self {
let visual = composition.create_angle_visual(size.width as u32, size.height as u32);
visual.make_current();
Expand Down
2 changes: 1 addition & 1 deletion examples/alpha_perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Example for App {
_api: &RenderApi,
builder: &mut DisplayListBuilder,
_txn: &mut Transaction,
_framebuffer_size: DeviceIntSize,
_framebuffer_size: FramebufferIntSize,
pipeline_id: PipelineId,
_document_id: DocumentId,
) {
Expand Down
3 changes: 2 additions & 1 deletion examples/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl App {
&LayoutPrimitiveInfo::new(LayoutRect::zero()),
spatial_id,
&filters,
&[],
);

let space_and_clip = SpaceAndClipInfo {
Expand Down Expand Up @@ -105,7 +106,7 @@ impl Example for App {
_api: &RenderApi,
builder: &mut DisplayListBuilder,
_txn: &mut Transaction,
_framebuffer_size: DeviceIntSize,
_framebuffer_size: FramebufferIntSize,
pipeline_id: PipelineId,
_document_id: DocumentId,
) {
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl Example for App {
api: &RenderApi,
builder: &mut DisplayListBuilder,
txn: &mut Transaction,
_: DeviceIntSize,
_: FramebufferIntSize,
pipeline_id: PipelineId,
_document_id: DocumentId,
) {
Expand Down
2 changes: 1 addition & 1 deletion examples/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl Example for App {
api: &RenderApi,
builder: &mut DisplayListBuilder,
txn: &mut Transaction,
_framebuffer_size: api::DeviceIntSize,
_framebuffer_size: api::FramebufferIntSize,
pipeline_id: PipelineId,
_document_id: DocumentId,
) {
Expand Down
48 changes: 21 additions & 27 deletions examples/common/boilerplate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub trait Example {
api: &RenderApi,
builder: &mut DisplayListBuilder,
txn: &mut Transaction,
framebuffer_size: DeviceIntSize,
framebuffer_size: FramebufferIntSize,
pipeline_id: PipelineId,
document_id: DocumentId,
);
Expand Down Expand Up @@ -164,7 +164,7 @@ pub fn main_wrapper<E: Example>(
.get_inner_size()
.unwrap()
.to_physical(device_pixel_ratio as f64);
DeviceIntSize::new(size.width as i32, size.height as i32)
FramebufferIntSize::new(size.width as i32, size.height as i32)
};
let notifier = Box::new(Notifier::new(events_loop.create_proxy()));
let (mut renderer, sender) = webrender::Renderer::new(gl.clone(), notifier, opts, None).unwrap();
Expand Down Expand Up @@ -212,18 +212,19 @@ pub fn main_wrapper<E: Example>(
let mut custom_event = true;

let old_flags = debug_flags;
match global_event {
winit::Event::WindowEvent {
event: winit::WindowEvent::CloseRequested,
..
} => return winit::ControlFlow::Break,
winit::Event::WindowEvent {
event: winit::WindowEvent::KeyboardInput {
input: winit::KeyboardInput {
state: winit::ElementState::Pressed,
virtual_keycode: Some(key),
..
},
let win_event = match global_event {
winit::Event::WindowEvent { event, .. } => event,
_ => return winit::ControlFlow::Continue,
};
match win_event {
winit::WindowEvent::CloseRequested => return winit::ControlFlow::Break,
// skip high-frequency events
winit::WindowEvent::AxisMotion { .. } |
winit::WindowEvent::CursorMoved { .. } => return winit::ControlFlow::Continue,
winit::WindowEvent::KeyboardInput {
input: winit::KeyboardInput {
state: winit::ElementState::Pressed,
virtual_keycode: Some(key),
..
},
..
Expand All @@ -241,14 +242,12 @@ pub fn main_wrapper<E: Example>(
DebugFlags::NEW_FRAME_INDICATOR | DebugFlags::NEW_SCENE_INDICATOR
),
winit::VirtualKeyCode::G => debug_flags.toggle(DebugFlags::GPU_CACHE_DBG),
winit::VirtualKeyCode::Key1 => txn.set_window_parameters(
framebuffer_size,
DeviceIntRect::new(DeviceIntPoint::zero(), framebuffer_size),
winit::VirtualKeyCode::Key1 => txn.set_document_view(
framebuffer_size.into(),
1.0
),
winit::VirtualKeyCode::Key2 => txn.set_window_parameters(
framebuffer_size,
DeviceIntRect::new(DeviceIntPoint::zero(), framebuffer_size),
winit::VirtualKeyCode::Key2 => txn.set_document_view(
framebuffer_size.into(),
2.0
),
winit::VirtualKeyCode::M => api.notify_memory_pressure(),
Expand All @@ -260,23 +259,18 @@ pub fn main_wrapper<E: Example>(
api.save_capture(path, bits);
},
_ => {
let win_event = match global_event {
winit::Event::WindowEvent { event, .. } => event,
_ => unreachable!()
};
custom_event = example.on_event(
win_event,
&api,
document_id,
)
},
},
winit::Event::WindowEvent { event, .. } => custom_event = example.on_event(
event,
other => custom_event = example.on_event(
other,
&api,
document_id,
),
_ => return winit::ControlFlow::Continue,
};

if debug_flags != old_flags {
Expand Down
32 changes: 17 additions & 15 deletions examples/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,52 @@ impl App {
fn init(
&mut self,
api: &RenderApi,
framebuffer_size: DeviceIntSize,
device_pixel_ratio: f32,
) {
let init_data = vec![
(
PipelineId(1, 0),
-1,
1,
ColorF::new(0.0, 1.0, 0.0, 1.0),
DeviceIntPoint::new(0, 0),
FramebufferIntPoint::new(0, 400),
),
(
PipelineId(2, 0),
-2,
2,
ColorF::new(1.0, 1.0, 0.0, 1.0),
DeviceIntPoint::new(200, 0),
FramebufferIntPoint::new(200, 400),
),
(
PipelineId(3, 0),
-3,
3,
ColorF::new(1.0, 0.0, 0.0, 1.0),
DeviceIntPoint::new(200, 200),
FramebufferIntPoint::new(200, 600),
),
(
PipelineId(4, 0),
-4,
4,
ColorF::new(1.0, 0.0, 1.0, 1.0),
DeviceIntPoint::new(0, 200),
FramebufferIntPoint::new(0, 600),
),
];

for (pipeline_id, layer, color, offset) in init_data {
let size = DeviceIntSize::new(250, 250);
let bounds = DeviceIntRect::new(offset, size);
let size = FramebufferIntSize::new(250, 250);
let bounds = FramebufferIntRect::new(offset, size);

let document_id = api.add_document(size, layer);
let mut txn = Transaction::new();
txn.set_window_parameters(framebuffer_size, bounds, device_pixel_ratio);
txn.set_document_view(bounds, device_pixel_ratio);
txn.set_root_pipeline(pipeline_id);
api.send_transaction(document_id, txn);

self.documents.push(Document {
id: document_id,
pipeline_id,
content_rect: bounds.to_f32() / TypedScale::new(device_pixel_ratio),
content_rect: LayoutRect::new(
LayoutPoint::origin(),
bounds.size.to_f32() / TypedScale::new(device_pixel_ratio),
),
color,
});
}
Expand All @@ -89,7 +91,7 @@ impl Example for App {
api: &RenderApi,
base_builder: &mut DisplayListBuilder,
_txn: &mut Transaction,
framebuffer_size: DeviceIntSize,
framebuffer_size: FramebufferIntSize,
_pipeline_id: PipelineId,
_: DocumentId,
) {
Expand All @@ -98,7 +100,7 @@ impl Example for App {
base_builder.content_size().width;
// this is the first run, hack around the boilerplate,
// which assumes an example only needs one document
self.init(api, framebuffer_size, device_pixel_ratio);
self.init(api, device_pixel_ratio);
}

for doc in &self.documents {
Expand Down
Loading