History log of /external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e93f34788b1f644f8be61a1daf6505c387e6fc3b 19-Mar-2010 Nicolas Roard <nicolas@android.com> Renders fixed layers with the root canvas matrix. Fix some positioning issues.

Bug:2526966 Bug:1818168

The current rendering code exposes some issues with the fact that we have
fixed layers in the layers hierarchy -- parents transformations are also applied
to the fixed layers, which is not what we want (fixed layers should be applied
on the original canvas, with the original transform -- e.g. toolbar present or not --
but no more).

One previously discussed solution was to move the fixed layers to their own hierarchy;
but doing so would mean to also redo all the z-index management that we already have
in the current system. The simplest way is therefore to use the original matrix (the
canvas' matrix) when we have a fixed layer. The way we do this is by inserting a new
LayerAndroid before the LayerAndroid root, setting the matrix of that new root to be
the canvas' matrix. The drawing is then unaffected, but we can ask skia to draw using
the root's matrix.

The second issue solved in the CL is some positioning troubles; layers may have
different dimensions than their render view, and the previous code was considering that
the views were always drawn at the origin in the layer. By removing the parents layers
transforms, this is not the case anymore, and we therefore need to take the render view
offset into account. Finally there is some additional debug code in LayerAndroid.

Change-Id: Id353ad3dfd9808252643f0e4f0140dde67480719
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
7837e47a7dd5a9e6c0767f9241ad41b4974d6928 18-Mar-2010 Nicolas Roard <nicolas@android.com> Implement margin for fixed elements.
Last missing piece to fix Bug:2252505

Billmonk.com uses a centered fixed element with negative margins,
and we were not accounting for those...
Accounting for the margins move the fixed layer at the same place
than webkit think it is, and therefore clicks do work.

Change-Id: I6a736d06273df7d2bbc597c17ce042aa8b75b4e2
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
09cdf3e990745cfbcada2d0a49ef371029fc6a97 16-Mar-2010 Nicolas Roard <nicolas@android.com> Refactor how we set up the layers hierarchy when using fixed
composited layers, and fix the z-index position.

Bug:2497910 Bug:2450006

We add a new COMPOSITED_FIXED_ELEMENTS define to isolate the
changes in the webkit common code.

We previously had a problem where the hierarchy of GraphicsLayer
(i.e. the backed surfaces associated to the composited RenderLayer)
was not reflecting that layers were children of a fixed layer.
The workaround we currently have is not fully satisfactory, due to the way
we draw layers on screen (in some cases layers were wrongly translated,
see Bug:2497910).

Instead, modifying the webkit common code simplify things a lot, and makes
the patch more likely to be upstreamed to webkit, as it's now a
reasonably well-delimited feature (use composited layers for fixed elements).

What we do now is to consider fixed elements as a stacking context, which
makes all layers children of such elements children too in the
GraphicsLayer hierarchy, and modifying the offset of those children
accordingly (in RenderLayer.cpp).

In addition, we fixes the z-index bugs we had
by signaling that there is a fixed element to its siblings, and turning
the siblings as composited layers as well (so that the ordering works
fully UI-side).

Change-Id: I735c6c14d955ef54653f0053187d3495bef1f332
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
fa26a8dd531dff44d6cad0700ff32c0bb949392c 05-Mar-2010 Nicolas Roard <nicolas@android.com> Fix bug 'Children of fixed elements do not always remain fixed themselves'
The problem was twofold:
- webkit didn't create composited layers of the children div unless they were
intersecting with the fixed layer
- the children divs layers are siblings, not children of the fixed layer

The solution is to:
1/ mark layers as needed to be composited if their ancestor is a
fixed element (in RenderLayerCompositor)
2/ as the GraphicsLayer/LayerAndroid hierarchy is based on the RenderLayer
hierarchy (z-order..) and not the display hierarchy, we need to a way of
updating the position of the contained layers when a fixed layer move.

We do that by:
- marking layers contained in a fixed layer as being linked to the
fixed layer (GraphicsLayerAndroid::syncFixedDescendants), and set the
offset between the layer and the fixed layer.
- when pushing the layers tree to the UI side, we ensure that such layers
are linked to their corresponding fixed layer
(LayerAndroid::ensureFixedLayersForDescendants)
- when we draw, we do a first pass to update the fixed layers position
(LayerAndroid::updateFixedLayersPositions) then update the rest of the
layers (LayerAndroid::updatePositions). The layers that are linked
to the fixed layers will then update their position relative to it,
using the original offset between the fixed layer and the layer.

Bug:2470701
Change-Id: I512966df94de6a5f84aff335c5d09b3f027bc2c3
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
5065a677456ac1cb630e5271e781b2aa796af7a5 05-Mar-2010 Cary Clark <cary@android.com> scroll into view considers layers

LayerAndroid.*
- Add a utility that takes the given rectangle and subtracts
layers that overlay it.

FindCanvas.*
- Add function that returns if the current match is on the
main page or in a layer.

WebView.cpp
- Add jni caller for WebView.java calcOurContentVisibleRect.
Call it instead of getVisibleRect, which has the side effect
of sending messages back to webkit.
- Remove jni caller for getViewMetrics, since it is redundant.
- Only call scrollRectOnScreen for non-layers.

companion fix in framework/base

http://b/2485168
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
f0a67203aa6334a59340ef7a56d9f77c718b67d6 05-Mar-2010 Cary Clark <cary@android.com> forgot header file ; broke build in 43447
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
2e0b2223f6f6223fc09ce81529c611f2c032e38f 01-Mar-2010 Cary Clark <cary@android.com> allow anchor containing layer to be mapped to navable layer

A layer may be inside or outside of an anchor. If it is inside,
the corresponding CachedNode has already been created, but is
being tracked. These tracked nodes need their layer and unclipped
bits set. For now, node in layers are assumed to draw last in
their layer, and aren't obscured by other drawing.

We may allow nodes in layers to be obscured one day. Preparing
for that, translate the layer picture by its global position
when testing to see if the node is hidden.

Fix debugging by allowing CachedLayer to see inside LayerAndroid.

http://b/2453974
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
d9975bf008036e4a597df404b62d0722645ba75c 25-Feb-2010 Mike Reed <reed@google.com> make methods private (or static local) if possible to reduce surface area of API
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
24f7fb9130250d850bf040efd1021c97e179a299 25-Feb-2010 Mike Reed <reed@google.com> remove unused methods
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
770495626b08b5d06162c31be5eed944aea127cb 25-Feb-2010 Nicolas Roard <nicolas@android.com> Fix the gap when using the IME (Bug:2453748)

The problem was that layers may have a different size than their corresponding element,
but we used the layer's size instead of the element's to compute the fixed position.
The fix asks for the element visible overflow size (needed, some children may be outside the bounds of the element itself).
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
87962ce00229855c098ba12cee8d5c015a835289 23-Feb-2010 Cary Clark <cary@android.com> refactor drawing to support layers

Drawing elements that appear atop or below layers need to be
drawn both in the proper order and with the correct canvas to
respect clipping and the matrix.

Drawing the find results, text selection, or the cursor ring,
interleaves with any layers that may be drawn. The main picture
is treated as owned by a LayerAndroid so each component can
decide when to draw.

This change leave the main picture in WebViewCore.cpp, and
draws everything else in WebView.cpp -- in the future, additional
refactoring can put all drawing in one place.

The logic of what to draw is still in WebView.java, but the
actual drawing calls are now triggered inside the layer code.

Android.mk
- Add rule to trigger building without layers from buildspec.mk.

LayerAndroid.*
- Replace FindOnPage reference with abstract DrawExtra class to
draw adornments in the layers' canvas context.
- Add a LayerAndroid constructor to create a dummy layer with a
SkPicture* and a uniqueId==-1 so that extras can detect when
they are drawn by the main picture.

android_graphics.*
- Move cursor ring drawing out of WebView.cpp to here.
- Separate cursor ring setup from actual drawing.
- Get the cursor ring metrics in local coordinates.

ChromeClientAndroid.cpp
- Fix compiler warnings.

WebViewCore.*
- Move updateCursorBounds from WebView.cpp. This permits it to
be called from CursorRing::setup.

CachedFrame.*
CachedNode.*
CachedLayer.*
- Add local bounds getters.

CachedRoot.h
- Move class FindCanvas to the android namespace.

DrawExtra.h
- Add an abstract class called by LayerAndroid to optionally
draw extra elements in its canvas context.

FindCanvas.*
SelectText.*
- Refactor drawing to draw in layers context.

WebView.cpp
- Move drawing from WebView.java.
- Remove selection code to SelectText.cpp.
- Use inverseScale to simplify viewPort metrics.
- Simplify layer root so java doesn't need to know about it.

Requires companion change in frameworks/base

http://b/2457316
http://b/2454127
http://b/2454149
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
cdd7f6d80774ba3a374f09f22f7cb6bcfca24fa5 19-Feb-2010 Mike Reed <reed@google.com> move viewport into just this subclass
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
72d7d713095c595ffb3f75ae6cb9df1a0c774d20 18-Feb-2010 Mike Reed <reed@google.com> refactor
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
41ca040d7db923a179953baf91f30d539df6b055 17-Feb-2010 Cary Clark <cary@android.com> minor fixes to layer nav

- get rid of the FloatPoint interface in LayerAndroid;
use (x, y) instead
- make CachedFrame a friend of CachedRoot and CacheBuilder
a friend of CachedNode so they alone can access private fields.
- assume the LayerAndroid picture can sometimes be null.
If it is, use the main page's picture instead.

http://b/2369549
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
f4cefb9302ee62602c19cdfbdb6cc1fbdf540953 27-Jan-2010 Cary Clark <cary@android.com> Add UI considerations to layers

companion fix is in framework/base

With fixed layers, parts of the web page are now
in motion relative to the document when the page
scrolls. Many routines that formerly read static
coordinates need to compute locations. In some cases,
new computations are cached for speed -- for instance,
the current cursor position is cached when it is
frequently compared.

The cursor rings and other drawing elements like
finding text on the page now to be drawn in the correct
order so that they appear both under and over layers.

There's quite a bit more work to be done. Major
pieces are drawing the text selection in the correct
order, and computing locations based on nest layers.
With this checkin, only the position of the child-
most layer is considered when computing bounds.

http://b/2369549

JavaScriptCore/wtf/Platform.h
- Turn compositing on. All routines that
reference LayerAndroid are bracketed by this
condition.

WebCore/platform/graphics/android/LayerAndroid.h
WebCore/platform/graphics/android/LayerAndroid.cpp
- Add a unique id to each layer. The unique id is
used to associate a layer created when the DOM is
parsed in the webkit thread with its copy in the
UI thread.
- Add: draw the text found on the page, as a call
out in the primary draw. The call out must follow
the drawing the layers' contents to show the found
text correctly. Note that this adds a new slot with
identical contents in every child LayerAndroid. In
a future optimization, a RootLayerAndroid could hold
data common for all child layers.
- Add: clipArea(), which returns an array of rectangles
describing the clip for this LayerAndroid and its
children. Generally, this is the part of the webpage
which is covered by one or more fixed layers.
- Add: find(FloatPoint) that returns the deepest layer
that contains this point. This is used to match taps
to the layer that is tapped on.
- Add: draw all layer pictures and identify
which layer is being drawn. This is used to analyze
the picture contents for finding and selecting text.
- Add: find the layer that matches a given id; this is
used to map cached DOM node data back to the layer
that contains it.
- Fix up includes, delete unused interfaces

WebKit/android/jni/WebViewCore.h
WebKit/android/jni/WebViewCore.cpp
- Remove local mRootLayer; use the one in WebView.cpp
instead (which is in sync with WebView.java)

WebKit/Android.mk
WebKit/android/nav/CachedLayer.h
WebKit/android/nav/CachedLayer.cpp
- CacheLayer associates the cached node with the
LayerAndroid instance. It contains the index to the
node in the cached frame, the LayerAndroid's unique id,
and the spacial offset of the node within the layer
when the DOM information was captured. It also caches
a pointer to the LayerAndroid instance.
CacheLayer computes the node's location each time
it is called, since the fixed layer may be constantly
moving relative to the document's coordinates.

WebKit/android/nav/CacheBuilder.h
WebKit/android/nav/CacheBuilder.cpp
- Track the active layer while building the nav cache.
The 'Tracker' structs were refactored to share common
code, and a new 'LayerTracker' struct identifies when
the node walker is inside a layer.
- Added code to dump layer information for debugging.
- Note that CachedNode::cursorRingsPtr can only be called
during nav data construction
- The cache builder can limit or exclude nodes that
are clipped out -- but until I have more understanding
of layer clipping, treat contained nodes as unclipped.

WebKit/android/nav/CachedDebug.h
- Add a variant that can dump either to a log file
or the console including the function it was dumped from.

WebKit/android/nav/CachedFrame.h
WebKit/android/nav/CachedFrame.cpp
- Add an array of CacheLayer instances.
- Protect bounds from direct access since they must
always be computed.
- Remove misnamed focus parameter from many routines
since the cursor node can be read from the root frame.
- Add: adjustBounds(), which computes the bounds as the
layer moves.
- Add: checkRings(), which gets the appropriate picture
for the node.
- Remove disabled code
- Find the layer list for the matching node by
using a binary search
- Add: resetLayers() to reset the LayerAndroid pointer
in CachedLayers when the layer world changes.

WebKit/android/nav/CachedHistory.h
WebKit/android/nav/CachedHistory.cpp
- Update history data to have matching frame and node

WebKit/android/nav/CachedNode.h
WebKit/android/nav/CachedNode.cpp
- Refactor functions that directly read coordinates
to compute them. In some cases, pass the frame in so
that the layer coordinates can be found.
- Add a bit to note that the node belongs to a layer.
- Remove duplicate bounds interfaces.
- Add methods to get cursor ring data at runtime.
- Update debugging info.

WebKit/android/nav/CachedRoot.h
WebKit/android/nav/CachedRoot.cpp
- Isolate direct picture access so that the layer
picture can be returned.
- Add knowledge of how the base is covered by layers.
- Add a pointer to the root LayerAndroid.
- delete disabled code.
- Move the cursor ring into view if it is obscured
by a layer (this isn't totally working)
- Before finding the next node to move to, set
up 'cursor cache' data, including the visible picture.

WebKit/android/nav/FindCanvas.h
WebKit/android/nav/FindCanvas.cpp
- Move find code here so that it can be called from
layers.

WebKit/android/nav/WebView.cpp
- Add java interface to get viewport metrics on demand.
- Pass frame with the node.
- Remove the find on page code (now in FindCanvas).
- Compute focus rings instead of reading them directly.
- Transfer layer id when getting new nav cache.
- Set up root LayerAndroid.
- Add utility to track if cursor is in a layer.
- Simplify drawLayers() to use common view metrics.
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
43ea3379b4eaa2af641c3fa0c2096fa10d9e6147 15-Feb-2010 Mike Reed <reed@google.com> checkpoint for refactoring
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
859c5759717164a923c2267b9ee8437a4dafe5c4 12-Feb-2010 Nicolas Roard <nicolas@android.com> Add dump layers capability (triggered the same way as the dump tree trick,
saving the layres tree in /sdcard/layersTree.plist)
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
be24d84c76bb32c72d597fce1c9de599ced95565 12-Feb-2010 Mike Reed <reed@google.com> move children into SkLayer
make SkLayer inherit from SkRefCnt.h
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
410564b38963bd28cc3ef1fa1a0df89200963003 12-Feb-2010 Nicolas Roard <nicolas@android.com> Refactor the layers to use calcPosition().
Add accessors to the picture and the children.
Add a bounds() method.
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
fe41360961a5f02a9f54dbe4922d301ef4bc4a20 11-Feb-2010 Nicolas Roard <nicolas@android.com> Put back the animations in the UI thread
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
ba1ed26a6f245f68ba76318d7ec9451fb0886922 11-Feb-2010 Nicolas Roard <nicolas@android.com> Layers refactoring
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
7cf8f5417b00f178c31fe6bba844ba4bb1957019 10-Feb-2010 Nicolas Roard <nicolas@android.com> cleanup
(cherry picked from commit fc34a9dc6e4aa1d0e96fc5523ee77e618648e615)
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
30e39dd1918530408d55dbead3bf1567661b606e 25-Jan-2010 Nicolas Roard <nicolas@android.com> Fix memory leak with layers.
This fix bug http://b/2394813
This is a two-parts CL (need a java modif)

- The main leak is in WebView.cpp -- nativeUpdateLayers could
bail out if the root layer was nil, without deallocating the vector
of updates.
- fix a leak in LayerAndroid::evaluateAnimations()
- adoptRef() for the contentLayer in GraphicsLayerAndroid
- simplify AndroidAnimation: remove the reference to the layer
(the layer already has a reference to AndroidAnimation)
- modify the AndroidAnimation copy() methods to return directly
a PassRefPtr, for consistency.
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
388e461f3d6bf782b3cfb4bb21bc6264cef9323c 07-Jan-2010 Nicolas Roard <nicolas@android.com> Add proper support for fixed position elements

this is two-part change, see http://android-git.corp.google.com/g/#change,37092 for the java counterpart.
This CL implements fixed position elements (css position: fixed) using layers, supporting pixels and percent lengths.

It addresses http://b/1914365
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h
9acd586e4a0aa54e4f630665aa0d3c8c95b78e72 04-Jan-2010 Nicolas Roard <nicolas@android.com> webkit layers support
/external/webkit/WebCore/platform/graphics/android/LayerAndroid.h