Update to reflect rust-layers changes

It is no longer necessary to flush pending buffer requests when adding
buffers nor to manually create textures for layers.
This commit is contained in:
Martin Robinson 2014-07-16 16:39:00 -07:00
parent 45379a6a61
commit 072a2768e8
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 gfx::render_task::ReRenderMsg;
use layers::layers::LayerBufferSet;
use layers::platform::surface::NativeCompositingGraphicsContext;
use layers::rendergl;
use layers::rendergl::RenderContext;
use layers::scene::Scene;
@ -81,9 +80,6 @@ pub struct IOCompositor {
/// The device pixel ratio for this window.
hidpi_factor: ScaleFactor<ScreenPx, DevicePixel, f32>,
/// The platform-specific graphics context.
graphics_context: NativeCompositingGraphicsContext,
/// Tracks whether the renderer has finished its first rendering
composite_ready: bool,
@ -151,12 +147,11 @@ impl IOCompositor {
window: window,
port: port,
opts: opts,
context: rendergl::init_render_context(),
context: rendergl::init_render_context(CompositorTask::create_graphics_context()),
root_pipeline: None,
scene: Scene::new(window_size.as_f32().to_untyped(), identity()),
window_size: window_size,
hidpi_factor: hidpi_factor,
graphics_context: CompositorTask::create_graphics_context(),
composite_ready: false,
shutdown_state: NotShuttingDown,
recomposite: false,
@ -498,7 +493,6 @@ impl IOCompositor {
layer_id) {
Some(ref layer) => {
assert!(CompositorData::add_buffers(layer.clone(),
&self.graphics_context,
new_layer_buffer_set,
epoch));
self.recomposite = true;
@ -750,7 +744,6 @@ impl IOCompositor {
let recomposite =
CompositorData::get_buffer_requests_recursively(&mut request_map,
layer.clone(),
&self.graphics_context,
rect,
scale.get());
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::rect::Rect;
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::platform::surface::{NativeCompositingGraphicsContext, NativeSurfaceMethods};
use layers::platform::surface::NativeSurfaceMethods;
use servo_msg::compositor_msg::{Epoch, FixedPosition, LayerId};
use servo_msg::compositor_msg::ScrollPolicy;
use servo_msg::constellation_msg::PipelineId;
@ -112,7 +112,6 @@ impl CompositorData {
(RenderChan,
Vec<ReRenderRequest>)>,
layer: Rc<Layer<CompositorData>>,
graphics_context: &NativeCompositingGraphicsContext,
window_rect: Rect<f32>,
scale: f32)
-> bool {
@ -138,10 +137,6 @@ impl CompositorData {
vec.push(msg);
}
if redisplay {
layer.create_textures(graphics_context);
}
let get_child_buffer_request = |kid: &Rc<Layer<CompositorData>>| -> bool {
let mut new_rect = window_rect;
let offset = kid.extra_data.borrow().scroll_offset.to_untyped();
@ -156,7 +151,6 @@ impl CompositorData {
new_rect.size);
CompositorData::get_buffer_requests_recursively(requests,
kid.clone(),
graphics_context,
child_rect,
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
// layer buffer set is consumed, and None is returned.
pub fn add_buffers(layer: Rc<Layer<CompositorData>>,
graphics_context: &NativeCompositingGraphicsContext,
new_buffers: Box<LayerBufferSet>,
epoch: Epoch)
-> bool {
@ -278,21 +271,8 @@ impl CompositorData {
let msg = UnusedBufferMsg(unused_buffers);
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;
}

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