summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_common_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Hit test on the layer tree rather than the RSLLvollick@chromium.org2014-05-121-2147/+1
| | | | | | | | | R=danakj@chromium.org,enne@chromium.org BUG=369757,368935 Review URL: https://codereview.chromium.org/266913021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269835 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add a flag to layers that returns true if the layer is in RSLL.vmpstr@chromium.org2014-05-091-2/+307
| | | | | | | | | | | | This patch adds a flag that says whether the layer is currently in RSLL. Used to remove layers that previously were in RSLL and are no longer there. R=enne, danakj Review URL: https://codereview.chromium.org/265883013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269353 0039d316-1c4b-4281-b951-d872f2087c98
* Properly reset dirty bits before early-out in PreCalculateMetaInformation.hartmanng@chromium.org2014-05-031-0/+28
| | | | | | | | | | | | | | | | | We can early-out in this function if we have a non-invertible, non-animated transform. This causes us to not reset some dirty bits (in particular, |sorted_for_recursion|). Later, when sorting a layer's child list (_before_ we decide to early-out of CalculateDrawProperties), we skip out on sorting the layer due to the dirty state. This causes badness. We should reset the state and sort the list properly, including the layers that will be skipped later. R=vollick@chromium.org,ajuma@chromium.org,danakj@chromium.org BUG=366233 Review URL: https://codereview.chromium.org/267713011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268026 0039d316-1c4b-4281-b951-d872f2087c98
* Enable disabling WebCore::GraphicsContext in telemetry.schenney@chromium.org2014-05-021-3/+5
| | | | | | | | | | | | | | Plumb a flag through from telemetry tests to the layer painting code that disables the WebCore::GraphicsContext. This allows us to isolate the various systems that paint web content in Chromium. R=nduca@chromium.org,skyostil@chromium.org BUG=350684 Review URL: https://codereview.chromium.org/253013003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267913 0039d316-1c4b-4281-b951-d872f2087c98
* Don't early out in PreCalculateMetaInformationvollick@chromium.org2014-05-011-0/+47
| | | | | | | | | | | | | | | | | Currently, we bail early in this function if we encounter a layer with a singular transform. This causes problems because we depend on a full tree walk in order to clear DrawProperties::sorted_for_recursion. This cl prevents this early out. (Note: this does not affect other optimizations to prevent the drawing of subtrees rooted at layers with singular transforms.) R=ajuma@chromium.org,danakj@chromium.org BUG=366233 Review URL: https://codereview.chromium.org/263643007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267438 0039d316-1c4b-4281-b951-d872f2087c98
* Don't clear render surfaces unnecessarily.vollick@chromium.org2014-04-281-4/+0
| | | | | | | | | | | | | | | | | | | As an optimization, we used to clear render surfaces when they were elided from the RenderSurfaceLayerList. It turns out that these surfaces are still important from time to time; a scroll child will need to access the transforms of these surfaces in order to put its clip in the right space. This CL retains the layer lists and it also updates RenderSurface to own a LayerList rather than a RenderSurfaceLayerList (which was always a bit of a kludge). R=danakj@chromium.org BUG=366386 Review URL: https://codereview.chromium.org/250803013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266519 0039d316-1c4b-4281-b951-d872f2087c98
* Relax touch hit testing in CC to look at all layers under a pointrbyers@chromium.org2014-04-271-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | CC touch hit testing now (as of http://crrev.com/264395 does a ray cast through all layers under the touched point. We included an optimization to stop searching once you reach a layer we know is opaque to hit testing. This breaks the common case of sites with a touch handler on the document because blink has an optimization to effectively disable touch hit testing in that scenario (since there's no benefit to be had to expensive rect computation) by marking just the entire root layer with a handler region. This change removes this opaque-to-hit-testing optimization. There's some risk that we'll block on main more often, but it should be rare (you'd need a scrolling layer without a handler over top of a layer with a handler). This also fixes the case where a layer has a region that is supposed to be transparent to hit-testing with the CSS pointer-events: none property. BUG=366034, 269598 Review URL: https://codereview.chromium.org/250663003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266402 0039d316-1c4b-4281-b951-d872f2087c98
* Do main thread hit testing if impl hit testing is affected by occluders.vollick@chromium.org2014-04-171-0/+23
| | | | | | | | | | | | | | | | In order to safeguard against transparent occluders, in this CL, I've raycasted until I hit a layer that's "opaque for hit testing" and if any layer I encounter has a touch hit region that contains the given point, I punt to main. Note: depends on https://codereview.chromium.org/238803005/ BUG=351723 Review URL: https://codereview.chromium.org/239453009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264395 0039d316-1c4b-4281-b951-d872f2087c98
* Stop displaying layers with non-invertible transforms.avallee@chromium.org2014-04-161-10/+70
| | | | | | | | | | | | | | | | According to the CSS spec, if the transform of an object is non-invertible the object and its content do not get displayed. + Added transform_is_invertible to Layer and LayerImpl which gets calculated once when the transform is set. When pusing to another layer the transform invertibility isn't recalculated. + Added invertibility check to LTHC::SubtreeShouldBeSkipped. BUG=173726 Review URL: https://codereview.chromium.org/217313003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264341 0039d316-1c4b-4281-b951-d872f2087c98
* Rasterize at maximum scale for scale animations on CPU-rasterized layersajuma@chromium.org2014-04-091-0/+226
| | | | | | | | | | | | This re-rasterizes CPU-rasterized layers animating scale at the maximum scale that will be applied during the animation, if this maximum scale can be computed. BUG=224913 Review URL: https://codereview.chromium.org/226283004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262737 0039d316-1c4b-4281-b951-d872f2087c98
* cc: CalculateDrawProperties use device transform scaleboliu@chromium.org2014-04-091-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, any scaling in LTHI::external_transform_ is ignored by PictureLayerImpl when deciding to create tilings at different scales. If the scaling in external transform is not 1, then the scaling will just be done at draw time without creating new tilings at the new scale. This CL takes out the scale from external transform and apply it to the device scale. This way PictureLayerImpl will notice the scale change and create new tilings as necessary. This does mean device scale can change each frame and lead to creating a lot of unnecessary tilings. However there is no good signal to know whether a the transform is part of an animation. So there is no good point like "animation end" to update tiling. BUG=357441 Review URL: https://codereview.chromium.org/227153011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262571 0039d316-1c4b-4281-b951-d872f2087c98
* Fix fixed-pos jitter related to physical pixel snapping.aelias@chromium.org2014-04-021-0/+45
| | | | | | | | | | | | | The effective scroll delta is corrected for rounding to nearest screen pixel, but this was done in the wrong coordinate space (scroll delta is in CSS pixels, not physical pixels). NOTRY=true BUG=357889 Review URL: https://codereview.chromium.org/216973006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261057 0039d316-1c4b-4281-b951-d872f2087c98
* plumbing fills_bounds_completely from aura to content_layer_updaterluken@chromium.org2014-03-251-0/+1
| | | | | | | | BUG=313494 Review URL: https://codereview.chromium.org/191453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259160 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to use SharedBitmapManager all the time in cc_unittestsjbauman@chromium.org2014-03-201-32/+64
| | | | | | | | This matches the behavior of the browser and renderer better, and lets us use SharedBitmaps in more tests. Review URL: https://codereview.chromium.org/202763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258318 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Ensure changes to a Layer's content bounds or scale get pushedajuma@chromium.org2014-02-251-0/+52
| | | | | | | | | | | | This changes UpdateLayerContentsScale(Layer* layer, ...) so that if the layer's content bounds or contents scale are changed, then its needs_push_properties() flag is set. BUG=345267 Review URL: https://codereview.chromium.org/178303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253140 0039d316-1c4b-4281-b951-d872f2087c98
* No more sublayer transform in cc.vollick@chromium.org2014-02-161-584/+28
| | | | | | | | | | | | | We don't use it in blink. Let's get rid of it in cc, too. Note: depends on https://codereview.chromium.org/78233009/. R=enne@chromium.org BUG=None Review URL: https://codereview.chromium.org/167753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251621 0039d316-1c4b-4281-b951-d872f2087c98
* Split preserve3d into: "should-flatten" and "is-3d-sorted"vollick@chromium.org2014-02-111-49/+458
| | | | | | | | | | | | | | | | | | | | | | | | Preserve3d has implications for both sorting and flattening of transforms. This is a bummer. Sometimes we want to allow a transform to remain unflattened, but we don't want that to affect 3d sorting. With this CL, we will have the ability to do that. Note: this is essentially this cl https://codereview.chromium.org/100393005/ ..minus the generalizations to sorting that were being attempted in that patch. Note, this CL is gated on https://codereview.chromium.org/98373011/ R=enne@chromium.org BUG=338980 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=249974 Review URL: https://codereview.chromium.org/147833003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250474 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Split preserve3d into: "should-flatten" and "is-3d-sorted" ↵dstockwell@chromium.org2014-02-101-457/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/147833003/) Reason for revert: Introduces flakiness in Blink layout tests: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%2540ToT%2520Blink&tests=compositing%252Fbackface-visibility-transformed Original issue's description: > Split preserve3d into: "should-flatten" and "is-3d-sorted" > > Preserve3d has implications for both sorting and flattening of > transforms. This is a bummer. Sometimes we want to allow a transform to > remain unflattened, but we don't want that to affect 3d sorting. With > this CL, we will have the ability to do that. > > Note: this is essentially this cl > https://codereview.chromium.org/100393005/ > > ..minus the generalizations to sorting that were being attempted in that > patch. > > Note, this CL is gated on https://codereview.chromium.org/98373011/ > > R=enne@chromium.org > BUG=338980 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=249974 TBR=enne@chromium.org,shawnsingh@chromium.org,vollick@chromium.org NOTREECHECKS=true NOTRY=true BUG=338980 Review URL: https://codereview.chromium.org/158563003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250031 0039d316-1c4b-4281-b951-d872f2087c98
* Split preserve3d into: "should-flatten" and "is-3d-sorted"vollick@chromium.org2014-02-091-48/+457
| | | | | | | | | | | | | | | | | | | | | | Preserve3d has implications for both sorting and flattening of transforms. This is a bummer. Sometimes we want to allow a transform to remain unflattened, but we don't want that to affect 3d sorting. With this CL, we will have the ability to do that. Note: this is essentially this cl https://codereview.chromium.org/100393005/ ..minus the generalizations to sorting that were being attempted in that patch. Note, this CL is gated on https://codereview.chromium.org/98373011/ R=enne@chromium.org BUG=338980 Review URL: https://codereview.chromium.org/147833003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249974 0039d316-1c4b-4281-b951-d872f2087c98
* [cc] Fix for hidden layers with copy requests getting composited to the screen.miu@chromium.org2014-02-071-1/+1
| | | | | | | | | | | In LayerTreeHostCommon, when computing the drawing properties, a layer was being treated as visible if it was hidden and had copy requests. The intention is for the layer+subtree to be drawn as if the target layer were visible, just for read-back. However, a distinction must be made between whether a layer is "visible" versus "hidden, but still drawn." This is important when setting the render surface's contributes_to_drawn_surface property. If a layer is hidden, it does *not* contribute, regardless of whether it is drawn. BUG=341318 TEST=New cc_unittests that fail before this change: LayerTreeHostReadbackPixelTest.ReadbackHiddenSubtree_* Confirmed LayerTreeHostCommonTest.SubtreeHidden*, and all other cc_unittests still pass. Review URL: https://codereview.chromium.org/142443009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249627 0039d316-1c4b-4281-b951-d872f2087c98
* Pinch/Zoom Infrastructure & Plumbing CLwjmaclean@chromium.org2014-01-311-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL supplies the necessary changes to CC to support the inner/outer viewport model for pinch-zoom and fixed-position elements. The specification for these changes is contained in the document "Layer-based Solution for Pinch Zoom / Fixed Position". It incorporates a change to how scrollbar parameters are computed (removes the notion of max_scroll_offset as a quantity set be the embedder, and instead inferred from the relative sizes of a clip layer w.r.t. the scroll layer). Scrollbars are generalized so that a layer may have more than two scrollbars, and the parameters of the scrollbar are set w.r.t. the sizes and positions of a clip and a scroll layer. Further, changes to the scrip/scroll layer automatically notify any attached scrollbars. The CL also removes existing references to root_scroll_layer from LTH, LTI and LTHI and replaces them with either Inner/OuterViewportScrollLayer (dual-layer operation only exists at present if the --enable-pinch-virtual-viewport flag is specified, otherwise behavior is unchanged). Logic is added to (i) combine scroll offsets for the two viewports before passing it to the embedder, and (ii) splitting any offsets received from the embedder appropriately between the two viewports. This CL relies on https://codereview.chromium.org/138453004/ for changes in Blink to support it. BUG=148816 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246812 R=aelias@chromium.org, enne@chromium.org, joi@chromium.org, piman@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247684 Review URL: https://codereview.chromium.org/23983047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248092 0039d316-1c4b-4281-b951-d872f2087c98
* [#7] Pass gfx::Size by const ref.prashant.n@samsung.com2014-01-291-3/+3
| | | | | | | | | | | | | | | Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters and some other scenarios mentioned in the bug. BUG=159273 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426 Review URL: https://codereview.chromium.org/145313006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247769 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Pinch/Zoom Infrastructure & Plumbing CL ↵ricea@chromium.org2014-01-291-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/23983047/) Reason for revert: Broke Linux ASAN Tests (3) bot. Original issue's description: > Pinch/Zoom Infrastructure & Plumbing CL > > This CL supplies the necessary changes to CC to support the > inner/outer viewport model for pinch-zoom and fixed-position > elements. The specification for these changes is contained in > the document "Layer-based Solution for Pinch Zoom / Fixed > Position". > > It incorporates a change to how scrollbar parameters are > computed (removes the notion of max_scroll_offset as a > quantity set be the embedder, and instead inferred from the > relative sizes of a clip layer w.r.t. the scroll layer). > > Scrollbars are generalized so that a layer may have more than > two scrollbars, and the parameters of the scrollbar are set > w.r.t. the sizes and positions of a clip and a scroll layer. > Further, changes to the scrip/scroll layer automatically > notify any attached scrollbars. > > The CL also removes existing references to root_scroll_layer > from LTH, LTI and LTHI and replaces them with either > Inner/OuterViewportScrollLayer (dual-layer operation only > exists at present if the --enable-pinch-virtual-viewport flag > is specified, otherwise behavior is unchanged). > > Logic is added to (i) combine scroll offsets for the two > viewports before passing it to the embedder, and (ii) > splitting any offsets received from the embedder > appropriately between the two viewports. > > This CL relies on https://codereview.chromium.org/138453004/ > for changes in Blink to support it. > > BUG=148816 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246812 > > R=aelias@chromium.org, enne@chromium.org, joi@chromium.org, piman@chromium.org, sky@chromium.org > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247684 TBR=enne@chromium.org,aelias@chromium.org,joi@chromium.org,sky@chromium.org,piman@chromium.org,tony@chromium.org,wjmaclean@chromium.org NOTREECHECKS=true NOTRY=true BUG=148816 Review URL: https://codereview.chromium.org/135183016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247688 0039d316-1c4b-4281-b951-d872f2087c98
* Pinch/Zoom Infrastructure & Plumbing CLwjmaclean@chromium.org2014-01-291-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL supplies the necessary changes to CC to support the inner/outer viewport model for pinch-zoom and fixed-position elements. The specification for these changes is contained in the document "Layer-based Solution for Pinch Zoom / Fixed Position". It incorporates a change to how scrollbar parameters are computed (removes the notion of max_scroll_offset as a quantity set be the embedder, and instead inferred from the relative sizes of a clip layer w.r.t. the scroll layer). Scrollbars are generalized so that a layer may have more than two scrollbars, and the parameters of the scrollbar are set w.r.t. the sizes and positions of a clip and a scroll layer. Further, changes to the scrip/scroll layer automatically notify any attached scrollbars. The CL also removes existing references to root_scroll_layer from LTH, LTI and LTHI and replaces them with either Inner/OuterViewportScrollLayer (dual-layer operation only exists at present if the --enable-pinch-virtual-viewport flag is specified, otherwise behavior is unchanged). Logic is added to (i) combine scroll offsets for the two viewports before passing it to the embedder, and (ii) splitting any offsets received from the embedder appropriately between the two viewports. This CL relies on https://codereview.chromium.org/138453004/ for changes in Blink to support it. BUG=148816 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246812 R=aelias@chromium.org, enne@chromium.org, joi@chromium.org, piman@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/23983047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247684 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of [#7] Pass gfx structs by const ref (gfx::Size) ↵mnissler@chromium.org2014-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/145313006/) Reason for revert: Suspected of breaking the Linux ASAN tests ( http://build.chromium.org/p/chromium.memory/builders/Linux%20ASAN%20Tests%20%283%29/builds/22104 ) Original issue's description: > [#7] Pass gfx::Size by const ref. > > Any struct of size > 4 bytes should be passed by const ref. > Passing by ref for these structs is faster than passing by value, > especially when invoking function has multiple parameters and some > other scenarios mentioned in the bug. > > BUG=159273 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426 TBR=danakj@chromium.org,enne@chromium.org,bulach@chromium.org,piman@chromium.org,prashant.n@samsung.com NOTREECHECKS=true NOTRY=true BUG=159273 Review URL: https://codereview.chromium.org/142863008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247437 0039d316-1c4b-4281-b951-d872f2087c98
* [#7] Pass gfx::Size by const ref.prashant.n@samsung.com2014-01-281-3/+3
| | | | | | | | | | | | | Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters and some other scenarios mentioned in the bug. BUG=159273 Review URL: https://codereview.chromium.org/145313006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247426 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Pinch/Zoom Infrastructure & Plumbing CL ↵mkwst@chromium.org2014-01-241-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/23983047/) Reason for revert: This patch broke several blink-side compositing/rtl tests[1][2]. It's unclear whether these tests are valuable, given some comments in TestExpectations, but since I know nothing about compositing I'll leave the decision about what to do with these tests up to someone who does. [1]: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&tests=compositing/rtl/rtl-iframe-absolute-overflow-scrolled.html,compositing/rtl/rtl-iframe-absolute-overflow.html,compositing/rtl/rtl-iframe-fixed-overflow-scrolled.html,compositing/rtl/rtl-iframe-fixed-overflow.html [2]: http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.7/builds/22131 Original issue's description: > Pinch/Zoom Infrastructure & Plumbing CL > > This CL supplies the necessary changes to CC to support the > inner/outer viewport model for pinch-zoom and fixed-position > elements. The specification for these changes is contained in > the document "Layer-based Solution for Pinch Zoom / Fixed > Position". > > It incorporates a change to how scrollbar parameters are > computed (removes the notion of max_scroll_offset as a > quantity set be the embedder, and instead inferred from the > relative sizes of a clip layer w.r.t. the scroll layer). > > Scrollbars are generalized so that a layer may have more than > two scrollbars, and the parameters of the scrollbar are set > w.r.t. the sizes and positions of a clip and a scroll layer. > Further, changes to the scrip/scroll layer automatically > notify any attached scrollbars. > > The CL also removes existing references to root_scroll_layer > from LTH, LTI and LTHI and replaces them with either > Inner/OuterViewportScrollLayer (dual-layer operation only > exists at present if the --enable-pinch-virtual-viewport flag > is specified, otherwise behavior is unchanged). > > Logic is added to (i) combine scroll offsets for the two > viewports before passing it to the embedder, and (ii) > splitting any offsets received from the embedder > appropriately between the two viewports. > > This CL relies on https://codereview.chromium.org/138453004/ > for changes in Blink to support it. > > BUG=148816 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246812 TBR=enne@chromium.org,aelias@chromium.org,joi@chromium.org,sky@chromium.org,piman@chromium.org,tony@chromium.org,wjmaclean@chromium.org NOTREECHECKS=true NOTRY=true BUG=148816 Review URL: https://codereview.chromium.org/146713002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246842 0039d316-1c4b-4281-b951-d872f2087c98
* Pinch/Zoom Infrastructure & Plumbing CLwjmaclean@chromium.org2014-01-241-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL supplies the necessary changes to CC to support the inner/outer viewport model for pinch-zoom and fixed-position elements. The specification for these changes is contained in the document "Layer-based Solution for Pinch Zoom / Fixed Position". It incorporates a change to how scrollbar parameters are computed (removes the notion of max_scroll_offset as a quantity set be the embedder, and instead inferred from the relative sizes of a clip layer w.r.t. the scroll layer). Scrollbars are generalized so that a layer may have more than two scrollbars, and the parameters of the scrollbar are set w.r.t. the sizes and positions of a clip and a scroll layer. Further, changes to the scrip/scroll layer automatically notify any attached scrollbars. The CL also removes existing references to root_scroll_layer from LTH, LTI and LTHI and replaces them with either Inner/OuterViewportScrollLayer (dual-layer operation only exists at present if the --enable-pinch-virtual-viewport flag is specified, otherwise behavior is unchanged). Logic is added to (i) combine scroll offsets for the two viewports before passing it to the embedder, and (ii) splitting any offsets received from the embedder appropriately between the two viewports. This CL relies on https://codereview.chromium.org/138453004/ for changes in Blink to support it. BUG=148816 Review URL: https://codereview.chromium.org/23983047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246812 0039d316-1c4b-4281-b951-d872f2087c98
* [#4] Pass gfx structs by const ref (gfx::PointF)r.kasibhatla@samsung.com2014-01-171-6/+6
| | | | | | | | | | | | | | | | | | | Avoid unneccessary copy of structures gfx::PointF by passing them by const ref rather than value. Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters. Pass by value creates unneccessary overhead which should be avoided. BUG=159273 R=danakj, enne, piman Review URL: https://codereview.chromium.org/139233002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245467 0039d316-1c4b-4281-b951-d872f2087c98
* Pass gfx::Rect and gfx::RectF by const ref.prashant.n@samsung.com2014-01-101-1/+1
| | | | | | | | | | | | | | | | | Avoid unneccessary copy of structures gfx::Rect & gfx::RectF by passing them by const ref rather than value. Any struct of size > 4 bytes should be passed by const ref. Passing by ref for these structs is faster than passing by value, especially when invoking function has multiple parameters. Pass by value creates unneccessary overhead which should be avoided. BUG=159273 Review URL: https://codereview.chromium.org/93663004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244224 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 232881 "cc: Fix hit-testing in zero-opacity layers."skyostil@google.com2013-11-121-156/+11
| | | | | | | | | | | | | | | | | | | | | Reverting because this broke scrolling on mobile GMail. > cc: Fix hit-testing in zero-opacity layers. > > If a layer that accepts touch or wheel events, but the layer (or one of its > ancestor layers) has zero opacity, then make sure the layer hit-tests correctly. > > BUG=295295 > R=enne@chromium.org, rbyers@google.com > > Review URL: https://codereview.chromium.org/26112002 TBR=sadrul@chromium.org BUG=318088,313523 Review URL: https://codereview.chromium.org/68933008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234482 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Fix hit-testing in zero-opacity layers.sadrul@chromium.org2013-11-051-11/+156
| | | | | | | | | | | | If a layer that accepts touch or wheel events, but the layer (or one of its ancestor layers) has zero opacity, then make sure the layer hit-tests correctly. BUG=295295 R=enne@chromium.org, rbyers@google.com Review URL: https://codereview.chromium.org/26112002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232881 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Make scroll compensation take integer snapping into accountenne@chromium.org2013-10-251-0/+113
| | | | | | | | | | | | | Scroll layers are snapped to integer coordinates, but fixed position layers that compensated for that scroll weren't taking that into consideration. R=danakj@chromium.org BUG=309179 Review URL: https://codereview.chromium.org/41603002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230988 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Fix touch hit-testing for overlapping layers (in tests).sadrul@chromium.org2013-10-241-0/+84
| | | | | | | | | | | | | | | If a touch-layer is below a non-touch layer, and the two layers overlap, then the overlapped region should not be treated as a touch-handling region. This change updates FindLayerThatIsHitByPointInTouchHandlerRegion() to do the right thing (which is currently used only in tests), and uses this function from LayerTreeHostImpl::HaveTouchEventHandlersAt() (instead of having its own code). BUG=none R=enne@chromium.org Review URL: https://codereview.chromium.org/27718006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230578 0039d316-1c4b-4281-b951-d872f2087c98
* Only allocate temporary layer lists when sorting contributions.vollick@chromium.org2013-10-191-2/+6
| | | | | | | | | | | | | | | | | | | | Previously, I'd constructed temporary layer lists to hold the layer list contributions from children when I visited them out of order in CalcDrawProps. Unfortunately ~RenderSurfaceLayerList frees all the surfaces, so when the temporary lists were destroyed, the surfaces would be nuked. To work around this, I don't pass temporary lists to children, I just sort the "real" lists after the recursion. When doing this sorting I allocate a LayerList for Layers and a LayerImplList for LayerImpls. The types got a bit unwieldy when doing this, so I also put some handy typedefs in Layer and LayerImpl. This lets us cut down on the number of template parameters we use in LTHC. TEST=LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting R=danakj@chromium.org BUG=309381 Review URL: https://codereview.chromium.org/29653002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229619 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert "Allow clipping by scroll parents." and "Improve perf of ↵vollick@chromium.org2013-10-171-0/+562
| | | | | | | | | | | | | | | | | CalculateDrawPropertiesInternal when there are no scroll parents."" This reverts commit 97ada322de9f492e3f0d1741ac117fc42599451b. This was a speculative perf revert; seems not to be the issue. Relanding. Local tests with and without this patch on a Nexus 4 with and without my patch didn't show a perf regression (in fact, perf seemed to mysteriously improve -- I assume this is noise). TBR=danakj@chromium.org BUG=306926 Review URL: https://codereview.chromium.org/26135005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229221 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Allow clipping by scroll parents." and "Improve perf of ↵vollick@chromium.org2013-10-151-562/+0
| | | | | | | | | | | | | | | | | | | | | | CalculateDrawPropertiesInternal when there are no scroll parents." Speculative revert to see if this affects SVG perf. This reverts commit 7d148876b818e079b85821b702dd9dbe592127f5. Conflicts: cc/trees/layer_tree_host_common.cc Revert "Improve perf of CalculateDrawPropertiesInternal when there are no scroll parents." This reverts commit 1cdf6668b7665cbc984d1f7eb75548ec4b8af3b0. TBR=vollick@chromium.org BUG=306926 Review URL: https://codereview.chromium.org/27341002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228678 0039d316-1c4b-4281-b951-d872f2087c98
* Allow clipping by scroll parents.vollick@chromium.org2013-10-081-0/+562
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we had required that we inherit our clip from our direct ancestor or our clip parent (which has to be an ancestor). This CL loosens that restriction and allows clipping by our scroll parent, which will not be our ancestor. In order for this to work, we must ensure that the scroll parent's clip is computed before we compute the clip children's. This is accomplished by changing the order in which we recur through the layer tree and sorting layer lists afterward to ensure that we ultimately stack correctly. NB: I have taken care to only sort the newly added layers, and to only sort when the child order has actually changed, which should happen rarely. Tests: 1. LayerTreeHostCommonTest.ClippedByScrollParent - Checks that the simple case (where the scroll parent is naturally processed before the scroll child) results in the correct clips. 2. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollParent - Identical to (1) but checks that clips are still correct when the scroll parent needs to be visited out of order. 3. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollGrandparent - Similar to (2), but also checks that clips are set up correctly if the scroll parent has yet another scroll parent (sorting for recursion is a bit tougher in this case). - Also checks that despite visiting layers out of order, that the layer list ends up in paint order. 4. LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting - Similar to (3), but includes several render surfaces in the tree and checks that the resulting render surface layer list is ordered correctly. 5. LayerTreeHostCommonTest.DoNotClobberSorting - Ensures that if we have to reorder layer list contributions that we do not break 3d sorting. BUG=291413 R=danakj@chromium.org, enne@chromium.org, hartmanng@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=225858 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226219 Review URL: https://codereview.chromium.org/23536049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227519 0039d316-1c4b-4281-b951-d872f2087c98
* Remove PerformClipping(),CanClipSelf() and the related logic in LTHCommon.jun.a.jiang@intel.com2013-10-051-156/+0
| | | | | | | | | | | | | | | | | There is a precision lost issue for texture layers with CSS transforms(Scaling) when applying TextureDrawQuad::PerformClipping() to avoid explicitly setting a scissor. The rect is first divided by the scale_factor, then round to integer value and finally multiplied by the scale_factor in GLRenderer::EnqueueTextureQuad(). The round process loses precision and the later scale operation enlarges the error. This error leads to wrong width and height drawn and introduces visual defects. BUG=240259 Review URL: https://codereview.chromium.org/24427006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227177 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Fix hit-testing of empty layers.sadrul@chromium.org2013-10-051-0/+115
| | | | | | | | | | | | | | The RenderSurfaceLayerList is supposed to contain any layers which are visible or that are eligible for hit testing. This change ensures that empty layers (those with drawsContent=false) are left in the RSSL when they have touch or wheel handlers, so that we can find them in hit testing. BUG=289766 R=danakj@chromium.org Review URL: https://codereview.chromium.org/25712004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227164 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 226219 "Allow clipping by scroll parents."phoglund@chromium.org2013-10-011-562/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Likely broke unit tests on Android: http://build.chromium.org/p/chromium.linux/builders/Android%20Tests/builds/8345 > Allow clipping by scroll parents. > > Previously, we had required that we inherit our clip from our direct ancestor or > our clip parent (which has to be an ancestor). This CL loosens that restriction > and allows clipping by our scroll parent, which will not be our ancestor. > > In order for this to work, we must ensure that the scroll parent's clip is > computed before we compute the clip children's. This is accomplished by changing > the order in which we recur through the layer tree and sorting layer lists > afterward to ensure that we ultimately stack correctly. > > NB: I have taken care to only sort the newly added layers, and to only sort when > the child order has actually changed, which should happen rarely. > > Tests: > 1. LayerTreeHostCommonTest.ClippedByScrollParent > - Checks that the simple case (where the scroll parent is naturally processed > before the scroll child) results in the correct clips. > 2. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollParent > - Identical to (1) but checks that clips are still correct when the scroll > parent needs to be visited out of order. > 3. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollGrandparent > - Similar to (2), but also checks that clips are set up correctly if the > scroll parent has yet another scroll parent (sorting for recursion is a bit > tougher in this case). > - Also checks that despite visiting layers out of order, that the layer list > ends up in paint order. > 4. LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting > - Similar to (3), but includes several render surfaces in the tree and checks > that the resulting render surface layer list is ordered correctly. > 5. LayerTreeHostCommonTest.DoNotClobberSorting > - Ensures that if we have to reorder layer list contributions that we do not break 3d sorting. > > BUG=291413 > R=danakj@chromium.org, enne@chromium.org, hartmanng@chromium.org > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=225858 > > Review URL: https://codereview.chromium.org/23536049 TBR=vollick@chromium.org Review URL: https://codereview.chromium.org/25542002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226231 0039d316-1c4b-4281-b951-d872f2087c98
* Allow clipping by scroll parents.vollick@chromium.org2013-10-011-0/+562
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we had required that we inherit our clip from our direct ancestor or our clip parent (which has to be an ancestor). This CL loosens that restriction and allows clipping by our scroll parent, which will not be our ancestor. In order for this to work, we must ensure that the scroll parent's clip is computed before we compute the clip children's. This is accomplished by changing the order in which we recur through the layer tree and sorting layer lists afterward to ensure that we ultimately stack correctly. NB: I have taken care to only sort the newly added layers, and to only sort when the child order has actually changed, which should happen rarely. Tests: 1. LayerTreeHostCommonTest.ClippedByScrollParent - Checks that the simple case (where the scroll parent is naturally processed before the scroll child) results in the correct clips. 2. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollParent - Identical to (1) but checks that clips are still correct when the scroll parent needs to be visited out of order. 3. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollGrandparent - Similar to (2), but also checks that clips are set up correctly if the scroll parent has yet another scroll parent (sorting for recursion is a bit tougher in this case). - Also checks that despite visiting layers out of order, that the layer list ends up in paint order. 4. LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting - Similar to (3), but includes several render surfaces in the tree and checks that the resulting render surface layer list is ordered correctly. 5. LayerTreeHostCommonTest.DoNotClobberSorting - Ensures that if we have to reorder layer list contributions that we do not break 3d sorting. BUG=291413 R=danakj@chromium.org, enne@chromium.org, hartmanng@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=225858 Review URL: https://codereview.chromium.org/23536049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226219 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 225858 "Allow clipping by scroll parents."vollick@chromium.org2013-09-281-562/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > Allow clipping by scroll parents. > > Previously, we had required that we inherit our clip from our direct ancestor or > our clip parent (which has to be an ancestor). This CL loosens that restriction > and allows clipping by our scroll parent, which will not be our ancestor. > > In order for this to work, we must ensure that the scroll parent's clip is > computed before we compute the clip children's. This is accomplished by changing > the order in which we recur through the layer tree and sorting layer lists > afterward to ensure that we ultimately stack correctly. > > NB: I have taken care to only sort the newly added layers, and to only sort when > the child order has actually changed, which should happen rarely. > > Tests: > 1. LayerTreeHostCommonTest.ClippedByScrollParent > - Checks that the simple case (where the scroll parent is naturally processed > before the scroll child) results in the correct clips. > 2. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollParent > - Identical to (1) but checks that clips are still correct when the scroll > parent needs to be visited out of order. > 3. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollGrandparent > - Similar to (2), but also checks that clips are set up correctly if the > scroll parent has yet another scroll parent (sorting for recursion is a bit > tougher in this case). > - Also checks that despite visiting layers out of order, that the layer list > ends up in paint order. > 4. LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting > - Similar to (3), but includes several render surfaces in the tree and checks > that the resulting render surface layer list is ordered correctly. > 5. LayerTreeHostCommonTest.DoNotClobberSorting > - Ensures that if we have to reorder layer list contributions that we do not break 3d sorting. > > BUG=291413 > R=danakj@chromium.org, enne@chromium.org, hartmanng@chromium.org > > Review URL: https://codereview.chromium.org/23536049 TBR=vollick@chromium.org Review URL: https://codereview.chromium.org/25058006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225860 0039d316-1c4b-4281-b951-d872f2087c98
* Allow clipping by scroll parents.vollick@chromium.org2013-09-281-0/+562
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we had required that we inherit our clip from our direct ancestor or our clip parent (which has to be an ancestor). This CL loosens that restriction and allows clipping by our scroll parent, which will not be our ancestor. In order for this to work, we must ensure that the scroll parent's clip is computed before we compute the clip children's. This is accomplished by changing the order in which we recur through the layer tree and sorting layer lists afterward to ensure that we ultimately stack correctly. NB: I have taken care to only sort the newly added layers, and to only sort when the child order has actually changed, which should happen rarely. Tests: 1. LayerTreeHostCommonTest.ClippedByScrollParent - Checks that the simple case (where the scroll parent is naturally processed before the scroll child) results in the correct clips. 2. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollParent - Identical to (1) but checks that clips are still correct when the scroll parent needs to be visited out of order. 3. LayerTreeHostCommonTest.ClippedByOutOfOrderScrollGrandparent - Similar to (2), but also checks that clips are set up correctly if the scroll parent has yet another scroll parent (sorting for recursion is a bit tougher in this case). - Also checks that despite visiting layers out of order, that the layer list ends up in paint order. 4. LayerTreeHostCommonTest.OutOfOrderClippingRequiresRSLLSorting - Similar to (3), but includes several render surfaces in the tree and checks that the resulting render surface layer list is ordered correctly. 5. LayerTreeHostCommonTest.DoNotClobberSorting - Ensures that if we have to reorder layer list contributions that we do not break 3d sorting. BUG=291413 R=danakj@chromium.org, enne@chromium.org, hartmanng@chromium.org Review URL: https://codereview.chromium.org/23536049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225858 0039d316-1c4b-4281-b951-d872f2087c98
* Move tile-free-software render surface disabling to UpdateDrawProperties.aelias@chromium.org2013-09-271-0/+78
| | | | | | | | | | | | | | | | | | | | Currently when DrawProperties decides a subtree needs a render surface, Android WebView software mode just drops it at CalculateRenderPasses time and draws nothing. If we instead suppress the render surface decision at an earlier stage, we're more likely to get a halfway reasonable result. The motivating example was a page setting preserve-3d where the render surface didn't affect the output result anyway. New test LayerTreeHostCommonTest.CanRenderToSeparateSurface. NOTRY=true BUG=297299 Review URL: https://codereview.chromium.org/24280009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225637 0039d316-1c4b-4281-b951-d872f2087c98
* Fix compilation and ui_unittests with float transformsenne@chromium.org2013-09-251-11/+11
| | | | | | | | | | | | | | This change also cleans up the use of gfx::Transform::get/setDouble (in favor of get/set) at callsites to prepare for changing SkMScalar from double to float. BUG=269817 Originally Committed/Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=224725 Review URL: https://chromiumcodereview.appspot.com/23811009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225130 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 224725 "Fix compilation and ui_unittests with float trans..."sky@chromium.org2013-09-231-11/+11
| | | | | | | | | | | | | | | | | | | | | Reverting as caused perf regression because of new static initializers. > Fix compilation and ui_unittests with float transforms > > This change also cleans up the use of gfx::Transform::get/setDouble > (in favor of get/set) at callsites to prepare for changing SkMScalar > from double to float. > > BUG=269817 > > Review URL: https://chromiumcodereview.appspot.com/23811009 TBR=enne@chromium.org Review URL: https://codereview.chromium.org/23537065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224732 0039d316-1c4b-4281-b951-d872f2087c98
* Fix compilation and ui_unittests with float transformsenne@chromium.org2013-09-231-11/+11
| | | | | | | | | | | | This change also cleans up the use of gfx::Transform::get/setDouble (in favor of get/set) at callsites to prepare for changing SkMScalar from double to float. BUG=269817 Review URL: https://chromiumcodereview.appspot.com/23811009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224725 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Use SkMScalar instead of doubles for transforms in ccenne@chromium.org2013-09-121-169/+142
| | | | | | | | BUG=269819 Review URL: https://chromiumcodereview.appspot.com/23043011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222683 0039d316-1c4b-4281-b951-d872f2087c98
* Clear render surface when we early out in CalcDrawPropsInternalvollick@chromium.org2013-08-291-0/+66
| | | | | | | | | | | | | | If we don't clear the layer's render surface when we early out, we'll build the render surface layer list incorrectly, and the layer iterator will crash trying to iterate over it. I've done this at the first early out, but I missed this at the second. R=danakj@chromium.org BUG=280613 Review URL: https://chromiumcodereview.appspot.com/23708003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220194 0039d316-1c4b-4281-b951-d872f2087c98