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

Side by Side Diff: sky/engine/core/rendering/style/RenderStyle.cpp

Issue 856563006: Remove background obscuration checks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 diff.setNeedsFullLayout(); 292 diff.setNeedsFullLayout();
293 293
294 if (!diff.needsFullLayout() && position() != StaticPosition && surround->off set != other.surround->offset) { 294 if (!diff.needsFullLayout() && position() != StaticPosition && surround->off set != other.surround->offset) {
295 // Optimize for the case where a positioned layer is moving but not chan ging size. 295 // Optimize for the case where a positioned layer is moving but not chan ging size.
296 if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width())) 296 if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width()))
297 diff.setNeedsPositionedMovementLayout(); 297 diff.setNeedsPositionedMovementLayout();
298 else 298 else
299 diff.setNeedsFullLayout(); 299 diff.setNeedsFullLayout();
300 } 300 }
301 301
302 if (!diff.needsFullLayout() && diffNeedsPaintInvalidation(other))
303 diff.setNeedsPaintInvalidation();
304
305 updatePropertySpecificDifferences(other, diff); 302 updatePropertySpecificDifferences(other, diff);
306 303
307 // Cursors are not checked, since they will be set appropriately in response to mouse events, 304 // Cursors are not checked, since they will be set appropriately in response to mouse events,
308 // so they don't need to cause any paint invalidation or layout. 305 // so they don't need to cause any paint invalidation or layout.
309 306
310 // Animations don't need to be checked either. We always set the new style o n the RenderObject, so we will get a chance to fire off 307 // Animations don't need to be checked either. We always set the new style o n the RenderObject, so we will get a chance to fire off
311 // the resulting transition properly. 308 // the resulting transition properly.
312 309
313 return diff; 310 return diff;
314 } 311 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 if (surround->margin != other.surround->margin) 452 if (surround->margin != other.surround->margin)
456 return true; 453 return true;
457 454
458 if (surround->padding != other.surround->padding) 455 if (surround->padding != other.surround->padding)
459 return true; 456 return true;
460 } 457 }
461 458
462 return false; 459 return false;
463 } 460 }
464 461
465 bool RenderStyle::diffNeedsPaintInvalidation(const RenderStyle& other) const
466 {
467 if (inherited_flags._visibility != other.inherited_flags._visibility
468 || !surround->border.visuallyEqual(other.surround->border)
469 || !m_background->visuallyEqual(*other.m_background))
470 return true;
471
472 if (rareInheritedData.get() != other.rareInheritedData.get()) {
473 if (rareInheritedData->userModify != other.rareInheritedData->userModify
474 || rareInheritedData->userSelect != other.rareInheritedData->userSel ect
475 || rareInheritedData->m_imageRendering != other.rareInheritedData->m _imageRendering)
476 return true;
477 }
478
479 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
480 if (rareNonInheritedData->userDrag != other.rareNonInheritedData->userDr ag
481 || rareNonInheritedData->m_objectFit != other.rareNonInheritedData-> m_objectFit
482 || rareNonInheritedData->m_objectPosition != other.rareNonInheritedD ata->m_objectPosition
483 || !dataEquivalent(rareNonInheritedData->m_clipPath, other.rareNonIn heritedData->m_clipPath))
484 return true;
485 }
486
487 if (position() != StaticPosition && (visual->clip != other.visual->clip || v isual->hasAutoClip != other.visual->hasAutoClip))
488 return true;
489
490 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
491 if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
492 || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedDat a->m_maskBoxImage)
493 return true;
494 }
495
496 return false;
497 }
498
499 void RenderStyle::updatePropertySpecificDifferences(const RenderStyle& other, St yleDifference& diff) const 462 void RenderStyle::updatePropertySpecificDifferences(const RenderStyle& other, St yleDifference& diff) const
500 { 463 {
501 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable . 464 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable .
502 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot her.m_box->hasAutoZIndex()) 465 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot her.m_box->hasAutoZIndex())
503 diff.setZIndexChanged(); 466 diff.setZIndexChanged();
504 467
505 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { 468 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
506 if (!transformDataEquivalent(other)) 469 if (!transformDataEquivalent(other))
507 diff.setTransformChanged(); 470 diff.setTransformChanged();
508 471
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 // right 1215 // right
1253 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1216 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1254 if (radiiSum > rect.height()) 1217 if (radiiSum > rect.height())
1255 factor = std::min(rect.height() / radiiSum, factor); 1218 factor = std::min(rect.height() / radiiSum, factor);
1256 1219
1257 ASSERT(factor <= 1); 1220 ASSERT(factor <= 1);
1258 return factor; 1221 return factor;
1259 } 1222 }
1260 1223
1261 } // namespace blink 1224 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.h ('k') | sky/engine/core/rendering/style/StyleDifference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698