summaryrefslogtreecommitdiffstats
path: root/cc/layer_impl_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* cc: Make updateDrawProperties tree-specificenne@chromium.org2013-01-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, setNeedsUpdateDrawProperties and updateDrawProperties applied to both the pending tree and the active tree. For example, on frames with a commit and an activation, there could be three updateDrawProperties (two from the commit and one on the newly activated active tree). There's no need for the extra active tree update on commit. Along with making the update tree-specific, this patch also splits out when updateDrawProperties is called on each tree. The pending tree is updated immediately post-commit (to create tilings) and then during each tick that it tries to activate. The active tree (as before) is updated immediately prior to drawing. A number of redundant setNeedsUpdateDrawProperties calls were removed from LayerTreeHostImpl, in favor of letting functions like LayerTreeHostImpl::setScaleDelta and LayerImpl::setScrollDelta do it themselves, as they are already doing. R=danakj@chromium.org BUG=171826 Review URL: https://chromiumcodereview.appspot.com/12040067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178695 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add pending tree for impl-side paintingenne@chromium.org2012-12-201-0/+2
| | | | | | | | | | | | Do tree synchronization to pending tree. Inform scheduler when there is a pending tree so that vsync can continue to be scheduled. Right now everything is hooked through redraw, so canDraw is true when there is a pending tree, prepareToDraw is the one that checks for tree swap, and TileManager::DidFinishTileInitialization ends up calling setNeedsRedraw. I'm not sure this is ideal, but it's a start. BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11569040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174089 0039d316-1c4b-4281-b951-d872f2087c98
* [cc] Fold more update calls into updateDrawProperties nduca@chromium.org2012-12-191-3/+6
| | | | | | | | | | | | | | (Reland of https://codereview.chromium.org/11529006/) Now that we have a clean update system, we can remove the manual calling of updateRootScrollLayerImplTransform and other similar kinds of "I'm going to do something manually in a half dozen places because I can." This removes some surface area on LTHI which helps with the LTHI->LTI push. BUG=155209 TBR=enne Review URL: https://chromiumcodereview.appspot.com/11573069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173820 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up cc and webkit/compositor_bindings include path shenanigansjamesr@chromium.org2012-12-181-2/+2
| | | | | | | | | | | | | | | | | This removes various include issues in cc/ and webkit/compositor_bindings/ to normalize this code to chromium standards and make webkit/compositor_bindings/ more easily usable. Changes include: 1.) Removing dead stub / test headers and include paths 2.) Removing complex rules designed to make the incantation '#include <public/WebBlah.h>' work since all chromium code can do '#include "third_party/WebKit/Source/Platform/chromium/public/WebBlah.h"' 3.) Expand out WebKit API includes and sort correctly BUG=144577 Review URL: https://codereview.chromium.org/11615020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173799 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 173406 - Crashes on Win & Macrsleevi@chromium.org2012-12-171-6/+3
| | | | | | | | | | | | | | | | | | [cc] Fold more update calls into updateDrawProperties Now that we have a clean update system, we can remove the manual calling of updateRootScrollLayerImplTransform and other similar kinds of "I'm going to do something manually in a half dozen places because I can." This removes some surface area on LTHI which helps with the LTHI->LTI push. BUG=155209 R=enne,skyostil Review URL: https://chromiumcodereview.appspot.com/11529006 TBR=nduca@chromium.org Review URL: https://codereview.chromium.org/11596005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173407 0039d316-1c4b-4281-b951-d872f2087c98
* [cc] Fold more update calls into updateDrawPropertiesnduca@chromium.org2012-12-171-3/+6
| | | | | | | | | | | | | Now that we have a clean update system, we can remove the manual calling of updateRootScrollLayerImplTransform and other similar kinds of "I'm going to do something manually in a half dozen places because I can." This removes some surface area on LTHI which helps with the LTHI->LTI push. BUG=155209 R=enne,skyostil Review URL: https://chromiumcodereview.appspot.com/11529006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173406 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add id->LayerImpl map to LayerTreeImplenne@chromium.org2012-12-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a prerequisite to two LayerTreeImpls, as PictureLayerImpls in the active tree may need to ask about their pending tree sibilings with the same id. Once this lands, functionality like findScrollingLayerbyId can be wrapped into this too. LayerImpl now registers itself with its tree on creation and destruction. As there are now asserts that a given id is not already in use, a number of tests have been updated to not duplicate layer ids. There doesn't technically need to be an unregister step, but as LayerImpl doesn't necessarily have to be in the LayerImpl tree rooted in the LayerTreeImpl, this unregister check will blow up if anybody has a layer outliving their registered tree (which is bad). As LayerImpl has single ownership, it's impossible to assign the same non-NULL replica or mask to a layer, so the LayerImpl unit tests are updated to not test this anymore. Masks and replicas are also modified to keep their id in sync with their pointer during tree synchronization to prevent asserts about duplicate ids. R=danakj@chromium.org BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11575018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173110 0039d316-1c4b-4281-b951-d872f2087c98
* Mark layers that can use LCD text based on layer transform and opacity.alokp@chromium.org2012-12-131-1/+0
| | | | | | | | | | | | | - Text AA settings are not adjusted during animation to avoid repaints. - Renamed Layer::useLCDText to Layer::canUseLCDText. BUG=100666 Review URL: https://chromiumcodereview.appspot.com/11360093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172842 0039d316-1c4b-4281-b951-d872f2087c98
* [cc] Make LayerImpls point at LayerTreeImpl instead of LTHInduca@chromium.org2012-12-111-10/+10
| | | | | | | | | | BUG=155209 R=enne@chromium.org NOTRY=True Review URL: https://chromiumcodereview.appspot.com/11519018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172411 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Split out calcDrawEtc from drawLayersenne@chromium.org2012-12-091-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, calcDrawEtc was coupled to drawLayers. Immediately before drawing, it would get called to update layer state based on any impl-side input that came in after the commit. Impl-side painting needs to update layer transforms / visible content rect state prior to rasterizing contents. And, if input comes in, it might also need to re-update prior to drawing. LayerTreeHostImpl then gets a needsUpdateLayers() flag, and updateLayers() (which calls calcDraw) is a no-op if nothing has changed on the tree. Additionally, the calculate render surface layer list is persisted since the last updateLayers() call. The LayerTreeHostImpl now sets the needsUpdate flag after commit, scroll, pinch zoom, and animation. These are the easy ones. Unfortunately, this creates an amazing foot gun where you can manipulate the impl tree on the impl thread and updateLayers won't get called, because the needsUpdate flag hasn't been called explicitly. This mostly happens in tests, but could happen elsewhere. To fix this, setFoo calls on LayerImpl now calls setNeedsUpdate() on its host. BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11447028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172005 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Pass LayerTreeHostImpl to LayerImpl constructorenne@chromium.org2012-12-071-5/+9
| | | | | | | | | | | | | | | In order to allow for LayerImpl to notify its host when one of its property changes, it needs to more robustly have its host set (which is not the case in most tests). To avoid a recursive pass when adding children or after layer synchronization, instead just pass it to the constructor of LayerImpl, since a given LayerImpl will never move from one host to another. NOTRY=true BUG=none Review URL: https://chromiumcodereview.appspot.com/11472021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171830 0039d316-1c4b-4281-b951-d872f2087c98
* Organize internal properties of cc/ layer typesshawnsingh@google.com2012-12-051-6/+0
| | | | | | | | | | | | | One useful way to classify the various properties in cc/ layer data types is: (1) properties given by the user of the cc APIs, and (2) properties that are computed inside of cc code that are needed to correctly draw the layers. This patch organizes properties internally so that as we develop cc code, we are forced to be aware of whether a property is "given" or "computed". Review URL: https://codereview.chromium.org/11280263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171323 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Use skia::RefPtr in place of raw pointers and SkAutoTUnref.danakj@chromium.org2012-12-041-1/+1
| | | | | | | | | | | | | Safe reference counting for skia objects ahoy! R=jamesr BUG=163454 Depends on: https://codereview.chromium.org/11418217/ NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11412255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170889 0039d316-1c4b-4281-b951-d872f2087c98
* Animation code is not yet migrated by this patch, due to WebTransformOperations.shawnsingh@chromium.org2012-11-271-2/+2
| | | | | | | | BUG=159972 Review URL: https://codereview.chromium.org/11308153 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169609 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Add support for debugging layer borders directly in the compositordanakj@chromium.org2012-11-151-4/+0
| | | | | | | | | | | | | | | Instead of supporting --show-composited-layer-borders via the GraphicsLayer debug borders mechanism, show debug borders on layers when the new LayerTreeSetting flag showDebugBorders is enabled. This depends on https://bugs.webkit.org/show_bug.cgi?id=102130 BUG=159769 R=jamesr,enne Review URL: https://chromiumcodereview.appspot.com/11365239 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167815 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove forbidden using namespace directives.tfarina@chromium.org2012-11-101-2/+3
| | | | | | | | | | | BUG=144576,144577 TEST=cc_unittests R=enne@chromium.org,jamesr@chromium.org,danakj@chromium.org Review URL: https://chromiumcodereview.appspot.com/11410022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167073 0039d316-1c4b-4281-b951-d872f2087c98
* Remove WTF and WebCore from cc/ and webkit/compositor_bindings/piman@chromium.org2012-11-101-2/+0
| | | | | | | | | | | Ding, dong... BUG=154451 Review URL: https://chromiumcodereview.appspot.com/11410021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167071 0039d316-1c4b-4281-b951-d872f2087c98
* Remove static thread pointers from CC, attempt 3aelias@chromium.org2012-11-081-2/+0
| | | | | | | | BUG=152904 Review URL: https://chromiumcodereview.appspot.com/11232051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166627 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove all remaining use of WebCore Rect/Point/Size types from the ↵danakj@chromium.org2012-11-051-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | compositor. This change removes all IntPoint/FloatRect/IntSize/etc from the compositor. There remains an indirect dependency on these types through the WebCore::Region class, which we wrap but need to replace. However, the wrapper there hides the WebCore types inside it, so there are now no references to the types from anywhere else in the compositor. I went back and forth on how to deal with scroll "positions". The name suggested that they should be Points, and that the deltas should be Vectors. However this lent itself to super awkward math at times. In the end, it was much cleaner to make all scroll "positions" into scroll "offsets" and represent everything as Vectors. Covered by existing tests; no change in behaviour. R=enne BUG=147395 Relanding: https://codereview.chromium.org/11367080/ Review URL: https://codereview.chromium.org/11366089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166027 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Fix style for comments at the end of namespacesdanakj@chromium.org2012-11-051-1/+1
| | | | | | | | | | | | Make sure we have a comment at the end of the namespace for each .cc file and that there are two spaces between the closing brace and the comment. R=enne Review URL: https://chromiumcodereview.appspot.com/11275153 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166005 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "cc: Remove all remaining use of WebCore Rect/Point/Size types from ↵phajdan.jr@chromium.org2012-11-051-7/+6
| | | | | | | | the compositor." This reverts commit a76cb24ab8de742f70b83f6c045c2c23545eaae7. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165949 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove all remaining use of WebCore Rect/Point/Size types from the ↵danakj@chromium.org2012-11-051-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | compositor. This change removes all IntPoint/FloatRect/IntSize/etc from the compositor. There remains an indirect dependency on these types through the WebCore::Region class, which we wrap but need to replace. However, the wrapper there hides the WebCore types inside it, so there are now no references to the types from anywhere else in the compositor. I went back and forth on how to deal with scroll "positions". The name suggested that they should be Points, and that the deltas should be Vectors. However this lent itself to super awkward math at times. In the end, it was much cleaner to make all scroll "positions" into scroll "offsets" and represent everything as Vectors. Covered by existing tests; no change in behaviour. R=enne BUG=147395 Review URL: https://codereview.chromium.org/11367080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165947 0039d316-1c4b-4281-b951-d872f2087c98
* A speculative Revert for r165872 - Remove static thread pointers from CC, ↵hbono@chromium.org2012-11-051-0/+2
| | | | | | | | | | | | | attempt 2 BUG=152904 Review URL: https://chromiumcodereview.appspot.com/11232051 TBR=aelias@chromium.org Review URL: https://codereview.chromium.org/11369071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165907 0039d316-1c4b-4281-b951-d872f2087c98
* Remove static thread pointers from CC, attempt 2aelias@chromium.org2012-11-041-2/+0
| | | | | | | | BUG=152904 Review URL: https://chromiumcodereview.appspot.com/11232051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165872 0039d316-1c4b-4281-b951-d872f2087c98
* Remove most remaining references to IntRect and FloatRect.danakj@chromium.org2012-11-011-23/+23
| | | | | | | | | | | | | | | | The remaining uses are: - Dealing with the output of Region::rects() which gives a vector of WebCore::IntRects. - Using FloatRect::isExpressibleAsIntRect. Covered by existing tests; no new behaviour. BUG=147395 R=enne Review URL: https://codereview.chromium.org/11275113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165542 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 165476 - Remove static thread pointers from CCjamesr@chromium.org2012-11-011-0/+2
| | | | | | | | | | | | Might be causing webkit_unit_tests to fail on mac/win BUG=152904 Review URL: https://codereview.chromium.org/11232051 TBR=jamesr@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165501 0039d316-1c4b-4281-b951-d872f2087c98
* Remove static thread pointers from CCjamesr@chromium.org2012-11-011-2/+0
| | | | | | | | BUG=152904 Review URL: https://codereview.chromium.org/11232051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165476 0039d316-1c4b-4281-b951-d872f2087c98
* Pass accurate contentsScale to LayerImpl.wangxianzhu@chromium.org2012-11-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first part of fixing fuzzy content issue in composited layers in scaled pages. There are two reasons of fuzzy content: 1) Inaccurate scale: The scale in transformation is calculated with contentBounds.width / bounds.width contentBounds.height / bounds.height in layer_tree_host_common.cc and other places. However, contentBounds is a IntSize which is calculated from bounds and contentsScale in layer.cc: IntRect(lroundf(bounds.width * contentsScale), lroundf(bounds.height * contentsScale)) This causes the scale like 0.993 or 1.007 in the drawTransformation etc. where identity transformation is expected. To resolve the issue, instead of calculating scale using contentBounds, pass the accurate contentsScale from Layer to LayerImpl. 2) Pixel on surfaces are not aligned. Will describe this in the CL for the second part. (See https://bugs.webkit.org/show_bug.cgi?id=84187 for more details). Change-Id: I8f59f0460e1b212223e2c8c551b4127d8239e5cc BUG=bugs.webkit.org/show_bug.cgi?id=84187 TEST=ContentsScalingLayerTest.checkContentBounds, LayerTreeHostCommonTest.verifyLayerTransformsInHighDPIAccurateScaleZeroPosition, LayerTreeHostCommonTest.verifyRenderSurfaceTransformsInHighDPIAccurateScaleZeroPosition Review URL: https://chromiumcodereview.appspot.com/11276060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165269 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SkImageFilter support in the compositor.senorblanco@chromium.org2012-10-231-0/+4
| | | | | | Review URL: https://chromiumcodereview.appspot.com/11175009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163507 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove CC*.h temporary includes, part 5/4.tfarina@chromium.org2012-10-231-1/+1
| | | | | | | | | | | | BUG=155413 TEST=cc_unittests R=enne@chromium.org,jamesr@chromium.org TBR=jamesr@chromium.org Review URL: https://chromiumcodereview.appspot.com/11225040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163479 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Rename cc classes and members to match filenamesenne@chromium.org2012-10-221-9/+9
| | | | | | | | | | | Fixed reland of https://chromiumcodereview.appspot.com/11189043/ TBR=jam@chromium.org,jamesr@chromium.org BUG=155413 Review URL: https://codereview.chromium.org/11231054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163429 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "cc: Rename cc classes and members to match filenames"enne@chromium.org2012-10-191-9/+9
| | | | | | This reverts commit 184fac5add06d5f4670fa6be4a4d3b39232d51bb. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163059 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Rename cc classes and members to match filenamesenne@chromium.org2012-10-191-9/+9
| | | | | | | | BUG=155413 Review URL: https://codereview.chromium.org/11189043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163052 0039d316-1c4b-4281-b951-d872f2087c98
* Reland "cc: Remove CC*.h temporary includes, part 1/4."tfarina@chromium.org2012-10-191-1/+1
| | | | | | | | | | | | | | | | Exception: Missing input files: c:\b\build\slave\cr-win-rel\build\src\cc\CCTextureUpdateQueue.h Relanding with this file removed as well. BUG=155413 TEST=cc_unittests TBR=enne@chromium.org Review URL: https://chromiumcodereview.appspot.com/11227005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163028 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r162986 "cc: Remove CC*.h temporary includes, part 1/4."pfeldman@chromium.org2012-10-191-1/+1
| | | | | | | Build fails with "gclient hooks failed" error. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162988 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove CC*.h temporary includes, part 1/4.tfarina@chromium.org2012-10-191-1/+1
| | | | | | | | | | | BUG=155413 TEST=cc_unittests R=enne@chromium.org Review URL: https://chromiumcodereview.appspot.com/11189076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162986 0039d316-1c4b-4281-b951-d872f2087c98
* [cc] Change cc_tests.gyp filenames to Chromium styleenne@chromium.org2012-10-121-0/+160
BUG=155413 Review URL: https://codereview.chromium.org/11108020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161642 0039d316-1c4b-4281-b951-d872f2087c98