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

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

Issue 886263003: Remove mask painting. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix comment 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/RenderBox.h ('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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 // If there is only one layer and no image, check whether the background col or is opaque 492 // If there is only one layer and no image, check whether the background col or is opaque
493 if (!fillLayer.next() && !fillLayer.hasImage()) { 493 if (!fillLayer.next() && !fillLayer.hasImage()) {
494 Color bgColor = resolveColor(CSSPropertyBackgroundColor); 494 Color bgColor = resolveColor(CSSPropertyBackgroundColor);
495 if (bgColor.alpha() == 255) 495 if (bgColor.alpha() == 255)
496 return true; 496 return true;
497 } 497 }
498 498
499 return false; 499 return false;
500 } 500 }
501 501
502 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
503 {
504 LayoutRect paintRect = LayoutRect(paintOffset, size());
505 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), paintR ect, BackgroundBleedNone);
506 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxI mage());
507 }
508
509 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons t FillLayer& fillLayer, const LayoutRect& rect, 502 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons t FillLayer& fillLayer, const LayoutRect& rect,
510 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject) 503 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject)
511 { 504 {
512 Vector<const FillLayer*, 8> layers; 505 Vector<const FillLayer*, 8> layers;
513 const FillLayer* curLayer = &fillLayer; 506 const FillLayer* curLayer = &fillLayer;
514 bool shouldDrawBackgroundInSeparateBuffer = false; 507 bool shouldDrawBackgroundInSeparateBuffer = false;
515 bool isBottomLayerOccluded = false; 508 bool isBottomLayerOccluded = false;
516 while (curLayer) { 509 while (curLayer) {
517 layers.append(curLayer); 510 layers.append(curLayer);
518 // Stop traversal when an opaque layer is encountered. 511 // Stop traversal when an opaque layer is encountered.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 554 }
562 555
563 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect, 556 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect,
564 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, boo l skipBaseColor) 557 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, boo l skipBaseColor)
565 { 558 {
566 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay outSize(), backgroundObject, skipBaseColor); 559 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay outSize(), backgroundObject, skipBaseColor);
567 } 560 }
568 561
569 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) 562 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior)
570 { 563 {
571 if (paintInfo.phase == PaintPhaseMask)
572 return false;
573
574 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); 564 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer();
575 if (!isOverflowClip) 565 if (!isOverflowClip)
576 return false; 566 return false;
577 567
578 LayoutRect clipRect = overflowClipRect(accumulatedOffset); 568 LayoutRect clipRect = overflowClipRect(accumulatedOffset);
579 RoundedRect clipRoundedRect(0, 0, 0, 0); 569 RoundedRect clipRoundedRect(0, 0, 0, 0);
580 bool hasBorderRadius = style()->hasBorderRadius(); 570 bool hasBorderRadius = style()->hasBorderRadius();
581 if (hasBorderRadius) 571 if (hasBorderRadius)
582 clipRoundedRect = style()->getRoundedInnerBorderFor(LayoutRect(accumulat edOffset, size())); 572 clipRoundedRect = style()->getRoundedInnerBorderFor(LayoutRect(accumulat edOffset, size()));
583 573
(...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 2688
2699 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 2689 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
2700 { 2690 {
2701 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 2691 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
2702 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 2692 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
2703 ASSERT(hasBackground == style.hasBackground()); 2693 ASSERT(hasBackground == style.hasBackground());
2704 hasBorder = style.hasBorder(); 2694 hasBorder = style.hasBorder();
2705 } 2695 }
2706 2696
2707 } // namespace blink 2697 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698