summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_impl_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Don't hide pinch viewport scrollbars near min-scale with device emulation.skobes2015-08-041-3/+3
| | | | | | | | | | | Depends on http://crrev.com/1269813004. BUG=515746 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1267603004 Cr-Commit-Position: refs/heads/master@{#341784}
* Compute if a layer is clipped outside CalcDrawPropsjaydasika2015-07-141-0/+3
| | | | | | | | | | | | | | We need to know if a layer is clipped to compute its drawable visible rect. So, we need to compute it outside CalcDrawProps to move drawable visible rect computation outside CalcDrawProps. Committed: https://crrev.com/2af7226e29be65a8ea4a279b9358a6fcfada5cd3 Cr-Commit-Position: refs/heads/master@{#338515} CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1231453002 Cr-Commit-Position: refs/heads/master@{#338691}
* Revert of Compute if a layer is clipped outside CalcDrawProps (patchset #9 ↵dpranke2015-07-131-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:160001 of https://codereview.chromium.org/1231453002/) Reason for revert: It looks like this is causing MSAN failures from an uninitialized variable in the webkit_tests: http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20MSAN/builds/4378/steps/webkit_tests/logs/stdio 10:00:36.214 29049 ==29058==WARNING: MemorySanitizer: use-of-uninitialized-value 10:00:36.214 29049 #0 0x7f620bf62c3e in set_is_clipped cc/layers/layer.h:503:9 10:00:36.214 29049 #1 0x7f620bf62c3e in AddClipNodeIfNeeded<cc::Layer> cc/trees/property_tree_builder.cc:149:0 10:00:36.214 29049 #2 0x7f620bf62c3e in void cc::(anonymous namespace)::BuildPropertyTreesInternal<cc::Layer>(cc::Layer*, cc::(anonymous namespace)::DataForRecursion<cc::Layer> const&) cc/trees/property_tree_builder.cc:386:0 10:00:36.214 29049 #3 0x7f620bf5d128 in void cc::BuildPropertyTreesTopLevelInternal<cc::Layer>(cc::Layer*, cc::Layer const*, cc::Layer const*, cc::Layer const*, float, float, gfx::Rect const&, gfx::Transform const&, cc::PropertyTrees*) cc/trees/property_tree_builder.cc:466:3 10:00:36.214 29049 #4 0x7f620c206ee6 in cc::BuildPropertyTreesAndComputeVisibleRects(cc::Layer*, cc::Layer const*, cc::Layer const*, cc::Layer const*, float, float, gfx::Rect const&, gfx::Transform const&, cc::PropertyTrees*, std::__1::vector<scoped_refptr<cc::Layer>, std::__1::allocator<scoped_refptr<cc::Layer> > >*) cc/trees/draw_property_utils.cc:473:3 10:00:36.214 29049 #5 0x7f620be94a2f in cc::LayerTreeHost::DoUpdateLayers(cc::Layer*) cc/trees/layer_tree_host.cc:789:5 on pretty much every test. So I'm reverting this. Sorry! Original issue's description: > Compute if a layer is clipped outside CalcDrawProps > > We need to know if a layer is clipped to compute its drawable > visible rect. So, we need to compute it outside CalcDrawProps to move > drawable visible rect computation outside CalcDrawProps. > > Committed: https://crrev.com/2af7226e29be65a8ea4a279b9358a6fcfada5cd3 > Cr-Commit-Position: refs/heads/master@{#338515} TBR=ajuma@chromium.org,enne@chromium.org,vollick@chromium.org,jaydasika@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1236943002 Cr-Commit-Position: refs/heads/master@{#338542}
* Compute if a layer is clipped outside CalcDrawPropsjaydasika2015-07-131-0/+3
| | | | | | | | | | We need to know if a layer is clipped to compute its drawable visible rect. So, we need to compute it outside CalcDrawProps to move drawable visible rect computation outside CalcDrawProps. Review URL: https://codereview.chromium.org/1231453002 Cr-Commit-Position: refs/heads/master@{#338515}
* cc: Rename visible_content_rect and content stuff on quads.danakj2015-06-191-2/+1
| | | | | | | | | | | | | | | This renames visible_content_rect to visible_layer_rect. And for SharedQuadState renames the transforms and rects to no longer refer to "content" and instead refer to the space the the DrawQuad rects. R=enne, vmpstr TBR=dcheng BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1175113010 Cr-Commit-Position: refs/heads/master@{#335172}
* cc: Remove the layer content_bounds() and use bounds() instead.Dana Jansens2015-06-181-186/+1
| | | | | | | | | | | | | | And remove the content_bounds from DrawProperties. They are always equal now (outside of some legacy tests). R=enne@chromium.org, enne, vmpstr BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1179133004. Cr-Commit-Position: refs/heads/master@{#334979}
* cc: Apply page scale to page scale layerenne2015-05-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, page scale is applied to children of the page scale layer but not to the page scale layer itself. This makes it cumbersome to update property trees during pinch zoom on the compositor thread, because the property tree needs to be searched for any nodes that use the page scale layer's node as a source node. In practice, from Blink, the page scale layer only has one child, but it's a layering violation to assume this. So, apply page scale to the target transform for the page scale layer itself. This shouldn't have any effect in practice, as the page scale layer doesn't usually have content. Also, clean up language that refers to both "page scale layer" and "page scale application layer". In CDP, these are the same thing, but in property tree land one is the parent and one is the child. Now there is only "page scale layer", which gets the page scale applied on it and to its children. This passes cc unit tests with main thread property tree verification manually hacked back on. R=ajuma@chromium.org, vollick@chromium.org, jdduke@chromium.org BUG=481585 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1144103003 Cr-Commit-Position: refs/heads/master@{#331451}
* Plumb selection bounds as a single unitjdduke2015-04-231-115/+120
| | | | | | | | | | | | | Route the new WebSelectionBounds selection unit from Blink atomically, rather than using a pair of data structures to indicate selection. This depends directly on crrev.com/929213004. BUG=466672,410543,417903 Review URL: https://codereview.chromium.org/1000243002 Cr-Commit-Position: refs/heads/master@{#326606}
* cc: Move worker threads to RenderThreadImpl.reveman2015-03-231-2/+4
| | | | | | | | | | | | This allows us to Join the threads when RenderThreadImpl is shutdown. BUG=468785 TEST=cc_unittests Review URL: https://codereview.chromium.org/999173004 Cr-Commit-Position: refs/heads/master@{#321836}
* Splitting of layers for correct intersectionsawoloszyn2015-03-121-8/+0
| | | | | | | | | | | | | | Sorting 3d-sorted layers and rendering them in that order causes issues when layers intersect. Instead place 3d-sorted layers in a bsp tree and fragment any intersecting layers into non-rectangular quads. We can then render the fragments in the correct sorted order regardless of intersections. BUG=455918,159225,132122,230833 Review URL: https://codereview.chromium.org/595593002 Cr-Commit-Position: refs/heads/master@{#320276}
* Revert of Splitting of layers for correct intersections (patchset #20 ↵gab2015-03-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:370001 of https://codereview.chromium.org/595593002/) Reason for revert: Appears to be adding new static initializers and is breaking Mac/Linux builders, e.g.: http://build.chromium.org/p/chromium/buildstatus?builder=Mac&number=34562 Original issue's description: > Splitting of layers for correct intersections > > Sorting 3d-sorted layers and rendering them in that order causes issues > when layers intersect. Instead place 3d-sorted layers in a bsp tree and > fragment any intersecting layers into non-rectangular quads. We can then > render the fragments in the correct sorted order regardless of > intersections. > > BUG=455918,159225,132122,230833 > > Committed: https://crrev.com/7e2af77dcd3b5df086be3421fad40b719779381c > Cr-Commit-Position: refs/heads/master@{#320096} TBR=enne@chromium.org,danakj@chromium.org,eroman@chromium.org,thakis@chromium.org,awoloszyn@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=455918,159225,132122,230833 Review URL: https://codereview.chromium.org/998023002 Cr-Commit-Position: refs/heads/master@{#320122}
* Splitting of layers for correct intersectionsawoloszyn2015-03-111-8/+0
| | | | | | | | | | | | | | Sorting 3d-sorted layers and rendering them in that order causes issues when layers intersect. Instead place 3d-sorted layers in a bsp tree and fragment any intersecting layers into non-rectangular quads. We can then render the fragments in the correct sorted order regardless of intersections. BUG=455918,159225,132122,230833 Review URL: https://codereview.chromium.org/595593002 Cr-Commit-Position: refs/heads/master@{#320096}
* Revert of Splitting of layers for correct intersections (patchset #17 ↵eroman2015-02-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:310001 of https://codereview.chromium.org/595593002/) Reason for revert: Static initializers count increased Original issue's description: > Splitting of layers for correct intersections > > Sorting 3d-sorted layers and rendering them in that order causes issues > when layers intersect. Instead place 3d-sorted layers in a bsp tree and > fragment any intersecting layers into non-rectangular quads. We can then > render the fragments in the correct sorted order regardless of > intersections. > > BUG=455918,159225,132122,230833 > > Committed: https://crrev.com/ac754705ceaa5bc4cb8dc8df9a733b4b68396399 > Cr-Commit-Position: refs/heads/master@{#318506} TBR=enne@chromium.org,danakj@chromium.org,thakis@chromium.org,awoloszyn@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=455918,159225,132122,230833 Review URL: https://codereview.chromium.org/960893004 Cr-Commit-Position: refs/heads/master@{#318528}
* Splitting of layers for correct intersectionsawoloszyn2015-02-271-8/+0
| | | | | | | | | | | | | | Sorting 3d-sorted layers and rendering them in that order causes issues when layers intersect. Instead place 3d-sorted layers in a bsp tree and fragment any intersecting layers into non-rectangular quads. We can then render the fragments in the correct sorted order regardless of intersections. BUG=455918,159225,132122,230833 Review URL: https://codereview.chromium.org/595593002 Cr-Commit-Position: refs/heads/master@{#318506}
* Hide pinch viewport scrollbars when near minimum scale.bokan2015-01-281-0/+69
| | | | | | | | | | | | | | This patch prevents the overlay scrollbars from showing up when we're near the minimum scale. The threshold can be set per-platform; by default it's 0 so the scrollbars will be visible regardless of the scale. On Windows/Linux/CrOS we'd like to prevent the scrollbars from overlaying over the window scrollbars so we set a small non-0 threshold. BUG=446411 Review URL: https://codereview.chromium.org/877863002 Cr-Commit-Position: refs/heads/master@{#313431}
* Move RenderSurface creation outside of CalcDrawPropsawoloszyn2014-12-221-425/+153
| | | | | | | | BUG=386788 Review URL: https://codereview.chromium.org/465853004 Cr-Commit-Position: refs/heads/master@{#309428}
* Use EXPECT_EQ when possible.hush2014-12-041-4/+4
| | | | | | | | | | | EXPECT_RECT_EQ, EXPECT_SIZE_EQ, EXPECT_POINT_EQ, EXPECT_POINT3F_EQ could be replaced by EXPECT_EQ. Follow up of https://codereview.chromium.org/751453005/ Review URL: https://codereview.chromium.org/774763004 Cr-Commit-Position: refs/heads/master@{#306913}
* Refactor delta/sent_delta logic into self-contained abstraction.aelias2014-12-041-2/+4
| | | | | | | | | | | | | | | | | | This patch updates page scale to use a new SyncedProperty abstraction. This is shared between the pending and active trees and contains all page scale state on the impl side except for the min/max limits. Its API only exposes those operations that are encouraged: for example, the raw main-thread originating value can no longer be used by accident. This patch should be a no-op. In future patches, I intend to make scroll offsets and top controls use this abstraction as well. NOTRY=true BUG= Review URL: https://codereview.chromium.org/764483002 Cr-Commit-Position: refs/heads/master@{#306736}
* Plumb scroll elasticity layer from Blink to ccccameron2014-11-211-2/+4
| | | | | | | | | | | | | | | | | | Implement the 4-argument version of registerViewportLayers for all implementers of WebLayerTreeView. Add a scroll elasticity layer to cc::LayerTreeHost and through to cc::LayerTreeHostImpl. These layers are still optional, and most tests set them to NULL. Once the Blink side that pushes real layers through is completed, the scroll elasticity layer will be required. R=enne TBR=jam BUG=133097 Review URL: https://codereview.chromium.org/731863009 Cr-Commit-Position: refs/heads/master@{#305260}
* cc cleanup: Update paths to geometry headersheejin.r.chung2014-10-231-1/+1
| | | | | | | | | | | Geometry headers were moved from /ui/gfx/ to ui/gfx/geometry. Updating includes accordingly. BUG=395370 Review URL: https://codereview.chromium.org/660333004 Cr-Commit-Position: refs/heads/master@{#300902}
* Revert of "Converted LayerImpl::bounds() to return SizeF."bokan2014-10-081-22/+22
| | | | | | | | | | | | Seems this was more contentious than originally anticipated. Reverting this until we have consensus on how to go forward. TBR=aelias@chromium.org,enne@chromium.org,danakj@chromium.org BUG= Review URL: https://codereview.chromium.org/637913003 Cr-Commit-Position: refs/heads/master@{#298710}
* Converted LayerImpl::bounds() to return SizeF.bokan2014-10-071-22/+22
| | | | | | | | | | | | | | Since bounds includes bounds_delta, which is SizeF, it makes sense to return the floating point sum of these two values. In call sites broken by the change, the returned value is converted to Size using ToCeiledSize to preserve the current snapping behavior, though in most (all?) these cases the layer bounds are expected to be integral anyway. BUG= Review URL: https://codereview.chromium.org/634683003 Cr-Commit-Position: refs/heads/master@{#298439}
* cc: Remove use of PassAs() and constructor-casting with scoped_ptr.danakj2014-09-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Say you have class A and subclass B. Previously it was required to PassAs() a scoped_ptr<B> into a scoped_ptr<A>. This is no longer needed, so just use Pass(). For newly created scoped_ptrs, you can just use make_scoped_ptr always now. And when you want to return or assign an empty scoped_ptr(), you can now use nullptr directly. Also adds PRESUBMIT checks for: - return scoped<T>(foo). This should be return make_scoped_ptr(foo). - bar = scoped<T>(foo). This should be return bar = make_scoped_ptr(foo). - return scoped<T>(). This should be return nullptr. - bar = scoped<T>(). This should be return bar = nullptr. This also replaces p.reset() with p = nullptr; But it does not add a PRESUBMIT check for that because there are things other than scoped_ptr with a reset() function. R=enne@chromium.org Committed: https://crrev.com/7bb3dbede19d87f0338797756ffd738adc6bca08 Cr-Commit-Position: refs/heads/master@{#297096} Review URL: https://codereview.chromium.org/609663003 Cr-Commit-Position: refs/heads/master@{#297121}
* Revert of cc: Remove use of PassAs() and constructor-casting with ↵dcheng2014-09-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scoped_ptr. (patchset #6 id:120001 of https://codereview.chromium.org/609663003/) Reason for revert: scoped_ptr nullptr support needs to be reverted Original issue's description: > cc: Remove use of PassAs() and constructor-casting with scoped_ptr. > > Say you have class A and subclass B. > > Previously it was required to PassAs() a scoped_ptr<B> into a > scoped_ptr<A>. This is no longer needed, so just use Pass(). For newly > created scoped_ptrs, you can just use make_scoped_ptr always now. > > And when you want to return or assign an empty scoped_ptr(), you can > now use nullptr directly. > > Also adds PRESUBMIT checks for: > - return scoped<T>(foo). This should be return make_scoped_ptr(foo). > - bar = scoped<T>(foo). This should be return bar = make_scoped_ptr(foo). > - return scoped<T>(). This should be return nullptr. > - bar = scoped<T>(). This should be return bar = nullptr. > > This also replaces p.reset() with p = nullptr; But it does not add a > PRESUBMIT check for that because there are things other than scoped_ptr > with a reset() function. > > R=enne@chromium.org > > Committed: https://crrev.com/7bb3dbede19d87f0338797756ffd738adc6bca08 > Cr-Commit-Position: refs/heads/master@{#297096} TBR=enne@chromium.org,jamesr@chromium.org,vmpstr@chromium.org,danakj@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/608503005 Cr-Commit-Position: refs/heads/master@{#297106}
* cc: Remove use of PassAs() and constructor-casting with scoped_ptr.danakj2014-09-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Say you have class A and subclass B. Previously it was required to PassAs() a scoped_ptr<B> into a scoped_ptr<A>. This is no longer needed, so just use Pass(). For newly created scoped_ptrs, you can just use make_scoped_ptr always now. And when you want to return or assign an empty scoped_ptr(), you can now use nullptr directly. Also adds PRESUBMIT checks for: - return scoped<T>(foo). This should be return make_scoped_ptr(foo). - bar = scoped<T>(foo). This should be return bar = make_scoped_ptr(foo). - return scoped<T>(). This should be return nullptr. - bar = scoped<T>(). This should be return bar = nullptr. This also replaces p.reset() with p = nullptr; But it does not add a PRESUBMIT check for that because there are things other than scoped_ptr with a reset() function. R=enne@chromium.org Review URL: https://codereview.chromium.org/609663003 Cr-Commit-Position: refs/heads/master@{#297096}
* Plumb selection edge points through the compositorjdduke@chromium.org2014-08-221-26/+54
| | | | | | | | | | | | | | | Previously, a rect was used to convey selection bound edge geometry. This proved confusing and problematic, particularly for non-axis-aligned text. Instead, start using the bound edge points provided by Blink. This depends on the Blink change http://codereview.chromium.org/495673003/. BUG=405666 Review URL: https://codereview.chromium.org/494823002 Cr-Commit-Position: refs/heads/master@{#291460} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291460 0039d316-1c4b-4281-b951-d872f2087c98
* Keeping track of descendants that draw content instead of recalcualtingawoloszyn@chromium.org2014-08-111-25/+25
| | | | | | | | | | | This is a required for removing Render Surface creation from CalcDrawProps. BUG=386788 Review URL: https://codereview.chromium.org/373113003 Cr-Commit-Position: refs/heads/master@{#288740} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288740 0039d316-1c4b-4281-b951-d872f2087c98
* Add a UMA for the number of layers in a frame.dneto@chromium.org2014-07-141-0/+15
| | | | | | | | | | Reported from the compositor thread. BUG=253919 Review URL: https://codereview.chromium.org/375093002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282964 0039d316-1c4b-4281-b951-d872f2087c98
* Route selection bounds updates through the compositorjdduke@chromium.org2014-07-011-0/+249
| | | | | | | | | | | | | | | | | | | | | | | Currently, the selection bounds are queried at the start of each frame on the main thread. If the bounds differ from the previous bounds, an updated notification is sent to the browser. This approach is problematic for many reasons, the chief of which being the inability of such updates to remain in sync with content that is transformed on the compositor thread. Instead, plumb the selection bounds region through the compositor, anchoring each bound to the appropriate composited layer. This allows the compositor to generated transformed bounds synchronized with transformed content, passed to the browser with the CompositorFrameMetdadata. Note that this patch only implements the compositor portion of the plumbing. Enabling the feature in Blink and consuming the handle positions in the browser will be done in https://codereview.chromium.org/359033002. BUG=135959 Review URL: https://codereview.chromium.org/300323005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280858 0039d316-1c4b-4281-b951-d872f2087c98
* Rendering context information added to SharedQuadStatethildebr@chromium.org2014-06-191-3/+3
| | | | | | | | | Context IDs given to DrawQuads to identify when a rendering context changes, and whether or not a DrawQuad is in a 3D sorting context. Review URL: https://codereview.chromium.org/332873005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278288 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up PointIsClippedBySurfaceOrClipRectvollick@chromium.org2014-06-121-0/+138
| | | | | | | | | | | | | | | This function made unnecessary use of the render target and didn't walk its clipping ancestor chain correctly. This CL refactors the function and fixes that walk (and adds test to show that the walk is correct). R=danakj@chromium.org Review URL: https://codereview.chromium.org/328753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276799 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of graphics layer anchor points, and replace withchrishtr@chromium.org2014-06-051-84/+184
| | | | | | | | | | | | | | transform origin. This is the cc side change that listens to transform origin instead of anchor point. Blink is already populating both fields. BUG=372837 Review URL: https://codereview.chromium.org/295193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274990 0039d316-1c4b-4281-b951-d872f2087c98
* Remove hit-testing-only RSLL entriesvollick@chromium.org2014-05-151-104/+0
| | | | | | | | | | | | | | | | As of https://codereview.chromium.org/266913021/ we no longer hit test via the RSLL; we walk the tree instead. This means we can remove the machinery added to allow hidden layers to appear in the RSLL for hit testing purposes. This is essentially a revert of https://codereview.chromium.org/25712004 R=danakj@chromium.org BUG=None Review URL: https://codereview.chromium.org/289973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270742 0039d316-1c4b-4281-b951-d872f2087c98
* Hit test on the layer tree rather than the RSLLvollick@chromium.org2014-05-121-0/+1940
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