Commit graph

419 commits

Author SHA1 Message Date
Ms2ger
d5cc791d31 Rename paint_task::Msg variants. 2015-01-04 11:06:07 +01:00
bors-servo
e8fac3681b auto merge of #4535 : servo/servo/pre-rustup_20141221, r=jdm
This prepares for the rust upgrade currently being conducted.
2015-01-03 14:39:46 -07:00
Martin Robinson
c0b397322f Stall PaintTask exit until it can release all buffers
It is possible for a PaintTask to start exiting soon after sending new
buffers to the compositor. In that case, the compositor should return
the now unnecessary buffers to the PaintTask so that it can properly
free them.

To accomplish this, the compositor now keeps a hash map of paint task
channels per pipeline id. When a PaintTask exists, the constellation
informs the compositor that it can forget about it. Additionally, the
PaintTask should not wait for any buffers when the engine is doing a
complete shutdown. In that case, the compositor is already halted and
has simply let all buffers leak. We pipe through the shutdown type when
destroying the pipeline to make this decision.

Fixes #2641.
2015-01-02 15:20:32 -08:00
Ms2ger
b51e83819d Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
2015-01-02 19:04:18 +01:00
bors-servo
5d8ec54959 auto merge of #4487 : Ms2ger/servo/gfx-test, r=jdm
Note that I had to change some expectations to make them pass.
2014-12-30 09:03:45 -07:00
Ms2ger
67eafea8ef Reformat the transform_text tests. 2014-12-30 10:11:40 +01:00
Benjamin Peterson
28fa83e36b use geom::num::Zero rather than the deprecated num::Zero trait in std
This fixes the following warning:
display_list/mod.rs:735:20: 735:30 warning: use of deprecated item: Use `Int::zero()` or `Float::zero()`., #[warn(deprecated)] on by default
display_list/mod.rs:735         let zero = Zero::zero();
                                           ^~~~~~~~~~
2014-12-29 18:30:16 -06:00
Ms2ger
767d0e11bf Cleanup the transform_text tests. 2014-12-28 12:03:25 +01:00
Ms2ger
aa18c84f0c Re-enable two transform_text unit tests.
Note that I had to change some expectations to make them pass.
2014-12-27 16:14:32 +01:00
Manish Goregaokar
e973213606 gfx: to_string() -> into_string() 2014-12-27 14:48:35 +01:00
Patrick Walton
cc7cacfd5f gfx: Clip the background properly when border-radius is used.
Improves Reddit, GitHub, etc.
2014-12-22 14:48:55 -08:00
Patrick Walton
b22b29533a gfx: Fix a nasty bug whereby the transient clip was not always removed,
causing elements to be randomly clipped out.

Improves Wikipedia, Reddit, etc.
2014-12-22 14:48:55 -08:00
Patrick Walton
dea8375613 gfx: Refactor the border drawing code and split out fragment display
list building into multiple functions.

This should have no functional changes; it's just code cleanup.
2014-12-22 14:48:55 -08:00
Adenilson Cavalcanti
4bfe134c84 Similar to groove/ridge case, inset/outset would scale the color to
decorate the border. Scale fails when the color is black (i.e. zero),
thus this patch will fix this issue by using a fixed color.
2014-12-18 13:54:32 -08:00
Tetsuharu OHZEKI
a590012322 gfx: Remove glob imports added in #4405 2014-12-19 00:54:50 +09:00
Simon Sapin
bf4480bb79 Simplify util::range::RangeIndex to always require std::num::Int,
and fix remaining warnings.
2014-12-18 11:34:23 +00:00
Simon Sapin
084a63df45 Remove usage of the deprecated std::num::Zero trait. 2014-12-18 11:16:47 +00:00
Patrick Walton
7371e0b8e3 compositing: Implement cursor per CSS3-UI § 8.1.1 in the CEF/Mac port.
I'm not sure how we want to handle Linux cursors, and GLFW has no
ability to set cursors (short of disabling it and managing it yourself).
2014-12-17 22:58:52 -08:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Adenilson Cavalcanti
0e24194d81 Inset and outset border coloring is incorrect on left side border.
This patch will fix this issue.
2014-12-16 12:01:43 -08:00
Patrick Walton
3ba0abd8ff gfx: Implement box-shadow per CSS-BACKGROUNDS. 2014-12-15 13:39:06 -08:00
Patrick Walton
6943ddb93e layout: Implement overflow-wrap/word-wrap per CSS-TEXT § 6.2.
This property is used by approximately 55% of page loads.

To implement the line breaking behavior, the "breaking strategy" has
been cleaned up and abstracted. This should allow us to easily support
other similar properties in the future, such as `text-overflow` and
`word-break`.
2014-12-13 13:05:05 -08:00
Patrick Walton
106fdb1d32 layout: Implement word-spacing per CSS 2.1 § 16.4.
This assumes that there are no ligatures that span across multiple
words. Since we have a per-word shape cache, this is a safe assumption
as of now. I have left comments to ensure that, if and when this is
revisted, we make sure to handle it properly.
2014-12-12 17:55:11 -08:00
Adenilson Cavalcanti
00f1ae0a1d Restored older behavior for lighter color, should fix
the regression.
2014-12-12 13:51:25 -08:00
Adenilson Cavalcanti
fcc0229d5e Groove and Ridge rendering shows a solid border when color is black,
that is broken and the current patch will implement a similar behavior
as Firefox.
2014-12-12 13:50:40 -08:00
Patrick Walton
07bc97e3e2 gfx: Implement letter-spacing per CSS 2.1 § 16.4.
The ligature disabling code has been manually verified, but I was unable
to reftest it. (The only way I could think of would be to create an
Ahem-like font with a ligature table, but that would be an awful lot of
work.)

Near as I can tell, the method used to apply the spacing (manually
inserting extra advance post-shaping) matches Gecko.
2014-12-12 11:43:43 -08:00
Joseph Crail
c254d195ad Fix spelling mistakes in comments. 2014-12-11 23:56:29 -05:00
Patrick Walton
52b9951cad layout: Implement outline per CSS 2.1 § 18.4.
`invert` is not yet supported.

Objects that get layers will not yet display outlines properly. This is
because our overflow calculation doesn't take styles into account and
because layers are always anchored to the top left of the border box.
Since fixing this is work that is not related to outline *per se* I'm
leaving that to a followup and making a note in the code.
2014-12-11 14:25:10 -08:00
Martin Robinson
2e8f1c08fa Remove PseudoDisplayItemClass
Now that content box queries are made against the flow tree, we can
remove PseudoDisplayItems from the display list.
2014-12-10 11:39:17 +01:00
Patrick Walton
1d845ee4f2 gfx: Update Azure and Skia, and rewrite broken clipping logic.
This exposed some problems in our clipping logic, which was never
properly rewritten for the stacking context reform. The clipping code
worked in terms of a stack of clips, but the new stacking context code
has no concept of a stack of clip regions. Fixing that in turn exposed
some flaky/incorrect tests:

* `borders` had an incorrect reference image, as far as I can tell.

* `negative_margins` had some stray pixels, fixed by changing the text.
2014-12-08 13:45:51 -08:00
Tetsuharu OHZEKI
f04c64f500 Replace almost "render" to "paint" words in gfx crate. 2014-12-08 14:55:30 +09:00
Tetsuharu OHZEKI
4d562f893c Rename TaskState::RENDER -> TaskState::PAINT 2014-12-08 14:25:08 +09:00
Tetsuharu OHZEKI
a9839fa18e Rename RenderFontCacheEntry -> PaintFontCacheEntry. 2014-12-08 14:17:16 +09:00
Tetsuharu OHZEKI
b921986cd6 Rename RendererReadyMsg -> PainterReadyMsg 2014-12-08 14:13:07 +09:00
Tetsuharu OHZEKI
806b6f09c9 Rename RenderState -> PaintState 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
b5f73fb179 Rename RenderListener -> PaintListener, and its methods. 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
79722bdc03 Rename gfx::paint_task::Msg 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
7ff790d941 Rename RenderChan -> PaintChan 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
9b6faaf7f0 Rename RenderRequest -> PaintRequest 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
cee3d517e8 Rename RenderLayer -> PaintLayer 2014-12-08 14:05:49 +09:00
Tetsuharu OHZEKI
d87def0743 Rename RenderContext -> PaintContext 2014-12-08 14:01:07 +09:00
Tetsuharu OHZEKI
cddb7fe7c5 Rename RenderTask -> PaintTask. 2014-12-08 11:46:43 +09:00
Tetsuharu OHZEKI
daba904302 Rename gfx/render_task.rs -> gfx/paint_task.rs 2014-12-08 11:46:43 +09:00
bors-servo
736d542beb auto merge of #4187 : cgaebel/servo/issue-4127, r=SimonSapin
This will avoid drawing Arcs if there's no border-radius property set.

Fixes #4127
2014-12-03 17:48:56 -07:00
Patrick Walton
1c1c507c03 layout: Implement opacity per CSS-COLOR § 3.2.
This adds the infrastructure necessary to support stacking contexts that
are not containing blocks for absolutely-positioned elements. Our
infrastructure did not support that before. This minor revamp actually
ended up simplifying the logic around display list building and
stacking-relative position computation for absolutely-positioned flows,
which was nice.
2014-12-03 14:17:16 -08:00
Clark Gaebel
85856d0072 code review 2014-12-02 17:30:54 -08:00
Clark Gaebel
7d1e85f774 Fixed #4127: Added a fast path to border-radius.
This will avoid drawing Arcs if there's no border-radius property set.
2014-12-02 16:28:26 -08:00
Clark Gaebel
ffcf0bf394 [gfx/style] Implement border-radius.
This patch is a first stab at implementing border-radius. It looks fine as long as
the border isn't an ellipse (that might not even parse yet), and the border-widths
around a border-radius are the same.

Here's a cool screenshot!

![](https://www.dropbox.com/s/gdtmgjrlnf82gzz/Screenshot%202014-11-12%2018.03.29.png?dl=0)

r? @pcwalton @SimonSapin
2014-12-01 16:10:35 -08:00
bors-servo
a51d08737a auto merge of #4012 : glennw/servo/update-green-rs, r=mbrubeck 2014-11-16 20:21:28 -07:00
Glenn Watson
a1de810dd3 Add missing gfx dependency, that was causing a race in cargo on the build machine. 2014-11-17 12:13:58 +10:00