Skip to content

Add a few comments to the code. - #488

Merged
bors-servo merged 1 commit into
servo:masterfrom
nical:doc
Oct 30, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
nical:doc

Conversation

@nical

@nical nical commented Oct 27, 2016 •

Copy link
Copy Markdown
Contributor

This isn't much but it's a start and was a good exercise to get started with the code. This PR adds a few comments next to some areas that looked important while not being immediately obvious to me.


This change is Reviewable

@nical

nical commented Oct 27, 2016 •

Copy link
Copy Markdown
Contributor Author

@glennw r?

Don't hesitate to rephrase/complete the comments in the review, I'll update the commits.

In particular I didn't manage to properly word the difference between Frame and Scene, and some structures have "Packed-" equivalents and I am not sure if it is a memory optimization or something that ends up in a gl buffer object.

@kvark kvark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! minus a few nits

Comment thread webrender/src/internal_types.rs Outdated
}
}

// Mostly wraps a tiling::Frame, adding a bit of extra information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong comment style? // instead of ///

Comment thread webrender/src/layer.rs Outdated
pub combined_local_viewport_rect: Rect<f32>,

// World transform for the viewport rect itself.
// World transform for the viewport rect itself.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this an extra space?

Comment thread webrender/src/render_backend.rs Outdated
use offscreen_gl_context::GLContextDispatcher;

/// The render backend is responsible for transforming high level display lists into
/// GPU-friendly work which is then submitted to thre renderer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"thre"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth mentioning that it produces frames (Frame), which are sent to the renderer

Comment thread webrender/src/tiling.rs Outdated
let prim_bounding_rect = ctx.prim_store.get_bounding_rect(prim_index);

// If an opaque primitive covers a tile entirely, we can discard
// all primitives underneith it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"underneith"

Comment thread webrender/src/internal_types.rs Outdated

/// Mostly wraps a tiling::Frame, adding a bit of extra information.
pub struct RendererFrame {
// The last rendered epoch for each pipeline present in the frame.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be /// as well

Comment thread webrender/src/layer.rs Outdated

/// Contains scroll and transform information for scrollable and root stacking contexts.
pub struct Layer {
// Manages scrolling offset, overscroll state etc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will need to be fixed too, although not necessarily in your PR since you didn't touch them.

Comment thread webrender/src/tiling.rs Outdated
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct ScreenTileIndex(usize);

// For debugging purposes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change it to a real comment, if possible, preceded by ///

@glennw

glennw commented Oct 27, 2016

Copy link
Copy Markdown
Member

This looks good to me once kvark's comments are addressed.

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #480) made this pull request unmergeable. Please resolve the merge conflicts.

@glennw

glennw commented Oct 30, 2016

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 14c35a4 has been approved by glennw

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 14c35a4 with merge 8d7ad2d...

bors-servo pushed a commit that referenced this pull request Oct 30, 2016
Add a few comments to the code.

This isn't much but it's a start and was a good exercise to get started with the code. This PR adds a few comments next to some areas that looked important while not being immediately obvious to me.

<!-- 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/488)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-travis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants