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

Convert the units used in the PaintContext struct to use typed units. #7023

Closed
glennw opened this issue Aug 6, 2015 · 3 comments
Closed

Convert the units used in the PaintContext struct to use typed units. #7023

glennw opened this issue Aug 6, 2015 · 3 comments

Comments

@glennw
Copy link
Member

@glennw glennw commented Aug 6, 2015

To avoid retina display related bugs.

@jdm jdm added the A-gfx/rendering label Aug 6, 2015
@mskrzypkows
Copy link

@mskrzypkows mskrzypkows commented Sep 9, 2015

I'd like to try this one.

As I understand, I have to change Rect to TypedRect for screen and page:

pub struct PaintContext<'a> {
    pub draw_target: DrawTarget,
    pub font_context: &'a mut Box<FontContext>,
    /// The rectangle that this context encompasses in page coordinates.
    pub page_rect: TypedRect<PagePx, f32>,
    /// The rectangle that this context encompasses in screen coordinates (pixels).
    pub screen_rect: TypedRect<ScreenPx, usize>,
    /// The clipping rect for the stacking context as a whole.
    pub clip_rect: Option<Rect<Au>>,
    /// The current transient clipping region, if any. A "transient clipping region" is the
    /// clipping region used by the last display item. We cache the last value so that we avoid
    /// pushing and popping clipping regions unnecessarily.
    pub transient_clip: Option<ClippingRegion>,
    /// A temporary hack to disable clipping optimizations on 3d layers.
    pub layer_kind: LayerKind,
}

And then convert units. Am I right?

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Sep 9, 2015

Yes, that's correct.

mskrzypkows pushed a commit to mskrzypkows/servo that referenced this issue Sep 21, 2015
mskrzypkows pushed a commit to mskrzypkows/servo that referenced this issue Oct 28, 2015
Needs update to_nearest_pixel method in app_unit module.
Argument of to_nearest_pixel should be:
ScaleFactor<PagePx, ScreenPx, f32>
mskrzypkows pushed a commit to mskrzypkows/servo that referenced this issue Oct 30, 2015
Needs update to_nearest_pixel method in app_unit module.
Argument of to_nearest_pixel should be:
ScaleFactor<PagePx, ScreenPx, f32>
mskrzypkows pushed a commit to mskrzypkows/servo that referenced this issue Nov 4, 2015
Needs update to_nearest_pixel method in app_unit module.
Argument of to_nearest_pixel should be:
ScaleFactor<PagePx, ScreenPx, f32>
bors-servo added a commit that referenced this issue Nov 6, 2015
Draft. Change PaintContext rects to TypedRects #7023

I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7696)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Nov 6, 2015
Draft. Change PaintContext rects to TypedRects #7023

I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7696)
<!-- Reviewable:end -->
@mrobinson
Copy link
Member

@mrobinson mrobinson commented Aug 11, 2017

Closing this since PaintContext was removed in fdf9312.

@mrobinson mrobinson closed this Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.