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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2168753002: cc : Use sublayer scale from effect tree (4) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 // If ProjectPoint could not project to a valid value, then we assume that 1671 // If ProjectPoint could not project to a valid value, then we assume that
1672 // this point doesn't hit this region. 1672 // this point doesn't hit this region.
1673 if (clipped) 1673 if (clipped)
1674 return false; 1674 return false;
1675 1675
1676 return layer_space_region.Contains( 1676 return layer_space_region.Contains(
1677 gfx::ToRoundedPoint(hit_test_point_in_layer_space)); 1677 gfx::ToRoundedPoint(hit_test_point_in_layer_space));
1678 } 1678 }
1679 1679
1680 static const gfx::Transform SurfaceScreenSpaceTransform( 1680 static const gfx::Transform SurfaceScreenSpaceTransform(
1681 const LayerImpl* layer, 1681 const LayerImpl* layer) {
1682 const TransformTree& transform_tree) { 1682 const PropertyTrees* property_trees =
1683 layer->layer_tree_impl()->property_trees();
1683 DCHECK(layer->render_surface()); 1684 DCHECK(layer->render_surface());
1684 return layer->is_drawn_render_surface_layer_list_member() 1685 return layer->is_drawn_render_surface_layer_list_member()
1685 ? layer->render_surface()->screen_space_transform() 1686 ? layer->render_surface()->screen_space_transform()
1686 : transform_tree.ToScreenSpaceTransformWithoutSurfaceContentsScale( 1687 : property_trees
1687 layer->render_surface()->TransformTreeIndex()); 1688 ->ToScreenSpaceTransformWithoutSurfaceContentsScale(
1689 layer->render_surface()->TransformTreeIndex(),
1690 layer->render_surface()->EffectTreeIndex());
1688 } 1691 }
1689 1692
1690 static bool PointIsClippedByAncestorClipNode( 1693 static bool PointIsClippedByAncestorClipNode(
1691 const gfx::PointF& screen_space_point, 1694 const gfx::PointF& screen_space_point,
1692 const LayerImpl* layer, 1695 const LayerImpl* layer) {
1693 const ClipTree& clip_tree,
1694 const TransformTree& transform_tree) {
1695 // We need to visit all ancestor clip nodes to check this. Checking with just 1696 // We need to visit all ancestor clip nodes to check this. Checking with just
1696 // the combined clip stored at a clip node is not enough because parent 1697 // the combined clip stored at a clip node is not enough because parent
1697 // combined clip can sometimes be smaller than current combined clip. This can 1698 // combined clip can sometimes be smaller than current combined clip. This can
1698 // happen when we have transforms like rotation that inflate the combined 1699 // happen when we have transforms like rotation that inflate the combined
1699 // clip's bounds. Also, the point can be clipped by the content rect of an 1700 // clip's bounds. Also, the point can be clipped by the content rect of an
1700 // ancestor render surface. 1701 // ancestor render surface.
1701 1702
1702 // We first check if the point is clipped by viewport. 1703 // We first check if the point is clipped by viewport.
1704 const PropertyTrees* property_trees =
1705 layer->layer_tree_impl()->property_trees();
1706 const ClipTree& clip_tree = property_trees->clip_tree;
1707 const TransformTree& transform_tree = property_trees->transform_tree;
1703 const ClipNode* clip_node = clip_tree.Node(1); 1708 const ClipNode* clip_node = clip_tree.Node(1);
1704 gfx::Rect combined_clip_in_target_space = 1709 gfx::Rect combined_clip_in_target_space =
1705 gfx::ToEnclosingRect(clip_node->combined_clip_in_target_space); 1710 gfx::ToEnclosingRect(clip_node->combined_clip_in_target_space);
1706 if (!PointHitsRect(screen_space_point, gfx::Transform(), 1711 if (!PointHitsRect(screen_space_point, gfx::Transform(),
1707 combined_clip_in_target_space, NULL)) 1712 combined_clip_in_target_space, NULL))
1708 return true; 1713 return true;
1709 1714
1710 for (const ClipNode* clip_node = clip_tree.Node(layer->clip_tree_index()); 1715 for (const ClipNode* clip_node = clip_tree.Node(layer->clip_tree_index());
1711 clip_node->id > 1; clip_node = clip_tree.parent(clip_node)) { 1716 clip_node->id > 1; clip_node = clip_tree.parent(clip_node)) {
1712 if (clip_node->applies_local_clip) { 1717 if (clip_node->applies_local_clip) {
1713 const TransformNode* transform_node = 1718 const TransformNode* transform_node =
1714 transform_tree.Node(clip_node->target_transform_id); 1719 transform_tree.Node(clip_node->target_transform_id);
1715 gfx::Rect combined_clip_in_target_space = 1720 gfx::Rect combined_clip_in_target_space =
1716 gfx::ToEnclosingRect(clip_node->combined_clip_in_target_space); 1721 gfx::ToEnclosingRect(clip_node->combined_clip_in_target_space);
1717 1722
1718 const LayerImpl* target_layer = 1723 const LayerImpl* target_layer =
1719 layer->layer_tree_impl()->LayerById(transform_node->owner_id); 1724 layer->layer_tree_impl()->LayerById(transform_node->owner_id);
1720 DCHECK(transform_node->id == 0 || target_layer->render_surface() || 1725 DCHECK(transform_node->id == 0 || target_layer->render_surface() ||
1721 layer->layer_tree_impl()->is_in_resourceless_software_draw_mode()); 1726 layer->layer_tree_impl()->is_in_resourceless_software_draw_mode());
1722 gfx::Transform surface_screen_space_transform = 1727 gfx::Transform surface_screen_space_transform =
1723 transform_node->id == 0 || 1728 transform_node->id == 0 ||
1724 (layer->layer_tree_impl() 1729 (layer->layer_tree_impl()
1725 ->is_in_resourceless_software_draw_mode()) 1730 ->is_in_resourceless_software_draw_mode())
1726 ? gfx::Transform() 1731 ? gfx::Transform()
1727 : SurfaceScreenSpaceTransform(target_layer, transform_tree); 1732 : SurfaceScreenSpaceTransform(target_layer);
1728 if (!PointHitsRect(screen_space_point, surface_screen_space_transform, 1733 if (!PointHitsRect(screen_space_point, surface_screen_space_transform,
1729 combined_clip_in_target_space, NULL)) { 1734 combined_clip_in_target_space, NULL)) {
1730 return true; 1735 return true;
1731 } 1736 }
1732 } 1737 }
1733 const LayerImpl* clip_node_owner = 1738 const LayerImpl* clip_node_owner =
1734 layer->layer_tree_impl()->LayerById(clip_node->owner_id); 1739 layer->layer_tree_impl()->LayerById(clip_node->owner_id);
1735 if (clip_node_owner->render_surface() && 1740 if (clip_node_owner->render_surface() &&
1736 !PointHitsRect( 1741 !PointHitsRect(
1737 screen_space_point, 1742 screen_space_point, SurfaceScreenSpaceTransform(clip_node_owner),
1738 SurfaceScreenSpaceTransform(clip_node_owner, transform_tree),
1739 clip_node_owner->render_surface()->content_rect(), NULL)) { 1743 clip_node_owner->render_surface()->content_rect(), NULL)) {
1740 return true; 1744 return true;
1741 } 1745 }
1742 } 1746 }
1743 return false; 1747 return false;
1744 } 1748 }
1745 1749
1746 static bool PointIsClippedBySurfaceOrClipRect( 1750 static bool PointIsClippedBySurfaceOrClipRect(
1747 const gfx::PointF& screen_space_point, 1751 const gfx::PointF& screen_space_point,
1748 const LayerImpl* layer, 1752 const LayerImpl* layer) {
1749 const TransformTree& transform_tree,
1750 const ClipTree& clip_tree) {
1751 // Walk up the layer tree and hit-test any render_surfaces and any layer 1753 // Walk up the layer tree and hit-test any render_surfaces and any layer
1752 // clip rects that are active. 1754 // clip rects that are active.
1753 return PointIsClippedByAncestorClipNode(screen_space_point, layer, clip_tree, 1755 return PointIsClippedByAncestorClipNode(screen_space_point, layer);
1754 transform_tree);
1755 } 1756 }
1756 1757
1757 static bool PointHitsLayer(const LayerImpl* layer, 1758 static bool PointHitsLayer(const LayerImpl* layer,
1758 const gfx::PointF& screen_space_point, 1759 const gfx::PointF& screen_space_point,
1759 float* distance_to_intersection, 1760 float* distance_to_intersection) {
1760 const TransformTree& transform_tree,
1761 const ClipTree& clip_tree) {
1762 gfx::Rect content_rect(layer->bounds()); 1761 gfx::Rect content_rect(layer->bounds());
1763 if (!PointHitsRect(screen_space_point, layer->ScreenSpaceTransform(), 1762 if (!PointHitsRect(screen_space_point, layer->ScreenSpaceTransform(),
1764 content_rect, distance_to_intersection)) { 1763 content_rect, distance_to_intersection)) {
1765 return false; 1764 return false;
1766 } 1765 }
1767 1766
1768 // At this point, we think the point does hit the layer, but we need to walk 1767 // At this point, we think the point does hit the layer, but we need to walk
1769 // up the parents to ensure that the layer was not clipped in such a way 1768 // up the parents to ensure that the layer was not clipped in such a way
1770 // that the hit point actually should not hit the layer. 1769 // that the hit point actually should not hit the layer.
1771 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer, 1770 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer))
1772 transform_tree, clip_tree))
1773 return false; 1771 return false;
1774 1772
1775 // Skip the HUD layer. 1773 // Skip the HUD layer.
1776 if (layer == layer->layer_tree_impl()->hud_layer()) 1774 if (layer == layer->layer_tree_impl()->hud_layer())
1777 return false; 1775 return false;
1778 1776
1779 return true; 1777 return true;
1780 } 1778 }
1781 1779
1782 struct FindClosestMatchingLayerState { 1780 struct FindClosestMatchingLayerState {
1783 FindClosestMatchingLayerState() 1781 FindClosestMatchingLayerState()
1784 : closest_match(NULL), 1782 : closest_match(NULL),
1785 closest_distance(-std::numeric_limits<float>::infinity()) {} 1783 closest_distance(-std::numeric_limits<float>::infinity()) {}
1786 LayerImpl* closest_match; 1784 LayerImpl* closest_match;
1787 // Note that the positive z-axis points towards the camera, so bigger means 1785 // Note that the positive z-axis points towards the camera, so bigger means
1788 // closer in this case, counterintuitively. 1786 // closer in this case, counterintuitively.
1789 float closest_distance; 1787 float closest_distance;
1790 }; 1788 };
1791 1789
1792 template <typename Functor> 1790 template <typename Functor>
1793 static void FindClosestMatchingLayer(const gfx::PointF& screen_space_point, 1791 static void FindClosestMatchingLayer(const gfx::PointF& screen_space_point,
1794 LayerImpl* root_layer, 1792 LayerImpl* root_layer,
1795 const Functor& func, 1793 const Functor& func,
1796 const TransformTree& transform_tree,
1797 const ClipTree& clip_tree,
1798 FindClosestMatchingLayerState* state) { 1794 FindClosestMatchingLayerState* state) {
1799 // We want to iterate from front to back when hit testing. 1795 // We want to iterate from front to back when hit testing.
1800 for (auto* layer : base::Reversed(*root_layer->layer_tree_impl())) { 1796 for (auto* layer : base::Reversed(*root_layer->layer_tree_impl())) {
1801 if (!func(layer)) 1797 if (!func(layer))
1802 continue; 1798 continue;
1803 1799
1804 float distance_to_intersection = 0.f; 1800 float distance_to_intersection = 0.f;
1805 bool hit = false; 1801 bool hit = false;
1806 if (layer->Is3dSorted()) 1802 if (layer->Is3dSorted())
1807 hit = PointHitsLayer(layer, screen_space_point, &distance_to_intersection, 1803 hit =
1808 transform_tree, clip_tree); 1804 PointHitsLayer(layer, screen_space_point, &distance_to_intersection);
1809 else 1805 else
1810 hit = PointHitsLayer(layer, screen_space_point, nullptr, transform_tree, 1806 hit = PointHitsLayer(layer, screen_space_point, nullptr);
1811 clip_tree);
1812 1807
1813 if (!hit) 1808 if (!hit)
1814 continue; 1809 continue;
1815 1810
1816 bool in_front_of_previous_candidate = 1811 bool in_front_of_previous_candidate =
1817 state->closest_match && 1812 state->closest_match &&
1818 layer->sorting_context_id() == 1813 layer->sorting_context_id() ==
1819 state->closest_match->sorting_context_id() && 1814 state->closest_match->sorting_context_id() &&
1820 distance_to_intersection > 1815 distance_to_intersection >
1821 state->closest_distance + std::numeric_limits<float>::epsilon(); 1816 state->closest_distance + std::numeric_limits<float>::epsilon();
(...skipping 17 matching lines...) Expand all
1839 return ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer); 1834 return ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer);
1840 } 1835 }
1841 }; 1836 };
1842 1837
1843 LayerImpl* 1838 LayerImpl*
1844 LayerTreeImpl::FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint( 1839 LayerTreeImpl::FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
1845 const gfx::PointF& screen_space_point) { 1840 const gfx::PointF& screen_space_point) {
1846 FindClosestMatchingLayerState state; 1841 FindClosestMatchingLayerState state;
1847 LayerImpl* root_layer = layer_list_.empty() ? nullptr : layer_list_[0]; 1842 LayerImpl* root_layer = layer_list_.empty() ? nullptr : layer_list_[0];
1848 FindClosestMatchingLayer(screen_space_point, root_layer, 1843 FindClosestMatchingLayer(screen_space_point, root_layer,
1849 FindScrollingLayerOrScrollbarLayerFunctor(), 1844 FindScrollingLayerOrScrollbarLayerFunctor(), &state);
1850 property_trees_.transform_tree,
1851 property_trees_.clip_tree, &state);
1852 return state.closest_match; 1845 return state.closest_match;
1853 } 1846 }
1854 1847
1855 struct HitTestVisibleScrollableOrTouchableFunctor { 1848 struct HitTestVisibleScrollableOrTouchableFunctor {
1856 bool operator()(LayerImpl* layer) const { 1849 bool operator()(LayerImpl* layer) const {
1857 return layer->is_drawn_render_surface_layer_list_member() || 1850 return layer->is_drawn_render_surface_layer_list_member() ||
1858 ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer) || 1851 ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer) ||
1859 !layer->touch_event_handler_region().IsEmpty(); 1852 !layer->touch_event_handler_region().IsEmpty();
1860 } 1853 }
1861 }; 1854 };
1862 1855
1863 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint( 1856 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint(
1864 const gfx::PointF& screen_space_point) { 1857 const gfx::PointF& screen_space_point) {
1865 if (layer_list_.empty()) 1858 if (layer_list_.empty())
1866 return NULL; 1859 return NULL;
1867 bool update_lcd_text = false; 1860 bool update_lcd_text = false;
1868 if (!UpdateDrawProperties(update_lcd_text)) 1861 if (!UpdateDrawProperties(update_lcd_text))
1869 return NULL; 1862 return NULL;
1870 FindClosestMatchingLayerState state; 1863 FindClosestMatchingLayerState state;
1871 FindClosestMatchingLayer(screen_space_point, layer_list_[0], 1864 FindClosestMatchingLayer(screen_space_point, layer_list_[0],
1872 HitTestVisibleScrollableOrTouchableFunctor(), 1865 HitTestVisibleScrollableOrTouchableFunctor(),
1873 property_trees_.transform_tree, 1866 &state);
1874 property_trees_.clip_tree, &state);
1875 return state.closest_match; 1867 return state.closest_match;
1876 } 1868 }
1877 1869
1878 static bool LayerHasTouchEventHandlersAt(const gfx::PointF& screen_space_point, 1870 static bool LayerHasTouchEventHandlersAt(const gfx::PointF& screen_space_point,
1879 LayerImpl* layer_impl, 1871 LayerImpl* layer_impl) {
1880 const TransformTree& transform_tree,
1881 const ClipTree& clip_tree) {
1882 if (layer_impl->touch_event_handler_region().IsEmpty()) 1872 if (layer_impl->touch_event_handler_region().IsEmpty())
1883 return false; 1873 return false;
1884 1874
1885 if (!PointHitsRegion(screen_space_point, layer_impl->ScreenSpaceTransform(), 1875 if (!PointHitsRegion(screen_space_point, layer_impl->ScreenSpaceTransform(),
1886 layer_impl->touch_event_handler_region())) 1876 layer_impl->touch_event_handler_region()))
1887 return false; 1877 return false;
1888 1878
1889 // At this point, we think the point does hit the touch event handler region 1879 // At this point, we think the point does hit the touch event handler region
1890 // on the layer, but we need to walk up the parents to ensure that the layer 1880 // on the layer, but we need to walk up the parents to ensure that the layer
1891 // was not clipped in such a way that the hit point actually should not hit 1881 // was not clipped in such a way that the hit point actually should not hit
1892 // the layer. 1882 // the layer.
1893 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl, 1883 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl))
1894 transform_tree, clip_tree))
1895 return false; 1884 return false;
1896 1885
1897 return true; 1886 return true;
1898 } 1887 }
1899 1888
1900 struct FindTouchEventLayerFunctor { 1889 struct FindTouchEventLayerFunctor {
1901 bool operator()(LayerImpl* layer) const { 1890 bool operator()(LayerImpl* layer) const {
1902 return LayerHasTouchEventHandlersAt(screen_space_point, layer, 1891 return LayerHasTouchEventHandlersAt(screen_space_point, layer);
1903 transform_tree, clip_tree);
1904 } 1892 }
1905 const gfx::PointF screen_space_point; 1893 const gfx::PointF screen_space_point;
1906 const TransformTree& transform_tree;
1907 const ClipTree& clip_tree;
1908 }; 1894 };
1909 1895
1910 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( 1896 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion(
1911 const gfx::PointF& screen_space_point) { 1897 const gfx::PointF& screen_space_point) {
1912 if (layer_list_.empty()) 1898 if (layer_list_.empty())
1913 return NULL; 1899 return NULL;
1914 bool update_lcd_text = false; 1900 bool update_lcd_text = false;
1915 if (!UpdateDrawProperties(update_lcd_text)) 1901 if (!UpdateDrawProperties(update_lcd_text))
1916 return NULL; 1902 return NULL;
1917 FindTouchEventLayerFunctor func = {screen_space_point, 1903 FindTouchEventLayerFunctor func = {screen_space_point};
1918 property_trees_.transform_tree,
1919 property_trees_.clip_tree};
1920 FindClosestMatchingLayerState state; 1904 FindClosestMatchingLayerState state;
1921 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, 1905 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state);
1922 property_trees_.transform_tree,
1923 property_trees_.clip_tree, &state);
1924 return state.closest_match; 1906 return state.closest_match;
1925 } 1907 }
1926 1908
1927 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { 1909 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) {
1928 selection_ = selection; 1910 selection_ = selection;
1929 } 1911 }
1930 1912
1931 static gfx::SelectionBound ComputeViewportSelectionBound( 1913 static gfx::SelectionBound ComputeViewportSelectionBound(
1932 const LayerSelectionBound& layer_bound, 1914 const LayerSelectionBound& layer_bound,
1933 LayerImpl* layer, 1915 LayerImpl* layer,
1934 float device_scale_factor, 1916 float device_scale_factor) {
1935 const TransformTree& transform_tree,
1936 const ClipTree& clip_tree) {
1937 gfx::SelectionBound viewport_bound; 1917 gfx::SelectionBound viewport_bound;
1938 viewport_bound.set_type(layer_bound.type); 1918 viewport_bound.set_type(layer_bound.type);
1939 1919
1940 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) 1920 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY)
1941 return viewport_bound; 1921 return viewport_bound;
1942 1922
1943 auto layer_top = gfx::PointF(layer_bound.edge_top); 1923 auto layer_top = gfx::PointF(layer_bound.edge_top);
1944 auto layer_bottom = gfx::PointF(layer_bound.edge_bottom); 1924 auto layer_bottom = gfx::PointF(layer_bound.edge_bottom);
1945 gfx::Transform screen_space_transform = layer->ScreenSpaceTransform(); 1925 gfx::Transform screen_space_transform = layer->ScreenSpaceTransform();
1946 1926
(...skipping 22 matching lines...) Expand all
1969 // spuriously occlude the bound. 1949 // spuriously occlude the bound.
1970 gfx::Vector2dF visibility_offset = layer_top - layer_bottom; 1950 gfx::Vector2dF visibility_offset = layer_top - layer_bottom;
1971 visibility_offset.Scale(device_scale_factor / visibility_offset.Length()); 1951 visibility_offset.Scale(device_scale_factor / visibility_offset.Length());
1972 gfx::PointF visibility_point = layer_bottom + visibility_offset; 1952 gfx::PointF visibility_point = layer_bottom + visibility_offset;
1973 if (visibility_point.x() <= 0) 1953 if (visibility_point.x() <= 0)
1974 visibility_point.set_x(visibility_point.x() + device_scale_factor); 1954 visibility_point.set_x(visibility_point.x() + device_scale_factor);
1975 visibility_point = 1955 visibility_point =
1976 MathUtil::MapPoint(screen_space_transform, visibility_point, &clipped); 1956 MathUtil::MapPoint(screen_space_transform, visibility_point, &clipped);
1977 1957
1978 float intersect_distance = 0.f; 1958 float intersect_distance = 0.f;
1979 viewport_bound.set_visible(PointHitsLayer( 1959 viewport_bound.set_visible(
1980 layer, visibility_point, &intersect_distance, transform_tree, clip_tree)); 1960 PointHitsLayer(layer, visibility_point, &intersect_distance));
1981 1961
1982 return viewport_bound; 1962 return viewport_bound;
1983 } 1963 }
1984 1964
1985 void LayerTreeImpl::GetViewportSelection( 1965 void LayerTreeImpl::GetViewportSelection(
1986 Selection<gfx::SelectionBound>* selection) { 1966 Selection<gfx::SelectionBound>* selection) {
1987 DCHECK(selection); 1967 DCHECK(selection);
1988 1968
1989 selection->start = ComputeViewportSelectionBound( 1969 selection->start = ComputeViewportSelectionBound(
1990 selection_.start, 1970 selection_.start,
1991 selection_.start.layer_id ? LayerById(selection_.start.layer_id) : NULL, 1971 selection_.start.layer_id ? LayerById(selection_.start.layer_id) : NULL,
1992 device_scale_factor(), property_trees_.transform_tree, 1972 device_scale_factor());
1993 property_trees_.clip_tree);
1994 selection->is_editable = selection_.is_editable; 1973 selection->is_editable = selection_.is_editable;
1995 selection->is_empty_text_form_control = selection_.is_empty_text_form_control; 1974 selection->is_empty_text_form_control = selection_.is_empty_text_form_control;
1996 if (selection->start.type() == gfx::SelectionBound::CENTER || 1975 if (selection->start.type() == gfx::SelectionBound::CENTER ||
1997 selection->start.type() == gfx::SelectionBound::EMPTY) { 1976 selection->start.type() == gfx::SelectionBound::EMPTY) {
1998 selection->end = selection->start; 1977 selection->end = selection->start;
1999 } else { 1978 } else {
2000 selection->end = ComputeViewportSelectionBound( 1979 selection->end = ComputeViewportSelectionBound(
2001 selection_.end, 1980 selection_.end,
2002 selection_.end.layer_id ? LayerById(selection_.end.layer_id) : NULL, 1981 selection_.end.layer_id ? LayerById(selection_.end.layer_id) : NULL,
2003 device_scale_factor(), property_trees_.transform_tree, 1982 device_scale_factor());
2004 property_trees_.clip_tree);
2005 } 1983 }
2006 } 1984 }
2007 1985
2008 bool LayerTreeImpl::SmoothnessTakesPriority() const { 1986 bool LayerTreeImpl::SmoothnessTakesPriority() const {
2009 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY; 1987 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY;
2010 } 1988 }
2011 1989
2012 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() 1990 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient()
2013 const { 1991 const {
2014 return layer_tree_host_impl_; 1992 return layer_tree_host_impl_;
(...skipping 16 matching lines...) Expand all
2031 2009
2032 void LayerTreeImpl::ResetAllChangeTracking() { 2010 void LayerTreeImpl::ResetAllChangeTracking() {
2033 layers_that_should_push_properties_.clear(); 2011 layers_that_should_push_properties_.clear();
2034 // Iterate over all layers, including masks and replicas. 2012 // Iterate over all layers, including masks and replicas.
2035 for (auto& layer : *layers_) 2013 for (auto& layer : *layers_)
2036 layer->ResetChangeTracking(); 2014 layer->ResetChangeTracking();
2037 property_trees_.ResetAllChangeTracking(); 2015 property_trees_.ResetAllChangeTracking();
2038 } 2016 }
2039 2017
2040 } // namespace cc 2018 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698