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

Side by Side Diff: Source/core/paint/BoxPainter.cpp

Issue 1224893004: Turn FrameView's paintBehavior into a real global (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improved change after the reviews. Still fails on Android. Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | Source/core/paint/DeprecatedPaintLayer.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 // 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBox, paintI nfo.phase, visualOverflowRect); 518 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBox, paintI nfo.phase, visualOverflowRect);
519 LayoutRect paintRect = LayoutRect(paintOffset, m_layoutBox.size()); 519 LayoutRect paintRect = LayoutRect(paintOffset, m_layoutBox.size());
520 paintMaskImages(paintInfo, paintRect); 520 paintMaskImages(paintInfo, paintRect);
521 } 521 }
522 522
523 void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p aintRect) 523 void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p aintRect)
524 { 524 {
525 // Figure out if we need to push a transparency layer to render our mask. 525 // Figure out if we need to push a transparency layer to render our mask.
526 bool pushTransparencyLayer = false; 526 bool pushTransparencyLayer = false;
527 bool compositedMask = m_layoutBox.hasLayer() && m_layoutBox.layer()->hasComp ositedMask(); 527 bool compositedMask = m_layoutBox.hasLayer() && m_layoutBox.layer()->hasComp ositedMask();
528 bool flattenCompositingLayers = m_layoutBox.view()->frameView() && m_layoutB ox.view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; 528 bool flattenCompositingLayers = gGlobalPaintFlags & GlobalPaintFlattenCompos itingLayers;
529 529
530 bool allMaskImagesLoaded = true; 530 bool allMaskImagesLoaded = true;
531 531
532 if (!compositedMask || flattenCompositingLayers) { 532 if (!compositedMask || flattenCompositingLayers) {
533 pushTransparencyLayer = true; 533 pushTransparencyLayer = true;
534 StyleImage* maskBoxImage = m_layoutBox.style()->maskBoxImage().image(); 534 StyleImage* maskBoxImage = m_layoutBox.style()->maskBoxImage().image();
535 const FillLayer& maskLayers = m_layoutBox.style()->maskLayers(); 535 const FillLayer& maskLayers = m_layoutBox.style()->maskLayers();
536 536
537 // Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content. 537 // Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content.
538 if (maskBoxImage) 538 if (maskBoxImage)
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 return ImageQualityController::imageQualityController()->chooseInterpolation Quality(context, &obj, image, layer, size); 763 return ImageQualityController::imageQualityController()->chooseInterpolation Quality(context, &obj, image, layer, size);
764 } 764 }
765 765
766 bool BoxPainter::fixedBackgroundPaintsInLocalCoordinates(const LayoutObject& obj ) 766 bool BoxPainter::fixedBackgroundPaintsInLocalCoordinates(const LayoutObject& obj )
767 { 767 {
768 if (!obj.isLayoutView()) 768 if (!obj.isLayoutView())
769 return false; 769 return false;
770 770
771 const LayoutView& view = toLayoutView(obj); 771 const LayoutView& view = toLayoutView(obj);
772 772
773 if (view.frameView() && view.frameView()->paintBehavior() & PaintBehaviorFla ttenCompositingLayers) 773 if (gGlobalPaintFlags & GlobalPaintFlattenCompositingLayers)
774 return false; 774 return false;
775 775
776 DeprecatedPaintLayer* rootLayer = view.layer(); 776 DeprecatedPaintLayer* rootLayer = view.layer();
777 if (!rootLayer || rootLayer->compositingState() == NotComposited) 777 if (!rootLayer || rootLayer->compositingState() == NotComposited)
778 return false; 778 return false;
779 779
780 return rootLayer->compositedDeprecatedPaintLayerMapping()->backgroundLayerPa intsFixedRootBackground(); 780 return rootLayer->compositedDeprecatedPaintLayerMapping()->backgroundLayerPa intsFixedRootBackground();
781 } 781 }
782 782
783 static inline void applySubPixelHeuristicForTileSize(LayoutSize& tileSize, const IntSize& positioningAreaSize) 783 static inline void applySubPixelHeuristicForTileSize(LayoutSize& tileSize, const IntSize& positioningAreaSize)
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 } 1044 }
1045 } 1045 }
1046 1046
1047 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) 1047 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
1048 { 1048 {
1049 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc onomy 1049 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc onomy
1050 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); 1050 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ());
1051 } 1051 }
1052 1052
1053 } // namespace blink 1053 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | Source/core/paint/DeprecatedPaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698