65 Commits

Author SHA1 Message Date
Ojan Vafai
f01bea301b Move transforms from RenderLayer to RenderBox.
This is more member data on RenderLayer that is now only
used by RenderBox.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/965013003
2015-02-27 17:18:07 -08:00
Ojan Vafai
ef1b30faf7 Move FilterEffectRenderer out of RenderLayer into RenderBox.
It doesn't do anything RenderLayer specific anymore. This
does mean adding another pointer to RenderBox. We might want
to do something about that eventually, but for now it seems fine
to make forward progress in terms of getting rid of the RenderLayer
tree.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/963253002
2015-02-27 13:42:29 -08:00
Ojan Vafai
4b60c28783 Simplify RenderLayer's handling of filters.
-Remove RenderLayerFilterInfo. It was just a static map for
FilterEffectRenderers. Instead, put the FilterEffectRenderer
directly on RenderLayer.
-Make FilterEffectRenderer not be RefCounted. This involved
deleting a ton of dead code around ReferenceFilters since they
were the other subclass of Filter. As best I can tell,
reference filters are already don't parse in Sky, so this should
just be removing dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/962543003
2015-02-26 15:38:14 -08:00
Ojan Vafai
f36e7b49db Assorted cleanup of RenderLayer.
-Move perspectiveOrigin to RenderBox. It's only used in
one place and called on a RenderBox.
-Inline some methods that were just calling out to the renderer.
-Inline updateStackingNode() into the constructor and remove
the branch since requiresStackingNode is always true.
-Delete a bunch of dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961053002
2015-02-26 13:07:20 -08:00
Ojan Vafai
ba092f1cd5 Remove dead code from RenderLayer and inline filter methods.
Inline a couple methods that are only called from one place
and remove a bunch of dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961553003
2015-02-26 11:04:53 -08:00
Ojan Vafai
cec128f499 Remove some dead RenderLayer code.
-m_hasSelfPaintingLayerDescendant is never read.
-remove showLayerTree. The layer tree is going away. We won't need this.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/952343003
2015-02-25 15:48:59 -08:00
Ojan Vafai
78691e3c21 Inline RenderLayer::beginTransparencyLayers into RenderBox::paintLayerContents.
This is the only remaining caller.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/954913002
2015-02-24 20:59:01 -08:00
Ojan Vafai
82ab56a89b Remove some dead filters related code.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/943333005
2015-02-24 20:45:53 -08:00
Ojan Vafai
0be786f62c Simplify and reduce calls to beginTransparencyLayers.
-Consolidate the beginTransparencyLayers calls. The call
on layer()->parent() was just not needed as best I can tell
and the filter one could just be shared with the non-filter
codepath. FWIW, blink has already made a similar set of changes.
-Don't walk up the tree calling beginTransparencyLayer.
We're doing this in a recursive call down, so we've already
created the transparency layer for any transparent ancestors.
-Remove unused TransparencyClipBoxMode argument.
-Inline the paintingExtent method.
-Removed unused REVEAL_TRANSPARENCY_LAYERS #define.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/959543002
2015-02-24 17:29:00 -08:00
Ojan Vafai
c885cea0f7 Cleanup transform-related methods in RenderLayer.
-Get rid of paintsWithTransform.
-Remove currentTransform. It was only ever called with
IncludeTransformOrigin and on non-null transforms.
-Remove renderableTransform. It was only called on
non-null transforms.
-Remove a layer()->parent() branch. The ASSERT had been
added in a previous patch, but the branch wasn't removed.
-Inline makeMatrixRenderable. It was only called in one
place.
-Add a test to make sure that transform origin is corrrectly
excluded from the transform computedStyle.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/958463002
2015-02-24 14:31:48 -08:00
Ojan Vafai
920920310e Delete RenderLayerModelObject.
Merge most of it into RenderBox. Only RenderBoxes can have
layers now. This also meant a bit of code could be cleaned up
since some virtuals (e.g. updateFromStyle) are no longer needed
since they're only called on RenderBoxes.

collectSelfPaintingLayers is the only bit that's moved into
RenderBoxModelObject instead of RenderBox. That's because we
need to be able to recurse down into RenderInlines since they
may contain RenderBoxes that have selfPaintingLayers.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/953673002
2015-02-23 17:24:38 -08:00
Ojan Vafai
a267c39c01 Remove the concept of staticly positioned absolutes.
On the web, if you set position:absolute, but not
top/right/bottom/left, then the absolute goes where it
would have gone if it wasn't positioned. The use-cases for
this are slim and it introduces a lot of complexity to the
engine.

Also changes behavior in the presence of direction:rtl.
On the web, direction:rtl and top/left:auto would
sometimes set right:0. Instead we always position at
0,0 if the opposing values are auto.

This removes the code for this positioning and allows
simplifying a bunch of dirty bit handling code since
we don't need to setNeedsLayout if lines move around
or wrap differently.

The test cases did change their output, but the new
positioning all looks correct to me.

Review URL: https://codereview.chromium.org/944073006
2015-02-20 20:26:59 -08:00
Ojan Vafai
a42e249b69 Remove dead position:relative code.
There are some cases in this patch where it's not
obvious that the code only applies to position:relative,
but the code asserts that it does. In those cases,
I trusted the asserts and deleted the code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/938193004
2015-02-20 11:37:17 -08:00
Ojan Vafai
74290d5007 Move hit testing out of RenderLayer into RenderBox.
Change hit testing to walk over the render tree instead of
the RenderLayer tree. This is a step in the direction of
removing the RenderLayer tree entirely.

For now, there's a few calls back into RenderLayer that
will be removed in a followup patch. This patch also
breaks hit testing on transformed inlines. I'll be
removing the ability to transform inlines in a
followup patch anyways, so it's ok for hit testing
to give the wrong result temporarily here.

Almost all of this patch is just moving code from
RenderLayer to RenderBox. The primary substantive change
is in RenderBox::hitTestLayer. Instead of having
hitTestChildren calls, we call collectSelfPaintingLayers,
reverse sort by z-index (so we start at the top),
and then iterate over the result.

The test-case also exposes that we don't correctly hit
transformed elements inside inline-blocks. I went back as
far as 4153b8a515d54275934d4244aaf2d5a7a8fe3333 and the
bug still happened.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945693002
2015-02-19 21:31:42 -08:00
Ojan Vafai
3edb147679 Change the return value of RenderLayer::hitTestLayer.
All the code only cares about whether we hit, not
which layer we hit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/939793003
2015-02-18 19:52:16 -08:00
Ojan Vafai
bd8d560b7a Merge RenderLayer::hitTest into RenderView::hitTest.
Only RenderView calls this method. The actual tree walk
happens in RenderLayer::hitTestLayer, which a followup
patch will move into RenderBox.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/939483005
2015-02-18 19:29:30 -08:00
Ojan Vafai
6b07257fb6 Merge hitTestLayerByApplyingTransform into hitTestLayer.
This makes hitTestLayer a bit larger at the benefit of making
the code a bit easier to follow and getting rid of the confusing
recursive call to hitTestLayer and the appliedTransform bool.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/937023002
2015-02-18 18:40:20 -08:00
Ojan Vafai
04f9707e4f Remove HitTestFilter.
Background and foreground on a layer can't be hit indepdently
anymore, so merge them into a single hitTestContents call.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/924273002
2015-02-13 21:07:54 -08:00
Ojan Vafai
1d3f70fc06 Remove unnecessary operator overload on RenderLayer::hitTest.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/925903005
2015-02-13 14:12:38 -08:00
Ojan Vafai
6ee8440f27 Walk render tree instead of render layers for paint.
This is the first step of getting rid of RenderLayer.
Instead of walking the RenderLayer tree, wall the RenderObject
tree and add any layers encountered to a vector to paint later.

This patch just consolidates and move the code from RenderLayer
to RenderBox and then changes the children painting to
iterate over the vector. Therefore we walk the RenderObject tree.
We still call out to RenderLayer in a bunch of places.
A followup patch will get rid of those.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/899753003
2015-02-06 11:38:25 +11:00
Ojan Vafai
b139ec4316 Delete remaining masks dead code.
Removes the straggling code related to masks now that
we've removed the CSS properties.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/893093002
2015-02-03 13:56:34 +11:00
Ojan Vafai
bd590c7b05 Remove mask painting.
Now that we don't have -webkit-mask-*, this is dead code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886263003
2015-02-01 20:37:32 -08:00
Ojan Vafai
194360db4f Inline two methods with only one caller.
TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/886923003
2015-01-29 21:02:16 -08:00
Ojan Vafai
bdc24bf049 Remove painting roots.
These appear to have been for ensuring that you
only paint elements in a given subtree. It's not clear
to me exactly how you get to painting an element that
is not rooted at the RenderLayer you started with.
I think it's just not possible in Sky anymore.
This code was added in 2004 for drag images, which
we no longer support.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/882223005
2015-01-28 19:53:44 -08:00
Ojan Vafai
b4c4004f56 Merge outline paint phases into the foreground phase.
Mostly just mechanical changes. The one surprising bit
is that RenderLayer no longer needs to explictly paint
outlines. I tested manually that before this patch,
the paintOutline call in RenderLayer was needed for
outlines on positioned elements and that after this
patch it's not.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/878023002
2015-01-27 17:45:04 -08:00
Adam Barth
f4618c1bb2 Remove RenderLayer::m_lostGroupedMapping
No one touches this state.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881123002
2015-01-27 15:21:24 -08:00
Adam Barth
54809a8877 Remove more scrolling code from Sky
None of this code does anything anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878303002
2015-01-27 15:20:14 -08:00
Adam Barth
645a6a9d12 Remove dead code related to compositing from Sky
R=esprehn@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/865153004
2015-01-27 14:38:56 -08:00
Adam Barth
c33c565f8b Remove ScrollableArea and Scrollbar
This code is unused.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/879993004
2015-01-27 12:08:24 -08:00
Adam Barth
4e74d9df30 Remove RenderLayerScrollableArea
This CL is a first step towards removing the scrolling machinery from the
engine. Notice that we pay a tax for scrolling in RenderBlockFlow::layout.

R=esprehn@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/877043002
2015-01-27 09:58:45 -08:00
Ojan Vafai
81341480bf Merge the background paint phase into the foreground phase.
First step in getting rid of paint phases. Verified that
deleting this phase entirely would cause flights-app-pixel.sky
to fail and that it still passes in this patch, which just does
the background painting as part of the foreground phase.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/867463005
2015-01-26 15:52:47 -08:00
Ojan Vafai
4256d4a224 Remove background obscuration checks.
This is an optimization to avoid painting backgrounds
that are obscured. It's a lot of complexity that it's
not clear we'll need given that we're using a GL backend.
Also, we can add it back in more easily/efficiently in the future
once we have a display list architecture.

This also means we can remove the needsPaintInvalidation
dirty bit and some opacity information on filters.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/856563006
2015-01-15 17:11:44 -08:00
Ojan Vafai
8e3f746bad Remove assorted dead paint invalidation code.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/850763008
2015-01-14 13:46:39 -08:00
Ojan Vafai
3e26389e5d Delete PaintInvalidationState. It's unused.
Delete selection paint invalidation code.

There is a slight change in behavior in FrameSelection::revealSelection.
If you have a non-collapsed selection, then we'll center the start
of the selection instead of the whole selection in some cases. There's
a ton of callers of this code, so it's hard to be sure if any of this
actually changes behavior for sky. In manual testing, I couldn't find
any scenarios where there was a difference. Almost universally,
when we call revealSelection, we have a CaretSelection. The only
case I could think of where we have a RangeSelection is when
modifying an off-screen selection (e.g. shift+right), but in that case
we pass the RevealExtent option, so this patch doesn't change behavior
there.

Removing that caller makes all the rest of this rect computing
code into dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/823123003
2015-01-14 13:25:49 -08:00
Ojan Vafai
5f718d3e63 Delete selection paint invalidation code.
There is a slight change in behavior in FrameSelection::revealSelection.
If you have a non-collapsed selection, then we'll center the start
of the selection instead of the whole selection in some cases. There's
a ton of callers of this code, so it's hard to be sure if any of this
actually changes behavior for sky. In manual testing, I couldn't find
any scenarios where there was a difference. Almost universally,
when we call revealSelection, we have a CaretSelection. The only
case I could think of where we have a RangeSelection is when
modifying an off-screen selection (e.g. shift+right), but in that case
we pass the RevealExtent option, so this patch doesn't change behavior
there.

Removing that caller makes all the rest of this rect computing
code into dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/847303003
2015-01-14 13:25:16 -08:00
Ojan Vafai
544a24a448 Delete RenderSelectionInfo and other selection rect paint invalidation code.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/851593002
2015-01-12 17:08:36 -08:00
Ojan Vafai
a198a95ea6 Delete invalidateTreeIfNeeded.
This is just setting and clearing paint invalidation dirty bits.
Also remove a bunch of the paint invalidation dirty bits entirely.
There's plenty more to do.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/791023006
2015-01-12 13:29:12 -08:00
Ojan Vafai
cfbabf0397 Delete a bunch of paint invalidation rect computing code.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/845873004
2015-01-09 19:05:59 -08:00
Ojan Vafai
a794eb951d Delete an assortment of unneeded paint invalidation code.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/845093002
2015-01-09 18:31:26 -08:00
Ojan Vafai
7d4c460653 Delete RenderLayerRepainter.
It's dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/795843008
2015-01-09 17:44:40 -08:00
Rafael Weinstein
be846a56b7 Remove CompositingReasons.*
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/794733004
2014-12-09 17:19:00 -08:00
Eric Seidel
d4de7b0d3e Reverted the wrong one.
Revert "Revert "Get rid of LayerFragment.""

This reverts commit e68e8688f1105ca9fe7c49bac73246297ee76fb0.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/793123002
2014-12-10 15:01:32 -08:00
Eric Seidel
f353cd6cac Revert of Remove RenderLayer::collectFragments. (patchset #1 id:1 of https://codereview.chromium.org/778043005/)
Reason for revert:
This broke hit testing.  Hit testing always returns the root node now. :)

Original issue's description:
> Remove RenderLayer::collectFragments.
>
> Sky always has exactly one per RenderLayer. This patch
> gets rid of the hitTestLayer use of LayerFragment
> and gets paintLayerContents to create the list of
> fragments itself since it's the only caller.
>
> Also, delete dead code from LayerFragment.h.
>
> R=abarth@chromium.org
>
> Committed: 4a3b676dc3

TBR=esprehn@chromium.org,rafaelw@chromium.org,abarth@chromium.org,ojan@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/788383002
2014-12-10 14:58:48 -08:00
Ojan Vafai
1492a0d635 Remove the straggling DisableCompositingQueryAsserts.
We don't have compositing query asserts anymore,
so there's nothing to disable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/787293002
2014-12-09 20:25:18 -08:00
Ojan Vafai
b00d41f26c Get rid of LayerFragment.
We don't have fragmentation. So no need for this abstraction.
This simplifies a lot of code so that we can do less work.
For example, we can check shouldPaintContent only up in
paintLayerContents instead of in each nested function.

Instead of passing the LayerFragment, pass the layer location
and the clip rect for each nested function.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/789643002
2014-12-08 17:37:43 -08:00
Ojan Vafai
0069ab6369 Remove RenderLayer::collectFragments.
Sky always has exactly one per RenderLayer. This patch
gets rid of the hitTestLayer use of LayerFragment
and gets paintLayerContents to create the list of
fragments itself since it's the only caller.

Also, delete dead code from LayerFragment.h.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/778043005
2014-12-08 16:37:50 -08:00
Ojan Vafai
31343b63fe Get rid of the PaintLayerFlags bitmask.
Make it a regular enum and remove it from all the functions
it's not actually used. Also, make paintLayer and PaintLayerFlags
private since they're only used in RenderLayer.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/779183004
2014-12-08 09:21:12 -08:00
Ojan Vafai
87b58eda51 Remove PaintBehavior. It's unused.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/768973004
2014-12-08 08:57:37 -08:00
Ojan Vafai
405dedb984 Remove all but one of the PaintLayerFlags.
Only PaintLayerPaintingOverlayScrollbars is actually ever set
to a different value in different codepaths.

-PaintLayerHaveTransparency can just be replaced with
isTransparent() calls.
-PaintLayerPaintingCompositingScrollingPhase is unused.
-PaintLayerPaintingCompositingAllPhases is always set,
which means that the other three compositing ones are
also always set.

The third bullet more clearly falls out when you see that
the only caller of paintLayerContents is
paintLayerContentsAndReflection, which sets
PaintLayerPaintingCompositingAllPhases on the paint flags.
Get rid of paintLayerContentsAndReflection since we no
longer have reflections.

The rest of the changes are all just propagating the now
always false or true booleans in paintLayerContents.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/778883002
2014-12-04 12:12:05 -08:00
Ojan Vafai
6e6e9181de Remove PaintLayerPaintingOverflowContents.
It was added for compositing overflow:scroll, which we don't do.
This also means that only the RespectOverflowClip enum value is
used. And PaintingClipRectsIgnoringOverflowClip is unused.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/778753002
2014-12-03 19:09:56 -08:00