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

Side by Side Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 882223005: Remove painting roots. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/engine/core/rendering/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderLayer.h » ('j') | 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) 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 384 }
385 385
386 return false; 386 return false;
387 } 387 }
388 388
389 // --------------------- painting stuff ------------------------------- 389 // --------------------- painting stuff -------------------------------
390 390
391 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 391 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
392 { 392 {
393 LayoutPoint adjustedPaintOffset = paintOffset + location(); 393 LayoutPoint adjustedPaintOffset = paintOffset + location();
394 // default implementation. Just pass paint through to the children
395 PaintInfo childInfo(paintInfo);
396 childInfo.updatePaintingRootForChildren(this);
397 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng()) 394 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng())
398 child->paint(childInfo, adjustedPaintOffset); 395 child->paint(paintInfo, adjustedPaintOffset);
399 } 396 }
400 397
401 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo) 398 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
402 { 399 {
403 const FillLayer& bgLayer = style()->backgroundLayers(); 400 const FillLayer& bgLayer = style()->backgroundLayers();
404 Color bgColor = resolveColor(CSSPropertyBackgroundColor); 401 Color bgColor = resolveColor(CSSPropertyBackgroundColor);
405 402
406 paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), B ackgroundBleedNone, this); 403 paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), B ackgroundBleedNone, this);
407 } 404 }
408 405
(...skipping 24 matching lines...) Expand all
433 if (borderObscuresBackgroundEdge(contextScaling)) 430 if (borderObscuresBackgroundEdge(contextScaling))
434 return BackgroundBleedShrinkBackground; 431 return BackgroundBleedShrinkBackground;
435 if (borderObscuresBackground() && backgroundHasOpaqueTopLayer()) 432 if (borderObscuresBackground() && backgroundHasOpaqueTopLayer())
436 return BackgroundBleedBackgroundOverBorder; 433 return BackgroundBleedBackgroundOverBorder;
437 434
438 return BackgroundBleedClipBackground; 435 return BackgroundBleedClipBackground;
439 } 436 }
440 437
441 void RenderBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const LayoutP oint& paintOffset) 438 void RenderBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const LayoutP oint& paintOffset)
442 { 439 {
443 if (!paintInfo.shouldPaintWithinRoot(this))
444 return;
445
446 LayoutRect paintRect = borderBoxRect(); 440 LayoutRect paintRect = borderBoxRect();
447 paintRect.moveBy(paintOffset); 441 paintRect.moveBy(paintOffset);
448 paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect); 442 paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect);
449 } 443 }
450 444
451 void RenderBox::paintBoxDecorationBackgroundWithRect(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const LayoutRect& paintRect) 445 void RenderBox::paintBoxDecorationBackgroundWithRect(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const LayoutRect& paintRect)
452 { 446 {
453 RenderStyle* style = this->style(); 447 RenderStyle* style = this->style();
454 BoxDecorationData boxDecorationData(*style); 448 BoxDecorationData boxDecorationData(*style);
455 BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance( paintInfo.context, boxDecorationData); 449 BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance( paintInfo.context, boxDecorationData);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 Color bgColor = resolveColor(CSSPropertyBackgroundColor); 494 Color bgColor = resolveColor(CSSPropertyBackgroundColor);
501 if (bgColor.alpha() == 255) 495 if (bgColor.alpha() == 255)
502 return true; 496 return true;
503 } 497 }
504 498
505 return false; 499 return false;
506 } 500 }
507 501
508 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 502 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
509 { 503 {
510 if (!paintInfo.shouldPaintWithinRoot(this) || paintInfo.phase != PaintPhaseM ask) 504 if (paintInfo.phase != PaintPhaseMask)
511 return; 505 return;
512 506
513 LayoutRect paintRect = LayoutRect(paintOffset, size()); 507 LayoutRect paintRect = LayoutRect(paintOffset, size());
514 paintMaskImages(paintInfo, paintRect); 508 paintMaskImages(paintInfo, paintRect);
515 } 509 }
516 510
517 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect) 511 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect)
518 { 512 {
519 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), paintR ect, BackgroundBleedNone); 513 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), paintR ect, BackgroundBleedNone);
520 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxI mage()); 514 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxI mage());
(...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 2706
2713 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 2707 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
2714 { 2708 {
2715 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 2709 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
2716 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 2710 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
2717 ASSERT(hasBackground == style.hasBackground()); 2711 ASSERT(hasBackground == style.hasBackground());
2718 hasBorder = style.hasBorder(); 2712 hasBorder = style.hasBorder();
2719 } 2713 }
2720 2714
2721 } // namespace blink 2715 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698