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
Script paint worklets arguments #17546
Merged
bors-servo
merged 1 commit into
servo:master
from
asajeffrey:script-paint-worklets-arguments
Jul 29, 2017
+78
−27
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -68,6 +68,7 @@ use style::values::generics::image::{Image, ShapeExtent}; | ||
| use style::values::generics::image::PaintWorklet; | ||
| use style::values::specified::position::{X, Y}; | ||
| use style_traits::CSSPixel; | ||
| use style_traits::ToCss; | ||
| use style_traits::cursor::Cursor; | ||
| use table_cell::CollapsedBordersForCell; | ||
| use webrender_api::{ClipId, ColorF, ComplexClipRegion, GradientStop, LocalClip, RepeatMode}; | ||
| @@ -1173,9 +1174,15 @@ impl FragmentDisplayListBuilding for Fragment { | ||
| let device_pixel_ratio = state.layout_context.style_context.device_pixel_ratio(); | ||
| let size_in_au = unbordered_box.size.to_physical(style.writing_mode); | ||
| let size_in_px = TypedSize2D::new(size_in_au.width.to_f32_px(), size_in_au.height.to_f32_px()); | ||
|
|
||
| // TODO: less copying. | ||
| let name = paint_worklet.name.clone(); | ||
| let arguments = paint_worklet.arguments.iter() | ||
| .map(|argument| argument.to_css_string()) | ||
asajeffrey
Author
Member
|
||
| .collect(); | ||
|
|
||
| // Get the painter, and the computed values for its properties. | ||
| // TODO: less copying. | ||
| let (properties, painter) = match state.layout_context.registered_painters.read().get(&name) { | ||
| Some(registered_painter) => ( | ||
| registered_painter.properties | ||
| @@ -1191,7 +1198,7 @@ impl FragmentDisplayListBuilding for Fragment { | ||
| // TODO: add a one-place cache to avoid drawing the paint image every time. | ||
| // https://github.com/servo/servo/issues/17369 | ||
| debug!("Drawing a paint image {}({},{}).", name, size_in_px.width, size_in_px.height); | ||
| let mut draw_result = painter.draw_a_paint_image(size_in_px, device_pixel_ratio, properties); | ||
| let mut draw_result = painter.draw_a_paint_image(size_in_px, device_pixel_ratio, properties, arguments); | ||
| let webrender_image = WebRenderImageInfo { | ||
| width: draw_result.width, | ||
| height: draw_result.height, | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This is kinda unfortunate... but I guess.