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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/CompositedLayerMapping.cpp b/Source/core/rendering/CompositedLayerMapping.cpp
index c94331dbb80fb1a8ac0984eaf5588afd697a6d29..10b6ec8172a0bab211213e6cd3052678e7c0678a 100644
--- a/Source/core/rendering/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/CompositedLayerMapping.cpp
@@ -1609,11 +1609,16 @@ bool CompositedLayerMapping::containsPaintedContent(bool isSimpleContainer) cons
if (isSimpleContainer || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
return false;
+ if (renderer()->isCanvas() || renderer()->isVideo() || renderer()->isImage()) {
+ if (isAcceleratedCanvas(renderer())) {
+ if (contentsBox() == toRenderBox(renderer())->borderBoxRect())
+ return true;
+ }
+ }
+
vivekg 2014/02/18 12:30:39 How about reordering like here? if (renderer()->
if (isDirectlyCompositedImage())
return false;
- // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely,
- // and set background color on the layer in that case, instead of allocating backing store and painting.
if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo())
return m_owningLayer->hasBoxDecorationsOrBackground();
« 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