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

Allowing for transparent background color (to be allowed) #601

Closed
jaredpetker opened this issue Nov 28, 2016 · 5 comments
Closed

Allowing for transparent background color (to be allowed) #601

jaredpetker opened this issue Nov 28, 2016 · 5 comments

Comments

@jaredpetker
Copy link
Contributor

@jaredpetker jaredpetker commented Nov 28, 2016

I am trying to use webrender itself outside of the context of servo, and found that there isn't currently a way to simply have a fully transparent root background color. There seems to be some comments around such things here.

It seems like handing in a fully transparent root background color is not allowable at the moment, basically my use case is drawing on top of something else with webrender, so I don't actually want to a) draw any background color or b) clear the background color at all, I just want to draw on top of some other stuff.

Any thoughts on adding some option which would allow for such behavior or how such behavior would like to be added? I've no issue adding the feature myself to help.

@nical
Copy link
Collaborator

@nical nical commented Nov 28, 2016

I think that it should be fine to remove the forced white background and make sure that servo specifies an opaque background color for its root stacking context to get the same effect. Gecko will eventually also need to be able to draw on top of a semi-transparent widget.

What do you thing @kvark?

@kvark
Copy link
Member

@kvark kvark commented Nov 28, 2016

Yes, that should be fine.

@glennw
Copy link
Member

@glennw glennw commented Nov 29, 2016

@jaredpetker Yup, adding optional functionality to skip any clear / background rect sounds good to me.

For now, it could probably just be a field in the RendererOptions struct that gets passed to WR during initialization. This would allow you to get the functionality working, and then we could consider a public API for it later if we ever want to change that option dynamically?

@jaredpetker
Copy link
Contributor Author

@jaredpetker jaredpetker commented Nov 29, 2016

I can go with that. I've found everywhere that seems to do clearing (the initial stacking context bounds rect, tiling, etc), will do, thanks.

bors-servo added a commit that referenced this issue Dec 12, 2016
Add more control over when and how to clear the framebuffer.

This pull request addresses issue #601. The RendererOptions now specify a default clear color for the main framebuffer (intermediate targets are cleared with transparent black in any case), an option to always clear using the device's clear function, and a separate option to use the clear shader for empty tiles (previously referred to as "clear tiles"). Note that the clear shader ignores the clear color and always uses opaque white.

I don't know if we want to keep the clear shader around, I am pretty sure it is currently never used because of the enforced background rectangle in frame.rs. If we want to get rid of it, I can add that to the PR (I don't know if we'd keep the information about empty tiles or not, probably should?), or we can leave it and decide later.

Edit: Removed confusion about non-root pipelines.

<!-- 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/605)
<!-- Reviewable:end -->
@glennw
Copy link
Member

@glennw glennw commented Jan 19, 2017

I think this is fixed now - feel free to re-open if further work is required.

@glennw glennw closed this Jan 19, 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
4 participants
You can’t perform that action at this time.