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

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPainter.cpp

Issue 1562183002: ObjectPainter::paintAsStackingContext() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ObjectPainter.h" 5 #include "core/paint/ObjectPainter.h"
6 6
7 #include "core/layout/LayoutBlock.h" 7 #include "core/layout/LayoutBlock.h"
8 #include "core/layout/LayoutInline.h" 8 #include "core/layout/LayoutInline.h"
9 #include "core/layout/LayoutObject.h" 9 #include "core/layout/LayoutObject.h"
10 #include "core/layout/LayoutTheme.h" 10 #include "core/layout/LayoutTheme.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0)); 527 quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0));
528 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); 528 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0));
529 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); 529 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0));
530 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); 530 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0));
531 break; 531 break;
532 } 532 }
533 533
534 graphicsContext.fillPolygon(4, quad, color, antialias); 534 graphicsContext.fillPolygon(4, quad, color, antialias);
535 } 535 }
536 536
537 void ObjectPainter::paintAsPseudoStackingContext(const PaintInfo& paintInfo, con st LayoutPoint& paintOffset)
538 {
539 bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.pha se == PaintPhaseTextClip;
540 if (!preservePhase && paintInfo.phase != PaintPhaseForeground)
541 return;
542
543 PaintInfo info(paintInfo);
544 info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
545 m_layoutObject.paint(info, paintOffset);
546 if (!preservePhase) {
547 info.phase = PaintPhaseChildBlockBackgrounds;
548 m_layoutObject.paint(info, paintOffset);
549 info.phase = PaintPhaseFloat;
550 m_layoutObject.paint(info, paintOffset);
551 info.phase = PaintPhaseForeground;
552 m_layoutObject.paint(info, paintOffset);
553 info.phase = PaintPhaseOutline;
554 m_layoutObject.paint(info, paintOffset);
555 }
556 }
557
537 } // namespace blink 558 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ObjectPainter.h ('k') | third_party/WebKit/Source/core/paint/SVGForeignObjectPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698