Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 obj.paint(info, scrolledPaintRect.location() - localOffset); | 512 obj.paint(info, scrolledPaintRect.location() - localOffset); |
| 513 } | 513 } |
| 514 | 514 |
| 515 context->endLayer(); | 515 context->endLayer(); |
| 516 context->endLayer(); | 516 context->endLayer(); |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 | 519 |
| 520 void BoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset) | 520 void BoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset) |
| 521 { | 521 { |
| 522 LayoutRect visualOverflowRect(m_layoutBox.visualOverflowRect()); | |
| 523 visualOverflowRect.moveBy(paintOffset); | |
| 524 | |
| 525 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBox, paintI nfo.phase, visualOverflowRect); | |
| 526 if (recorder.canUseCachedDrawing()) | |
|
wkorman
2015/06/19 23:20:43
Could also just add this to the three bail-out con
chrishtr
2015/06/20 02:22:45
I prefer separate, to make it clear we are checkin
| |
| 527 return; | |
| 522 if (!paintInfo.shouldPaintWithinRoot(&m_layoutBox) || m_layoutBox.style()->v isibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) | 528 if (!paintInfo.shouldPaintWithinRoot(&m_layoutBox) || m_layoutBox.style()->v isibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
| 523 return; | 529 return; |
| 524 | |
| 525 LayoutRect paintRect = LayoutRect(paintOffset, m_layoutBox.size()); | 530 LayoutRect paintRect = LayoutRect(paintOffset, m_layoutBox.size()); |
| 526 paintMaskImages(paintInfo, paintRect); | 531 paintMaskImages(paintInfo, paintRect); |
| 527 } | 532 } |
| 528 | 533 |
| 529 void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p aintRect) | 534 void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p aintRect) |
| 530 { | 535 { |
| 531 // Figure out if we need to push a transparency layer to render our mask. | 536 // Figure out if we need to push a transparency layer to render our mask. |
| 532 bool pushTransparencyLayer = false; | 537 bool pushTransparencyLayer = false; |
| 533 bool compositedMask = m_layoutBox.hasLayer() && m_layoutBox.layer()->hasComp ositedMask(); | 538 bool compositedMask = m_layoutBox.hasLayer() && m_layoutBox.layer()->hasComp ositedMask(); |
| 534 bool flattenCompositingLayers = m_layoutBox.view()->frameView() && m_layoutB ox.view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; | 539 bool flattenCompositingLayers = m_layoutBox.view()->frameView() && m_layoutB ox.view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1042 else | 1047 else |
| 1043 clippedEdges |= GraphicsContext::BottomEdge; | 1048 clippedEdges |= GraphicsContext::BottomEdge; |
| 1044 } | 1049 } |
| 1045 // TODO: support non-integer shadows - crbug.com/334828 | 1050 // TODO: support non-integer shadows - crbug.com/334828 |
| 1046 context->drawInnerShadow(border, shadowColor, flooredIntSize(shadowO ffset), shadowBlur, shadowSpread, clippedEdges); | 1051 context->drawInnerShadow(border, shadowColor, flooredIntSize(shadowO ffset), shadowBlur, shadowSpread, clippedEdges); |
| 1047 } | 1052 } |
| 1048 } | 1053 } |
| 1049 } | 1054 } |
| 1050 | 1055 |
| 1051 } // namespace blink | 1056 } // namespace blink |
| OLD | NEW |