Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllowing for transparent background color (to be allowed) #601
Comments
|
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? |
|
Yes, that should be fine. |
|
@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? |
|
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. |
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 -->
|
I think this is fixed now - feel free to re-open if further work is required. |
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.