Made PipelineId non-zero, so optional ids take no more space.

This commit is contained in:
Alan Jeffrey 2017-09-15 11:50:30 -05:00
parent a0afa66dbe
commit 6754b2834f
11 changed files with 79 additions and 33 deletions

View file

@ -6,6 +6,7 @@ use CompositionPipeline;
use SendableFrameTree;
use compositor_thread::{CompositorProxy, CompositorReceiver};
use compositor_thread::{InitialCompositorState, Msg, RenderListener};
use core::nonzero::NonZero;
use euclid::{Point2D, TypedPoint2D, TypedVector2D, ScaleFactor};
use gfx_traits::Epoch;
use gleam::gl;
@ -61,7 +62,7 @@ impl ConvertPipelineIdFromWebRender for webrender_api::PipelineId {
fn from_webrender(&self) -> PipelineId {
PipelineId {
namespace_id: PipelineNamespaceId(self.0),
index: PipelineIndex(self.1),
index: PipelineIndex(NonZero::new(self.1).expect("Webrender pipeline zero?")),
}
}
}