summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_content_layer.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix transition from hardware to software compositing.ccameron@chromium.org2013-10-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | When the the LayerTreeHost's output surface changes, the capabilities of the renderer change. In particular, support for BGRA textures goes away when transitioning from hardware compositing to software compositing. The preferred texture format is cached by tiled layer types and isn't updated when the renderer's capabilities change, resulting in BGRA textures being requested for the new renderer that doesn't support them. Add a callback to all layers on output surface creation so they can update any cached values that they have. Also fix a bug where LayerTreeHostImpl::resource_provider_ was assumed to exist when getting a callback from the GPU memory manager, when in it may have already been destroyed. BUG=304384 NOTRY=true Review URL: https://codereview.chromium.org/26323002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227824 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Allow the main thread to cancel commitsenne@chromium.org2013-07-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new SetNeedsUpdateLayers that triggers the commit flow, but is abortable if update layers doesn't actually make any changes. This allows the main thread to abort a begin frame. This happens in the case of scroll updates from the compositor thread or invalidations. There was previously an abort begin frame call for when a visibility message and a begin frame message were posted simultaneously, but it incorrectly applied the scrolls and scales without informing the compositor thread that these had already been consumed. To fix this, the abort message passes back a boolean about whether or not the commit was aborted (and needed to be sent again) or was handled (and the scrolls and scales processed). To avoid a deluge of begin frames (in the commit sense) from the scheduler, the scheduler has been adjusted to wait until the next begin frame (in the vsync signal sense) so that these calls can be throttled. Otherwise, the scheduler will just keep trying to begin frame. R=brianderson@chromium.org, danakj@chromium.org BUG=256381 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213338 Review URL: https://chromiumcodereview.appspot.com/19106007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214314 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 213338 "cc: Allow the main thread to cancel commits"jochen@chromium.org2013-07-241-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broke WebViewInteractiveTest.EditCommandsNoMenu on Mac [1288:27139:0723/221703:FATAL:layer_impl.cc(286)] Check failed: TotalScrollOffset().y() <= max_scroll_offset_.y() (62 vs. 47) > cc: Allow the main thread to cancel commits > > Add a new SetNeedsUpdateLayers that triggers the commit flow, but is > abortable if update layers doesn't actually make any changes. This > allows the main thread to abort a begin frame. This happens in the case > of scroll updates from the compositor thread or invalidations. > > There was previously an abort begin frame call for when a visibility > message and a begin frame message were posted simultaneously, but it > incorrectly applied the scrolls and scales without informing the > compositor thread that these had already been consumed. To fix this, > the abort message passes back a boolean about whether or not the > commit was aborted (and needed to be sent again) or was handled > (and the scrolls and scales processed). > > To avoid a deluge of begin frames (in the commit sense) from the > scheduler, the scheduler has been adjusted to wait until the next begin > frame (in the vsync signal sense) so that these calls can be throttled. > Otherwise, the scheduler will just keep trying to begin frame. > > R=brianderson@chromium.org, danakj@chromium.org > BUG=256381 > > Review URL: https://chromiumcodereview.appspot.com/19106007 TBR=enne@chromium.org Review URL: https://codereview.chromium.org/19519019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213355 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Allow the main thread to cancel commitsenne@chromium.org2013-07-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new SetNeedsUpdateLayers that triggers the commit flow, but is abortable if update layers doesn't actually make any changes. This allows the main thread to abort a begin frame. This happens in the case of scroll updates from the compositor thread or invalidations. There was previously an abort begin frame call for when a visibility message and a begin frame message were posted simultaneously, but it incorrectly applied the scrolls and scales without informing the compositor thread that these had already been consumed. To fix this, the abort message passes back a boolean about whether or not the commit was aborted (and needed to be sent again) or was handled (and the scrolls and scales processed). To avoid a deluge of begin frames (in the commit sense) from the scheduler, the scheduler has been adjusted to wait until the next begin frame (in the vsync signal sense) so that these calls can be throttled. Otherwise, the scheduler will just keep trying to begin frame. R=brianderson@chromium.org, danakj@chromium.org BUG=256381 Review URL: https://chromiumcodereview.appspot.com/19106007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213338 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Early out in PushPropertiesTo tree walk for commit.danakj@chromium.org2013-07-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a subtree is not dirty, don't walk it doing PushPropertiesTo for all its layers. We know a layer needs PushPropertiesTo called on it when it requests SetNeedsCommit() for itself, as this implies it has some value to push across to the impl tree. If this has been called, it has nothing to push. There are exceptions to this rule for some layers: 1) tiled layer - Occlusion can be affected by changes anywhere in the tree, and this changes what the layer chooses to push. 2) scrollbar layer crbug.com/259095 - Resources for the impl thread are chosen by the main thread, and this must be done every commit in order to deal with situations like lost context. 3) picture layer crbug.com/259402 - SyncFromActiveTree needs to be done every commit. This could potentially be resolved. 4) delegated renderer layer crbug.com/259090 - Resources returned from the parent compositor must be returned to the main thread currently, and this is done during push properties. 5) any layer with an animation crbug.com/259088 - Animations that complete on the impl thread are cleaned up on the main thread by the next push properties on the animating layer. This could be avoided by doing this cleanup in another place during commit. Tested by: LayerTreeHostTestLayersPushProperties LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild LayerTreeHostTestPropertyChangesDuringUpdateArePushed This adds a new perftest: LayerTreeHostPerfTestLeafInvalidates.TenTenSingleThread The test is basically the original TenTenSingleThread test, but it toggles a property on a leaf node in the layer tree (the first node in a pre-order walk) every commit to cause some push properties to still happen. Perf test results are as follows. BEFORE: LayerTreeHostPerfTestJsonReader.TenTenSingleThread *RESULT 10_10_layer_tree: frames: 5725, 0.35 ms/frame LayerTreeHostPerfTestJsonReader.TenTenSingleThread_FullDamageEachFrame *RESULT 10_10_layer_tree: frames: 4505, 0.44 ms/frame crollingLayerTreePerfTest.LongScrollablePage *RESULT long_scrollable_page: frames: 22045, 0.09 ms/frame ImplSidePaintingPerfTest.HeavyPage *RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame *RESULT heavy_layer_tree: commits: 406, 0.58 ms/commit PageScaleImplSidePaintingPerfTest.HeavyPage *RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame *RESULT heavy_layer_tree: commits: 406, 0.74 ms/commit LayerTreeHostPerfTestLeafInvalidates.TenTenSingleThread *RESULT 10_10_layer_tree: frames: 4095, 0.49 ms/frame AFTER: LayerTreeHostPerfTestJsonReader.TenTenSingleThread *RESULT 10_10_layer_tree: frames: 6635, 0.30 ms/frame LayerTreeHostPerfTestJsonReader.TenTenSingleThread_FullDamageEachFrame *RESULT 10_10_layer_tree: frames: 5035, 0.40 ms/frame ScrollingLayerTreePerfTest.LongScrollablePage *RESULT long_scrollable_page: frames: 22225, 0.09 ms/frame ImplSidePaintingPerfTest.HeavyPage *RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame *RESULT heavy_layer_tree: commits: 406, 0.57 ms/commit PageScaleImplSidePaintingPerfTest.HeavyPage *RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame *RESULT heavy_layer_tree: commits: 406, 0.75 ms/commit LayerTreeHostPerfTestLeafInvalidates.TenTenSingleThread *RESULT 10_10_layer_tree: frames: 4505, 0.44 ms/frame This is a perf change only, there should be no change in behaviour. BUG=177756 Review URL: https://chromiumcodereview.appspot.com/12340033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211576 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Make Layer::Update return a boolenne@chromium.org2013-07-081-2/+3
| | | | | | | | | | | | | | | | | | | As part of an optimization to prevent needless commits, add a return value from Update to say whether or not any resources were updated as a part of the call. Other layer property updates (bounds changes, etc) that happen during Update are covered through the normal SetNeedsCommit mechanism. This will allow a future patch to make SetNeedsDisplay/SetScrollOffsetFromImplThread only cause an update but not necessarily cause a commit. R=danakj@chromium.org BUG=256381 Review URL: https://chromiumcodereview.appspot.com/18454003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210424 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Remove RenderingStats passed to Layer::Update()egraether@chromium.org2013-06-291-3/+2
| | | | | | | | | | | depends on: https://codereview.chromium.org/13245007/ and: https://codereview.chromium.org/13132005/ BUG=181319 Review URL: https://chromiumcodereview.appspot.com/13258003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209251 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 191086 "cc: Switch RenderingStats collection in Layer::Up..."danakj@chromium.org2013-03-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | Looks like its DCHECKing on Win Aura interactive_ui_tests again. Same error as before. http://build.chromium.org/p/chromium.win/buildstatus?builder=Win%20Aura%20Tests%20%283%29&number=2148 > cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation > > This change switches all of the remaining RenderingStats collection in > composited mode to use RenderinStatsInstrumentation. > > BUG=181319 > > > Review URL: https://chromiumcodereview.appspot.com/12426024 TBR=egraether@chromium.org Review URL: https://codereview.chromium.org/13145002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191101 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Switch RenderingStats collection in Layer::Update() to ↵egraether@chromium.org2013-03-281-3/+2
| | | | | | | | | | | | | | RenderingStatsInstrumentation This change switches all of the remaining RenderingStats collection in composited mode to use RenderinStatsInstrumentation. BUG=181319 Review URL: https://chromiumcodereview.appspot.com/12426024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191086 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 190817 "cc: Switch RenderingStats collection in Layer::Up..."hashimoto@chromium.org2013-03-271-2/+3
| | | | | | | | | | | | | | | | | > cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation > > This change switches all of the remaining RenderingStats collection in > composited mode to use RenderinStatsInstrumentation. > > BUG=181319 > > > Review URL: https://chromiumcodereview.appspot.com/12426024 TBR=egraether@chromium.org Review URL: https://codereview.chromium.org/13117002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190826 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Switch RenderingStats collection in Layer::Update() to ↵egraether@chromium.org2013-03-271-3/+2
| | | | | | | | | | | | | | RenderingStatsInstrumentation This change switches all of the remaining RenderingStats collection in composited mode to use RenderinStatsInstrumentation. BUG=181319 Review URL: https://chromiumcodereview.appspot.com/12426024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190817 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Chromify PrioritizedResourceenne@chromium.org2013-03-201-1/+1
| | | | | | | | | | R=danakj@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/12906008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189241 0039d316-1c4b-4281-b951-d872f2087c98
* Part 8 of cc/ directory shuffles: resourcesjamesr@chromium.org2013-03-181-1/+1
| | | | | | | | | | | Continuation of https://src.chromium.org/viewvc/chrome?view=rev&revision=188681 BUG=190824 TBR=enne@chromium.org, piman@chromium.org, jschuh@chromium.org Review URL: https://codereview.chromium.org/12471007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188696 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Chromify TiledLayerenne@chromium.org2013-03-141-1/+1
| | | | | | | | | | R=danakj@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/12811007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188022 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Chromify fake test layersenne@chromium.org2013-03-131-5/+4
| | | | | | | | | | | | | Some minor changes mostly to remove /^public:/ matches so these don't get listed as being unformatted. R=danakj@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/12413019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187833 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Chromify Layer and LayerImpl classes.danakj@chromium.org2013-03-121-8/+8
| | | | | | | | | | | | Style-only change. Bring the Layer and LayerImpl classes into the Chromium style. R=enne,piman,jamesr TBR=joth Review URL: https://chromiumcodereview.appspot.com/12774006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187555 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Avoid expensive RenderingStats collection.danakj@chromium.org2013-02-021-1/+1
| | | | | | | | | | | | | | | When --enable-gpu-benchmarking is not present, don't do expensive steps in the benchmark collection (meaning don't call base::TimeTicks::Now()). BUG=170735 NOTRY=true Depends on: https://bugs.webkit.org/show_bug.cgi?id=108358 Review URL: https://chromiumcodereview.appspot.com/12095053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180224 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Put context-loss tests in layer_tree_host_unittest_context.ccdanakj@chromium.org2013-01-041-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests cover all of the cases covered by the context loss layout test and more. It also provides full coverage both in single-thread and multi-thread modes. I've moved tests from LayerTreeHostTests as usual, but also tests from LayerTreeHostImplTests, and implemented them using the real commit flow, instantiating layers by making the main thread versions of the layers, etc. This makes for a much more realistic test, and doesn't rely on as much internal compositor knowledge. While digging around, I found that the layersFreeTextures test was not testing anything. Then I also noticed that most of the layers in the test are not actually responsible to free their resources when they disappear. So I made the test do its job, and made the test just check layers that own resources - namely IOSurface and Video layers. Tests: LayerTreeHostContextTestLostContextSucceeds.runSingleThread LayerTreeHostContextTestLostContextSucceeds.runMultiThread LayerTreeHostContextTestLostContextSucceedsWithContent.NoSurface_SingleThread LayerTreeHostContextTestLostContextSucceedsWithContent.NoSurface_MultiThread LayerTreeHostContextTestLostContextSucceedsWithContent.WithSurface_SingleThread LayerTreeHostContextTestLostContextSucceedsWithContent.WithSurface_MultiThread LayerTreeHostContextTestLostContextFails.RepeatLoss100_SingleThread LayerTreeHostContextTestLostContextFails.RepeatLoss100_MultiThread LayerTreeHostContextTestLostContextFails.FailRecreate100_SingleThread LayerTreeHostContextTestLostContextFails.FailRecreate100_MultiThread LayerTreeHostContextTestFinishAllRenderingAfterLoss.runSingleThread LayerTreeHostContextTestFinishAllRenderingAfterLoss.runMultiThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseAfterEvict_SingleThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseAfterEvict_MultiThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseBeforeEvict_SingleThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseBeforeEvict_MultiThread LayerTreeHostContextTestLostContextWhileUpdatingResources.runSingleThread LayerTreeHostContextTestLostContextWhileUpdatingResources.runMultiThread LayerTreeHostContextTestLayersNotified.runSingleThread LayerTreeHostContextTestLayersNotified.runMultiThread LayerTreeHostContextTestDontUseLostResources.runSingleThread LayerTreeHostContextTestDontUseLostResources.runMultiThread Review URL: https://chromiumcodereview.appspot.com/11662003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175080 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Move more animation tests to layer_tree_host_unittests_animation.ccdanakj@chromium.org2012-12-191-0/+27
Created FakeContentLayer to replace ContentLayerWithUpdateTracking. R=enne,jamesr Review URL: https://codereview.chromium.org/11640006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173873 0039d316-1c4b-4281-b951-d872f2087c98