Skip to content
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

Introduce PicturePrimitive::Image. #2031

Merged
merged 3 commits into from Nov 15, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Hide StackingContext

  • Loading branch information
kvark authored and gw3583 committed Nov 13, 2017
commit 0633bb375e547cfff160b7066a7128b7582e9ea2
@@ -4,7 +4,8 @@

use api::{BorderRadiusKind, ColorF, LayerPoint, LayerRect, LayerSize, LayerVector2D};
use api::{BorderRadius, BoxShadowClipMode, LayoutSize, LayerPrimitiveInfo};
use api::{ClipMode, ComplexClipRegion, EdgeAaSegmentMask, LocalClip, ClipAndScrollInfo};
use api::{ClipMode, ClipAndScrollInfo, ComplexClipRegion, EdgeAaSegmentMask, LocalClip};
use api::{PipelineId};
use clip::ClipSource;
use frame_builder::FrameBuilder;
use prim_store::{PrimitiveContainer, RectangleContent, RectanglePrimitive};
@@ -24,6 +25,7 @@ pub const MASK_CORNER_PADDING: f32 = 4.0;
impl FrameBuilder {
pub fn add_box_shadow(
&mut self,
pipeline_id: PipelineId,
clip_and_scroll: ClipAndScrollInfo,
prim_info: &LayerPrimitiveInfo,
box_offset: &LayerVector2D,
@@ -51,8 +53,8 @@ impl FrameBuilder {
spread_amount,
);
let shadow_rect = prim_info.rect
.translate(box_offset)
.inflate(spread_amount, spread_amount);
.translate(box_offset)
.inflate(spread_amount, spread_amount);

if blur_radius == 0.0 {
let mut clips = Vec::new();
@@ -109,7 +111,6 @@ impl FrameBuilder {
}),
);
} else {
let pipeline_id = self.sc_stack.last().unwrap().pipeline_id;
let blur_offset = BLUR_SAMPLE_SCALE * blur_radius;
let mut extra_clips = vec![];

@@ -537,6 +537,7 @@ impl<'a> FlattenContext<'a> {
let mut prim_info = prim_info.clone();
prim_info.rect = bounds;
self.builder.add_box_shadow(
pipeline_id,
clip_and_scroll,
&prim_info,
&box_shadow_info.offset,
@@ -45,27 +45,27 @@ pub struct ScrollbarInfo(pub ClipId, pub LayerRect);
/// Properties of a stacking context that are maintained
/// during creation of the scene. These structures are
/// not persisted after the initial scene build.
pub struct StackingContext {
struct StackingContext {
/// Pipeline this stacking context belongs to.
pub pipeline_id: PipelineId,
pipeline_id: PipelineId,

/// Filters / mix-blend-mode effects
pub composite_ops: CompositeOps,
composite_ops: CompositeOps,

/// If true, visible when backface is visible.
pub is_backface_visible: bool,
is_backface_visible: bool,

/// Allow subpixel AA for text runs on this stacking context.
/// This is a temporary hack while we don't support subpixel AA
/// on transparent stacking contexts.
pub allow_subpixel_aa: bool,
allow_subpixel_aa: bool,

/// CSS transform-style property.
pub transform_style: TransformStyle,
transform_style: TransformStyle,

/// The primitive index for the root Picture primitive
/// that this stacking context is mapped to.
pub pic_prim_index: PrimitiveIndex,
pic_prim_index: PrimitiveIndex,
}

#[derive(Clone, Copy)]
@@ -121,7 +121,7 @@ pub struct FrameBuilder {

/// A temporary stack of stacking context properties, used only
/// during scene building.
pub sc_stack: Vec<StackingContext>,
sc_stack: Vec<StackingContext>,
}

pub struct PrimitiveContext<'a> {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.