Merge pull request #2870 from mrobinson/more-cleanup

Update to reflect rust-layers changes
This commit is contained in:
Cameron Zwarich 2014-07-18 23:48:45 -07:00
commit ca96821902
3 changed files with 4 additions and 31 deletions

View file

@ -28,7 +28,6 @@ use geom::size::TypedSize2D;
use geom::scale_factor::ScaleFactor; use geom::scale_factor::ScaleFactor;
use gfx::render_task::ReRenderMsg; use gfx::render_task::ReRenderMsg;
use layers::layers::LayerBufferSet; use layers::layers::LayerBufferSet;
use layers::platform::surface::NativeCompositingGraphicsContext;
use layers::rendergl; use layers::rendergl;
use layers::rendergl::RenderContext; use layers::rendergl::RenderContext;
use layers::scene::Scene; use layers::scene::Scene;
@ -81,9 +80,6 @@ pub struct IOCompositor {
/// The device pixel ratio for this window. /// The device pixel ratio for this window.
hidpi_factor: ScaleFactor<ScreenPx, DevicePixel, f32>, hidpi_factor: ScaleFactor<ScreenPx, DevicePixel, f32>,
/// The platform-specific graphics context.
graphics_context: NativeCompositingGraphicsContext,
/// Tracks whether the renderer has finished its first rendering /// Tracks whether the renderer has finished its first rendering
composite_ready: bool, composite_ready: bool,
@ -151,12 +147,11 @@ impl IOCompositor {
window: window, window: window,
port: port, port: port,
opts: opts, opts: opts,
context: rendergl::init_render_context(), context: rendergl::init_render_context(CompositorTask::create_graphics_context()),
root_pipeline: None, root_pipeline: None,
scene: Scene::new(window_size.as_f32().to_untyped(), identity()), scene: Scene::new(window_size.as_f32().to_untyped(), identity()),
window_size: window_size, window_size: window_size,
hidpi_factor: hidpi_factor, hidpi_factor: hidpi_factor,
graphics_context: CompositorTask::create_graphics_context(),
composite_ready: false, composite_ready: false,
shutdown_state: NotShuttingDown, shutdown_state: NotShuttingDown,
recomposite: false, recomposite: false,
@ -498,7 +493,6 @@ impl IOCompositor {
layer_id) { layer_id) {
Some(ref layer) => { Some(ref layer) => {
assert!(CompositorData::add_buffers(layer.clone(), assert!(CompositorData::add_buffers(layer.clone(),
&self.graphics_context,
new_layer_buffer_set, new_layer_buffer_set,
epoch)); epoch));
self.recomposite = true; self.recomposite = true;
@ -750,7 +744,6 @@ impl IOCompositor {
let recomposite = let recomposite =
CompositorData::get_buffer_requests_recursively(&mut request_map, CompositorData::get_buffer_requests_recursively(&mut request_map,
layer.clone(), layer.clone(),
&self.graphics_context,
rect, rect,
scale.get()); scale.get());
for (_pipeline_id, (chan, requests)) in request_map.move_iter() { for (_pipeline_id, (chan, requests)) in request_map.move_iter() {

View file

@ -10,9 +10,9 @@ use azure::azure_hl::Color;
use geom::point::TypedPoint2D; use geom::point::TypedPoint2D;
use geom::rect::Rect; use geom::rect::Rect;
use geom::size::{Size2D, TypedSize2D}; use geom::size::{Size2D, TypedSize2D};
use gfx::render_task::{ReRenderRequest, ReRenderMsg, RenderChan, UnusedBufferMsg}; use gfx::render_task::{ReRenderRequest, RenderChan, UnusedBufferMsg};
use layers::layers::{Layer, LayerBufferSet}; use layers::layers::{Layer, LayerBufferSet};
use layers::platform::surface::{NativeCompositingGraphicsContext, NativeSurfaceMethods}; use layers::platform::surface::NativeSurfaceMethods;
use servo_msg::compositor_msg::{Epoch, FixedPosition, LayerId}; use servo_msg::compositor_msg::{Epoch, FixedPosition, LayerId};
use servo_msg::compositor_msg::ScrollPolicy; use servo_msg::compositor_msg::ScrollPolicy;
use servo_msg::constellation_msg::PipelineId; use servo_msg::constellation_msg::PipelineId;
@ -112,7 +112,6 @@ impl CompositorData {
(RenderChan, (RenderChan,
Vec<ReRenderRequest>)>, Vec<ReRenderRequest>)>,
layer: Rc<Layer<CompositorData>>, layer: Rc<Layer<CompositorData>>,
graphics_context: &NativeCompositingGraphicsContext,
window_rect: Rect<f32>, window_rect: Rect<f32>,
scale: f32) scale: f32)
-> bool { -> bool {
@ -138,10 +137,6 @@ impl CompositorData {
vec.push(msg); vec.push(msg);
} }
if redisplay {
layer.create_textures(graphics_context);
}
let get_child_buffer_request = |kid: &Rc<Layer<CompositorData>>| -> bool { let get_child_buffer_request = |kid: &Rc<Layer<CompositorData>>| -> bool {
let mut new_rect = window_rect; let mut new_rect = window_rect;
let offset = kid.extra_data.borrow().scroll_offset.to_untyped(); let offset = kid.extra_data.borrow().scroll_offset.to_untyped();
@ -156,7 +151,6 @@ impl CompositorData {
new_rect.size); new_rect.size);
CompositorData::get_buffer_requests_recursively(requests, CompositorData::get_buffer_requests_recursively(requests,
kid.clone(), kid.clone(),
graphics_context,
child_rect, child_rect,
scale) scale)
} }
@ -254,7 +248,6 @@ impl CompositorData {
// If the epoch of the message does not match the layer's epoch, the message is ignored, the // If the epoch of the message does not match the layer's epoch, the message is ignored, the
// layer buffer set is consumed, and None is returned. // layer buffer set is consumed, and None is returned.
pub fn add_buffers(layer: Rc<Layer<CompositorData>>, pub fn add_buffers(layer: Rc<Layer<CompositorData>>,
graphics_context: &NativeCompositingGraphicsContext,
new_buffers: Box<LayerBufferSet>, new_buffers: Box<LayerBufferSet>,
epoch: Epoch) epoch: Epoch)
-> bool { -> bool {
@ -278,21 +271,8 @@ impl CompositorData {
let msg = UnusedBufferMsg(unused_buffers); let msg = UnusedBufferMsg(unused_buffers);
let _ = layer.extra_data.borrow().pipeline.render_chan.send_opt(msg); let _ = layer.extra_data.borrow().pipeline.render_chan.send_opt(msg);
} }
let (pending_buffer_requests, scale) = layer.flush_pending_buffer_requests();
if !pending_buffer_requests.is_empty() {
let mut requests = Vec::new();
requests.push(ReRenderRequest {
buffer_requests: pending_buffer_requests,
scale: scale,
layer_id: layer.extra_data.borrow().id,
epoch: layer.extra_data.borrow().epoch,
});
let _ = layer.extra_data.borrow().pipeline.render_chan.send_opt(ReRenderMsg(requests));
}
} }
layer.create_textures(graphics_context);
return true; return true;
} }

@ -1 +1 @@
Subproject commit ff77c40da5b2406cb52deea6e8830182e22bda3a Subproject commit 0f47c0a74863ccc7819c6667a4556f7b9b585670