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

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

Issue 170423002: Saving an extra backing store if the contents fill the entire border rect. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const 1602 bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const
1603 { 1603 {
1604 return hasVisibleNonCompositingDescendant(m_owningLayer); 1604 return hasVisibleNonCompositingDescendant(m_owningLayer);
1605 } 1605 }
1606 1606
1607 bool CompositedLayerMapping::containsPaintedContent(bool isSimpleContainer) cons t 1607 bool CompositedLayerMapping::containsPaintedContent(bool isSimpleContainer) cons t
1608 { 1608 {
1609 if (isSimpleContainer || paintsIntoCompositedAncestor() || m_artificiallyInf latedBounds || m_owningLayer->isReflection()) 1609 if (isSimpleContainer || paintsIntoCompositedAncestor() || m_artificiallyInf latedBounds || m_owningLayer->isReflection())
1610 return false; 1610 return false;
1611 1611
1612 if (renderer()->isCanvas() || renderer()->isVideo() || renderer()->isImage() ) {
1613 if (isAcceleratedCanvas(renderer())) {
1614 if (contentsBox() == toRenderBox(renderer())->borderBoxRect())
1615 return true;
1616 }
1617 }
1618
vivekg 2014/02/18 12:30:39 How about reordering like here? if (renderer()->
1612 if (isDirectlyCompositedImage()) 1619 if (isDirectlyCompositedImage())
1613 return false; 1620 return false;
1614 1621
1615 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely,
1616 // and set background color on the layer in that case, instead of allocating backing store and painting.
1617 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() ) 1622 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() )
1618 return m_owningLayer->hasBoxDecorationsOrBackground(); 1623 return m_owningLayer->hasBoxDecorationsOrBackground();
1619 1624
1620 return true; 1625 return true;
1621 } 1626 }
1622 1627
1623 // An image can be directly compositing if it's the sole content of the layer, a nd has no box decorations 1628 // An image can be directly compositing if it's the sole content of the layer, a nd has no box decorations
1624 // that require painting. Direct compositing saves backing store. 1629 // that require painting. Direct compositing saves backing store.
1625 bool CompositedLayerMapping::isDirectlyCompositedImage() const 1630 bool CompositedLayerMapping::isDirectlyCompositedImage() const
1626 { 1631 {
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2142 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2138 name = "Scrolling Contents Layer"; 2143 name = "Scrolling Contents Layer";
2139 } else { 2144 } else {
2140 ASSERT_NOT_REACHED(); 2145 ASSERT_NOT_REACHED();
2141 } 2146 }
2142 2147
2143 return name; 2148 return name;
2144 } 2149 }
2145 2150
2146 } // namespace WebCore 2151 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698