Skip to content

Commit bbc60b9

Browse files
author
bors-servo
authored
Auto merge of #1790 - kvark:clipped-text-shadow, r=jrmuizel
Cleaner prepare primitives for rendering Closes #1786 (includes it here) Fixes #1779 This is mostly moving things around, splitting the preparation into more comprehensible functions, refactoring the internals a bit. The solution to the crash is to call the `prepare_..._inner` instead of the basic `prepare_` for the dependencies, which makes it avoid the screen bound checks among other things. Gecko try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=45c3d6b1bc112dc918c3e359d9c171164ce6595d <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1790) <!-- Reviewable:end -->
2 parents 8ce0212 + 635df2b commit bbc60b9

File tree

4 files changed

+241
-161
lines changed

4 files changed

+241
-161
lines changed

webrender/src/frame_builder.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
use api::{BorderDetails, BorderDisplayItem, BorderRadius, BoxShadowClipMode, ClipAndScrollInfo};
6-
use api::{ClipId, ColorF, DeviceIntPoint, DeviceIntRect, DeviceIntSize, DeviceUintRect};
7-
use api::{DeviceUintSize, ExtendMode, FIND_ALL, FilterOp, FontInstance, FontRenderMode};
5+
use api::{BorderDetails, BorderDisplayItem, BorderRadius, BoxShadowClipMode, BuiltDisplayList};
6+
use api::{ClipAndScrollInfo, ClipId, ColorF};
7+
use api::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DeviceUintRect, DeviceUintSize};
8+
use api::{ExtendMode, FIND_ALL, FilterOp, FontInstance, FontRenderMode};
89
use api::{GlyphInstance, GlyphOptions, GradientStop, HitTestFlags, HitTestItem, HitTestResult};
910
use api::{ImageKey, ImageRendering, ItemRange, ItemTag, LayerPoint, LayerPrimitiveInfo, LayerRect};
1011
use api::{LayerSize, LayerToScrollTransform, LayerVector2D, LayoutVector2D, LineOrientation};
@@ -24,7 +25,7 @@ use plane_split::{BspSplitter, Polygon, Splitter};
2425
use prim_store::{BoxShadowPrimitiveCpu, TexelRect, YuvImagePrimitiveCpu};
2526
use prim_store::{GradientPrimitiveCpu, ImagePrimitiveCpu, LinePrimitive, PrimitiveKind};
2627
use prim_store::{PrimitiveContainer, PrimitiveIndex};
27-
use prim_store::{PrimitiveStore, RadialGradientPrimitiveCpu, TextRunMode};
28+
use prim_store::{PrimitiveStore, RadialGradientPrimitiveCpu};
2829
use prim_store::{RectanglePrimitive, TextRunPrimitiveCpu, TextShadowPrimitiveCpu};
2930
use profiler::{FrameProfileCounters, GpuCacheProfileCounters, TextureCacheProfileCounters};
3031
use render_task::{AlphaRenderItem, ClipWorkItem, RenderTask};
@@ -128,6 +129,8 @@ pub struct PrimitiveContext<'a> {
128129
pub current_clip_stack: Vec<ClipWorkItem>,
129130
pub clip_bounds: DeviceIntRect,
130131
pub clip_id: ClipId,
132+
133+
pub display_list: &'a BuiltDisplayList,
131134
}
132135

133136
impl<'a> PrimitiveContext<'a> {
@@ -139,6 +142,7 @@ impl<'a> PrimitiveContext<'a> {
139142
clip_scroll_tree: &ClipScrollTree,
140143
clip_store: &ClipStore,
141144
device_pixel_ratio: f32,
145+
display_list: &'a BuiltDisplayList,
142146
) -> Option<Self> {
143147

144148
let mut current_clip_stack = Vec::new();
@@ -194,6 +198,7 @@ impl<'a> PrimitiveContext<'a> {
194198
clip_bounds,
195199
device_pixel_ratio,
196200
clip_id,
201+
display_list,
197202
})
198203
}
199204
}
@@ -1714,6 +1719,7 @@ impl FrameBuilder {
17141719
clip_scroll_tree,
17151720
&self.clip_store,
17161721
device_pixel_ratio,
1722+
display_list,
17171723
);
17181724

17191725
let prim_context = match prim_context {
@@ -1739,8 +1745,6 @@ impl FrameBuilder {
17391745
&prim_context,
17401746
resource_cache,
17411747
gpu_cache,
1742-
display_list,
1743-
TextRunMode::Normal,
17441748
render_tasks,
17451749
&mut self.clip_store,
17461750
) {

0 commit comments

Comments
 (0)