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

Decompose tiled images during frame building (v4) #2742

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

Always

Just for now

Remove the non-brush image primitive and shader.

  • Loading branch information
nical authored and jrmuizel committed May 10, 2018
commit 8c1768e2eb7a8d2014055a9807e6fda92efa1db5

This file was deleted.

@@ -40,7 +40,6 @@ const OPAQUE_TASK_ADDRESS: RenderTaskAddress = RenderTaskAddress(0x7fff);
#[cfg_attr(feature = "replay", derive(Deserialize))]
pub enum TransformBatchKind {
TextRun(GlyphFormat),
Image(ImageBufferKind),
BorderCorner,
BorderEdge,
}
@@ -1109,50 +1108,6 @@ impl AlphaBatchBuilder {
}
}
}
PrimitiveKind::Image => {
let image_cpu = &ctx.prim_store.cpu_images[prim_metadata.cpu_prim_index.0];

let cache_item = match image_cpu.source {
ImageSource::Default => {
resolve_image(
image_cpu.key.request,
ctx.resource_cache,
gpu_cache,
deferred_resolves,
)
}
ImageSource::Cache { ref handle, .. } => {
let rt_handle = handle
.as_ref()
.expect("bug: render task handle not allocated");
let rt_cache_entry = ctx
.resource_cache
.get_cached_render_task(rt_handle);
ctx.resource_cache.get_texture_cache_item(&rt_cache_entry.handle)
}
};

if cache_item.texture_id == SourceTexture::Invalid {
warn!("Warnings: skip a PrimitiveKind::Image");
debug!("at {:?}.", task_relative_bounding_rect);
return;
}

let batch_kind = TransformBatchKind::Image(get_buffer_kind(cache_item.texture_id));
let key = BatchKey::new(
BatchKind::Transformable(transform_kind, batch_kind),
non_segmented_blend_mode,
BatchTextures {
colors: [
cache_item.texture_id,
SourceTexture::Invalid,
SourceTexture::Invalid,
],
},
);
let batch = self.batch_list.get_suitable_batch(key, &task_relative_bounding_rect);
batch.push(base_instance.build(cache_item.uv_rect_handle.as_int(gpu_cache), 0, 0));
}
PrimitiveKind::TextRun => {
let text_cpu =
&ctx.prim_store.cpu_text_runs[prim_metadata.cpu_prim_index.0];
@@ -1643,13 +1598,6 @@ impl AlphaBatchHelpers for PrimitiveStore {
}
}
}
PrimitiveKind::Image => {
let image_cpu = &self.cpu_images[metadata.cpu_prim_index.0];
match image_cpu.alpha_type {
AlphaType::PremultipliedAlpha => BlendMode::PremultipliedAlpha,
AlphaType::Alpha => BlendMode::Alpha,
}
}
}
}
}
@@ -30,7 +30,7 @@ use prim_store::{CachedGradientIndex, EdgeAaSegmentMask, ImageSource};
use prim_store::{BrushSegment, PictureIndex, PrimitiveContainer, PrimitiveIndex, PrimitiveStore};
use prim_store::{OpacityBinding, ScrollNodeAndClipChain, TextRunPrimitiveCpu};
use render_backend::{DocumentView};
use resource_cache::{FontInstanceMap, ImageRequest, TiledImageMap};
use resource_cache::{FontInstanceMap, ImageRequest};
use scene::{Scene, ScenePipeline, StackingContextHelpers};
use scene_builder::{BuiltScene, SceneRequest};
use std::{f32, mem, usize};
@@ -150,9 +150,6 @@ pub struct DisplayListFlattener<'a> {
/// The map of all font instances.
font_instances: FontInstanceMap,

/// The map of tiled images.
tiled_image_map: TiledImageMap,

/// Used to track the latest flattened epoch for each pipeline.
pipeline_epochs: Vec<(PipelineId, Epoch)>,

@@ -207,7 +204,6 @@ impl<'a> DisplayListFlattener<'a> {
scene: &Scene,
clip_scroll_tree: &mut ClipScrollTree,
font_instances: FontInstanceMap,
tiled_image_map: TiledImageMap,
view: &DocumentView,
output_pipelines: &FastHashSet<PipelineId>,
frame_builder_config: &FrameBuilderConfig,
@@ -227,7 +223,6 @@ impl<'a> DisplayListFlattener<'a> {
scene,
clip_scroll_tree,
font_instances,
tiled_image_map,
config: *frame_builder_config,
pipeline_epochs: Vec::new(),
replacements: Vec::new(),
@@ -2199,7 +2194,6 @@ pub fn build_scene(config: &FrameBuilderConfig, request: SceneRequest) -> BuiltS
&request.scene,
&mut clip_scroll_tree,
request.font_instances,
request.tiled_image_map,
&request.view,
&request.output_pipelines,
config,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.