Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11731002: Implement a method to access the non-composited content root layer picture pile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 1717
1718 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1718 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1719 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1719 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1720 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1720 if (scrollbarController && scrollbarController->animate(monotonicTime))
1721 m_client->setNeedsRedrawOnImplThread(); 1721 m_client->setNeedsRedrawOnImplThread();
1722 1722
1723 for (size_t i = 0; i < layer->children().size(); ++i) 1723 for (size_t i = 0; i < layer->children().size(); ++i)
1724 animateScrollbarsRecursive(layer->children()[i], time); 1724 animateScrollbarsRecursive(layer->children()[i], time);
1725 } 1725 }
1726 1726
1727 // static
1728 LayerImpl* LayerTreeHostImpl::getNonCompositedContentRootLayerRecursive(LayerImp l* layer)
1729 {
1730 DCHECK(layer);
enne (OOO) 2013/01/03 23:55:30 The root layer could be null. I think it'd be bet
Leandro GraciĆ” Gil 2013/01/04 00:41:23 Done.
1731
1732 if (layer->drawsContent())
1733 return layer;
1734
1735 for (LayerImpl::LayerList::const_iterator it = layer->children().begin();
1736 it != layer->children().end(); ++it) {
1737 LayerImpl* nccr = getNonCompositedContentRootLayerRecursive(*it);
1738 if (nccr)
1739 return nccr;
1740 }
1741
1742 return NULL;
1743 }
1744
1745 scoped_refptr<PicturePileImpl> LayerTreeHostImpl::capturePicturePile()
1746 {
1747 // Non-composited content root is the first drawable picture layer we find
1748 // in a depth-first exploration from the root.
1749 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
1750 const LayerImpl* layer = getNonCompositedContentRootLayerRecursive(tree->Roo tLayer());
1751 return layer ? layer->GetPicturePileClone() : scoped_refptr<PicturePileImpl> ();
1752 }
1753
1727 } // namespace cc 1754 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698