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

Update the sample app to demonstrate clipping and scrolling #1151

Merged
merged 1 commit into from Apr 24, 2017

Conversation

@staktrace
Copy link
Contributor

staktrace commented Apr 21, 2017

This adds some stuff to the sample app that demos clipping and scrolling, including nested scrolling. It also adds a paragraph to the CLIPPING.md detailing the behaviour when multiple define_clip calls are made with the same clip id.


This change is Reviewable

@staktrace
Copy link
Contributor Author

staktrace commented Apr 21, 2017

@staktrace
Copy link
Contributor Author

staktrace commented Apr 21, 2017

FWIW I would really like it if this landed and then was kept up to date by subsequent changes to the clipping API.

@kvark
Copy link
Member

kvark commented Apr 21, 2017

Apologies for an unpopular opinion. This is great thing to have in a sample, but I feel that it's big enough to deserve its own executable.
@glennw maybe we should migrate the new code to examples/scrolling and old code to examples/basic, with webrender project actually having them specified as examples?

@jrmuizel
Copy link
Contributor

jrmuizel commented Apr 21, 2017

@glennw maybe we should migrate the new code to examples/scrolling and old code to examples/basic, with webrender project actually having them specified as examples?

That sounds like a good idea to me.

@staktrace
Copy link
Contributor Author

staktrace commented Apr 21, 2017

That sounds reasonable to me as well. I'll update the PR next week.

@glennw
Copy link
Member

glennw commented Apr 21, 2017

That sounds like a great idea.

bors-servo added a commit that referenced this pull request Apr 24, 2017
Move the sample app from sample/src/main.rs to webrender/examples/basic.rs

As suggested in #1151 this moves the existing sample app to be an "example" of the webrender library. As it gets built when running `cargo test` on the webrender library, it doesn't need separate build steps in the travis/appveyor CI configs.

I'm not sure why the sample app pulled in webrender_traits `default_features = false` but I dropped that when migrating the Cargo.toml spec, since there doesn't seem to be a way of specifying it just for a particular example.

<!-- 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/1160)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2017

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

@staktrace staktrace force-pushed the staktrace:clip branch from ec60716 to 736c8dd Apr 24, 2017
@staktrace
Copy link
Contributor Author

staktrace commented Apr 24, 2017

Updated PR to be rebased on top of #1160. This now adds an examples/scrolling.rs example app that demonstrates scrolling. The app is mostly what I had before (the old sample app with my scrolling changes) but now I ripped out all the stuff not related to scrolling as well (like the blob image stuff and touch-gestures stuff). The interesting part of the app is around line 145 in scrolling.rs, inside the if true { ... } block.

@glennw
Copy link
Member

glennw commented Apr 24, 2017

It probably makes sense to put all the common init code in a shared file for all examples to use, but that can be done once we have a few examples and a better idea of which code can be shared.

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2017

📌 Commit 736c8dd has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2017

Testing commit 736c8dd with merge 2066d92...

bors-servo added a commit that referenced this pull request Apr 24, 2017
Update the sample app to demonstrate clipping and scrolling

This adds some stuff to the sample app that demos clipping and scrolling, including nested scrolling. It also adds a paragraph to the CLIPPING.md detailing the behaviour when multiple define_clip calls are made with the same clip id.

<!-- 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/1151)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2017

☀️ Test successful - status-travis
Approved by: glennw
Pushing 2066d92 to master...

@bors-servo bors-servo merged commit 736c8dd into servo:master Apr 24, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@staktrace staktrace deleted the staktrace:clip branch Apr 24, 2017
bors-servo added a commit that referenced this pull request Apr 25, 2017
Update clipping documentation

When I updated the commit in #1151 I forgot to include the CLIPPING.md changes. I still think they're worth keeping though, so here they are.

<!-- 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/1166)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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