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

Split the ClipScrollTree #2871

Merged
merged 1 commit into from Jul 10, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Split the ClipScrollTree

Split the ClipScrollTree into a collection of spatial nodes and a
collection of clipping nodes. This makes it so that no unnecessary work
is done or storage is used for clipping nodes. It also allows us to
simplify certain bits of code that had to deal with both types of nodes.

During display list "flattening," positioning ClipIds are converted to
SpatialNodeIndices by consulting the ClipNode for their positioning
node. ClipIds were already converted directly into ClipChainIndices.

Eventually this change should make it to the API, meaning that we expose
the difference between the different node types. This will make it
harder to misuse the API and allow us to do away with looking up the
positioning node of clips during flattening.
  • Loading branch information
mrobinson committed Jul 9, 2018
commit 6a09b9a77058af7ef553e2a22e14aaaaffb3fb87
@@ -475,8 +475,8 @@ impl AlphaBatchBuilder {

// Add each run in this picture to the batch.
for run in &pic.runs {
let scroll_node = &ctx.clip_scroll_tree.nodes[run.clip_and_scroll.scroll_node_id.0];
let transform_id = ctx.transforms.get_id(scroll_node.transform_index);
let transform_id =
ctx.transforms.get_id(run.clip_and_scroll.scroll_node_id.transform_index());
self.add_run_to_batch(
run,
transform_id,
@@ -670,7 +670,7 @@ impl AlphaBatchBuilder {
debug_assert!(picture.surface.is_some());

let real_xf = &ctx.clip_scroll_tree
.nodes[picture.reference_frame_index.0]
.spatial_nodes[picture.reference_frame_index.0]
.world_content_transform
.into();
let polygon = make_polygon(
@@ -7,11 +7,11 @@ use api::{ImageRendering, LayoutRect, LayoutSize, LayoutPoint, LayoutVector2D, L
use api::{BoxShadowClipMode, LayoutToWorldScale, LineOrientation, LineStyle};
use border::{ensure_no_corner_overlap};
use box_shadow::{BLUR_SAMPLE_SCALE, BoxShadowClipSource, BoxShadowCacheKey};
use clip_scroll_tree::{ClipChainIndex, CoordinateSystemId, TransformIndex};
use clip_scroll_tree::{ClipChainIndex, CoordinateSystemId};
use ellipse::Ellipse;
use freelist::{FreeList, FreeListHandle, WeakFreeListHandle};
use gpu_cache::{GpuCache, GpuCacheHandle, ToGpuBlocks};
use gpu_types::{BoxShadowStretchMode};
use gpu_types::{BoxShadowStretchMode, TransformIndex};
use prim_store::{ClipData, ImageMaskData};
use render_task::to_cache_size;
use resource_cache::{ImageRequest, ResourceCache};
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.