mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Move PaintListener to gfx_traits, Fixes #8834
Adding layers and msg dependency to gfx_traits.
This commit is contained in:
parent
f5eec35cb4
commit
701aebee48
9 changed files with 57 additions and 34 deletions
|
@ -10,3 +10,10 @@ path = "lib.rs"
|
|||
[dependencies.azure]
|
||||
git = "https://github.com/servo/rust-azure"
|
||||
features = ["plugins"]
|
||||
|
||||
[dependencies.layers]
|
||||
git = "https://github.com/servo/rust-layers"
|
||||
features = ["plugins"]
|
||||
|
||||
[dependencies.msg]
|
||||
path = "../msg"
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
|
||||
#![crate_name = "gfx_traits"]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
extern crate azure;
|
||||
extern crate layers;
|
||||
extern crate msg;
|
||||
|
||||
pub mod color;
|
||||
mod paint_listener;
|
||||
|
||||
pub use paint_listener::PaintListener;
|
||||
|
|
34
components/gfx_traits/paint_listener.rs
Normal file
34
components/gfx_traits/paint_listener.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use layers::layers::{BufferRequest, LayerBufferSet};
|
||||
use layers::platform::surface::NativeDisplay;
|
||||
use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerProperties};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
|
||||
/// The interface used by the painter to acquire draw targets for each paint frame and
|
||||
/// submit them to be drawn to the display.
|
||||
pub trait PaintListener {
|
||||
fn native_display(&mut self) -> Option<NativeDisplay>;
|
||||
|
||||
/// Informs the compositor of the layers for the given pipeline. The compositor responds by
|
||||
/// creating and/or destroying paint layers as necessary.
|
||||
fn initialize_layers_for_pipeline(&mut self,
|
||||
pipeline_id: PipelineId,
|
||||
properties: Vec<LayerProperties>,
|
||||
epoch: Epoch);
|
||||
|
||||
/// Sends new buffers for the given layers to the compositor.
|
||||
fn assign_painted_buffers(&mut self,
|
||||
pipeline_id: PipelineId,
|
||||
epoch: Epoch,
|
||||
replies: Vec<(LayerId, Box<LayerBufferSet>)>,
|
||||
frame_tree_id: FrameTreeId);
|
||||
|
||||
/// Inform the compositor that these buffer requests will be ignored.
|
||||
fn ignore_buffer_requests(&mut self, buffer_requests: Vec<BufferRequest>);
|
||||
|
||||
// Notification that the paint task wants to exit.
|
||||
fn notify_paint_task_exiting(&mut self, pipeline_id: PipelineId);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue