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

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 512293002: Fix paint invalidation when composited layers change from paints-into-ancestor to self-painting. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 } 1883 }
1884 1884
1885 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForAncestorReasons(con st RenderLayer* compositingAncestorLayer) 1885 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForAncestorReasons(con st RenderLayer* compositingAncestorLayer)
1886 { 1886 {
1887 unsigned previousRequiresOwnBackingStoreForAncestorReasons = m_requiresOwnBa ckingStoreForAncestorReasons; 1887 unsigned previousRequiresOwnBackingStoreForAncestorReasons = m_requiresOwnBa ckingStoreForAncestorReasons;
1888 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); 1888 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor();
1889 bool canPaintIntoAncestor = compositingAncestorLayer 1889 bool canPaintIntoAncestor = compositingAncestorLayer
1890 && (compositingAncestorLayer->compositedLayerMapping()->mainGraphicsLaye r()->drawsContent() 1890 && (compositingAncestorLayer->compositedLayerMapping()->mainGraphicsLaye r()->drawsContent()
1891 || compositingAncestorLayer->compositedLayerMapping()->paintsIntoCom positedAncestor()); 1891 || compositingAncestorLayer->compositedLayerMapping()->paintsIntoCom positedAncestor());
1892 1892
1893 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) 1893 m_requiresOwnBackingStoreForAncestorReasons = !canPaintIntoAncestor;
pdr. 2014/08/28 20:21:13 This code is really only tracking changes to m_req
chrishtr 2014/08/28 20:27:56 That would invalidate more than necessary. Only if
1894
1895 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) {
1896 // Back out the change temporarily while invalidating with respect to th e old container.
1897 m_requiresOwnBackingStoreForAncestorReasons = !m_requiresOwnBackingStore ForAncestorReasons;
1894 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer); 1898 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer);
1895 1899 m_requiresOwnBackingStoreForAncestorReasons = !m_requiresOwnBackingStore ForAncestorReasons;
1896 // FIXME: this is bogus. We need to make this assignment before the check ab ove. 1900 }
1897 m_requiresOwnBackingStoreForAncestorReasons = !canPaintIntoAncestor;
1898 1901
1899 return m_requiresOwnBackingStoreForAncestorReasons != previousRequiresOwnBac kingStoreForAncestorReasons; 1902 return m_requiresOwnBackingStoreForAncestorReasons != previousRequiresOwnBac kingStoreForAncestorReasons;
1900 } 1903 }
1901 1904
1902 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForIntrinsicReasons() 1905 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForIntrinsicReasons()
1903 { 1906 {
1904 unsigned previousRequiresOwnBackingStoreForIntrinsicReasons = m_requiresOwnB ackingStoreForIntrinsicReasons; 1907 unsigned previousRequiresOwnBackingStoreForIntrinsicReasons = m_requiresOwnB ackingStoreForIntrinsicReasons;
1905 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); 1908 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor();
1906 RenderObject* renderer = m_owningLayer.renderer(); 1909 RenderObject* renderer = m_owningLayer.renderer();
1907 m_requiresOwnBackingStoreForIntrinsicReasons = m_owningLayer.isRootLayer() 1910 m_requiresOwnBackingStoreForIntrinsicReasons = m_owningLayer.isRootLayer()
1908 || (m_owningLayer.compositingReasons() & CompositingReasonComboReasonsTh atRequireOwnBacking) 1911 || (m_owningLayer.compositingReasons() & CompositingReasonComboReasonsTh atRequireOwnBacking)
1909 || m_owningLayer.transform() 1912 || m_owningLayer.transform()
1910 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME: Revisit this if the paintsIntoCompositedAncestor state is removed. 1913 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME: Revisit this if the paintsIntoCompositedAncestor state is removed.
1911 || renderer->isTransparent() 1914 || renderer->isTransparent()
1912 || renderer->hasMask() 1915 || renderer->hasMask()
1913 || renderer->hasReflection() 1916 || renderer->hasReflection()
1914 || renderer->hasFilter(); 1917 || renderer->hasFilter();
1915 1918
1916 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) 1919 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) {
1920 // Back out the change temporarily while invalidating with respect to th e old container.
1921 m_requiresOwnBackingStoreForIntrinsicReasons = !m_requiresOwnBackingStor eForIntrinsicReasons;
1917 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer); 1922 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer);
1923 m_requiresOwnBackingStoreForIntrinsicReasons = !m_requiresOwnBackingStor eForIntrinsicReasons;
1924 }
1918 1925
1919 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa ckingStoreForIntrinsicReasons; 1926 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa ckingStoreForIntrinsicReasons;
1920 } 1927 }
1921 1928
1922 void CompositedLayerMapping::setBlendMode(WebBlendMode blendMode) 1929 void CompositedLayerMapping::setBlendMode(WebBlendMode blendMode)
1923 { 1930 {
1924 if (m_ancestorClippingLayer) { 1931 if (m_ancestorClippingLayer) {
1925 m_ancestorClippingLayer->setBlendMode(blendMode); 1932 m_ancestorClippingLayer->setBlendMode(blendMode);
1926 m_graphicsLayer->setBlendMode(WebBlendModeNormal); 1933 m_graphicsLayer->setBlendMode(WebBlendModeNormal);
1927 } else { 1934 } else {
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2290 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2284 name = "Scrolling Block Selection Layer"; 2291 name = "Scrolling Block Selection Layer";
2285 } else { 2292 } else {
2286 ASSERT_NOT_REACHED(); 2293 ASSERT_NOT_REACHED();
2287 } 2294 }
2288 2295
2289 return name; 2296 return name;
2290 } 2297 }
2291 2298
2292 } // namespace blink 2299 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698