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

Unified Diff: cc/layer_tree_host_common.cc

Issue 11316171: Don't create render passes for transparent images. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing code review. Created 8 years, 1 month 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: cc/layer_tree_host_common.cc
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc
index ca7d45050f85c0857e5f88a4def5818ef1b5374e..7c68f80c5d2280282bfaafccf049e389514d8da3 100644
--- a/cc/layer_tree_host_common.cc
+++ b/cc/layer_tree_host_common.cc
@@ -259,7 +259,7 @@ static bool subtreeShouldRenderToSeparateSurface(LayerType* layer, bool axisAlig
return true;
// If the layer has opacity != 1 and does not have a preserves-3d transform style.
- if (layer->opacity() != 1 && !layer->preserves3D() && descendantDrawsContent)
+ if (layer->opacity() != 1 && !layer->preserves3D() && layer->drawsContent() && descendantDrawsContent)
return true;
return false;
@@ -484,17 +484,17 @@ static void calculateDrawTransformsInternal(LayerType* layer, const WebTransform
gfx::Rect clipRectForSubtree;
bool subtreeShouldBeClipped = false;
-
+
float drawOpacity = layer->opacity();
bool drawOpacityIsAnimating = layer->opacityIsAnimating();
- if (layer->parent() && layer->parent()->preserves3D()) {
+ if (layer->parent()) {
drawOpacity *= layer->parent()->drawOpacity();
drawOpacityIsAnimating |= layer->parent()->drawOpacityIsAnimating();
}
bool animatingTransformToTarget = layer->transformIsAnimating();
bool animatingTransformToScreen = animatingTransformToTarget;
- if (layer->parent()) {
+ if (layer->parent() && !layer->parent()->renderSurface()) {
shawnsingh 2012/11/26 19:03:08 I think our discussion also applies to this if-sta
danakj 2012/11/26 19:09:44 Yes, the check was added to the wrong if statement
animatingTransformToTarget |= layer->parent()->drawTransformIsAnimating();
animatingTransformToScreen |= layer->parent()->screenSpaceTransformIsAnimating();
}
« 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