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

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

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed first round of reviewer comments Created 7 years, 2 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 static bool isCandidateForOpaquenessTest(RenderBox* childBox) 1245 static bool isCandidateForOpaquenessTest(RenderBox* childBox)
1246 { 1246 {
1247 RenderStyle* childStyle = childBox->style(); 1247 RenderStyle* childStyle = childBox->style();
1248 if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent()) 1248 if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent())
1249 return false; 1249 return false;
1250 if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside()) 1250 if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside())
1251 return false; 1251 return false;
1252 if (!childBox->width() || !childBox->height()) 1252 if (!childBox->width() || !childBox->height())
1253 return false; 1253 return false;
1254 if (RenderLayer* childLayer = childBox->layer()) { 1254 if (RenderLayer* childLayer = childBox->layer()) {
1255 if (childLayer->isComposited()) 1255 // FIXME: perhaps this could be less conservative?
1256 if (childLayer->compositingState() != NotComposited)
1256 return false; 1257 return false;
1257 // FIXME: Deal with z-index. 1258 // FIXME: Deal with z-index.
1258 if (!childStyle->hasAutoZIndex()) 1259 if (!childStyle->hasAutoZIndex())
1259 return false; 1260 return false;
1260 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa yer->hasFilter()) 1261 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa yer->hasFilter())
1261 return false; 1262 return false;
1262 } 1263 }
1263 return true; 1264 return true;
1264 } 1265 }
1265 1266
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 1341
1341 LayoutRect paintRect = LayoutRect(paintOffset, size()); 1342 LayoutRect paintRect = LayoutRect(paintOffset, size());
1342 paintMaskImages(paintInfo, paintRect); 1343 paintMaskImages(paintInfo, paintRect);
1343 } 1344 }
1344 1345
1345 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint Offset) 1346 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint Offset)
1346 { 1347 {
1347 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB LE || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context->paintingDi sabled()) 1348 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB LE || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context->paintingDi sabled())
1348 return; 1349 return;
1349 1350
1350 if (!layer() || !layer()->isComposited()) 1351 if (!layer() || layer()->compositingState() != PaintsIntoOwnBacking)
Julien - ping for review 2013/10/03 20:08:36 How about we add an ASSERT that we never see HasOw
shawnsingh 2013/10/07 11:45:04 I'm not fixing any bug here, it's just a condition
1351 return; 1352 return;
1352 1353
1353 LayoutRect paintRect = LayoutRect(paintOffset, size()); 1354 LayoutRect paintRect = LayoutRect(paintOffset, size());
1354 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black); 1355 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black);
1355 } 1356 }
1356 1357
1357 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect) 1358 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect)
1358 { 1359 {
1359 // Figure out if we need to push a transparency layer to render our mask. 1360 // Figure out if we need to push a transparency layer to render our mask.
1360 bool pushTransparencyLayer = false; 1361 bool pushTransparencyLayer = false;
(...skipping 3422 matching lines...) Expand 10 before | Expand all | Expand 10 after
4783 return 0; 4784 return 0;
4784 4785
4785 if (!layoutState && !flowThreadContainingBlock()) 4786 if (!layoutState && !flowThreadContainingBlock())
4786 return 0; 4787 return 0;
4787 4788
4788 RenderBlock* containerBlock = containingBlock(); 4789 RenderBlock* containerBlock = containingBlock();
4789 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4790 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4790 } 4791 }
4791 4792
4792 } // namespace WebCore 4793 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698