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

Unified Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Basic box painting support Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/BoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.cpp b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
index 4ec4a3c677611dc0c46509c959637719c0fc512b..6c61fc4d8a91e46f27e3d1bde6cbb0ba1db41054 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
@@ -213,39 +213,6 @@ void BoxPainter::PaintBackground(const PaintInfo& paint_info,
bleed_avoidance);
}
-bool BoxPainter::CalculateFillLayerOcclusionCulling(
- FillLayerOcclusionOutputList& reversed_paint_list,
- const FillLayer& fill_layer) {
- bool is_non_associative = false;
- for (auto current_layer = &fill_layer; current_layer;
- current_layer = current_layer->Next()) {
- reversed_paint_list.push_back(current_layer);
- // Stop traversal when an opaque layer is encountered.
- // FIXME : It would be possible for the following occlusion culling test to
- // be more aggressive on layers with no repeat by testing whether the image
- // covers the layout rect. Testing that here would imply duplicating a lot
- // of calculations that are currently done in
- // LayoutBoxModelObject::paintFillLayer. A more efficient solution might be
- // to move the layer recursion into paintFillLayer, or to compute the layer
- // geometry here and pass it down.
-
- // TODO(trchen): Need to check compositing mode as well.
- if (current_layer->BlendMode() != kWebBlendModeNormal)
- is_non_associative = true;
-
- // TODO(trchen): A fill layer cannot paint if the calculated tile size is
- // empty. This occlusion check can be wrong.
- if (current_layer->ClipOccludesNextLayers() &&
- current_layer->ImageOccludesNextLayers(layout_box_.GetDocument(),
- layout_box_.StyleRef())) {
- if (current_layer->Clip() == kBorderFillBox)
- is_non_associative = false;
- break;
- }
- }
- return is_non_associative;
-}
-
void BoxPainter::PaintFillLayers(const PaintInfo& paint_info,
const Color& c,
const FillLayer& fill_layer,
@@ -255,7 +222,9 @@ void BoxPainter::PaintFillLayers(const PaintInfo& paint_info,
const LayoutObject* background_object) {
FillLayerOcclusionOutputList reversed_paint_list;
bool should_draw_background_in_separate_buffer =
- CalculateFillLayerOcclusionCulling(reversed_paint_list, fill_layer);
+ CalculateFillLayerOcclusionCulling(reversed_paint_list, fill_layer,
+ layout_box_.GetDocument(),
+ layout_box_.StyleRef());
// TODO(trchen): We can optimize out isolation group if we have a
// non-transparent background color and the bottom layer encloses all other

Powered by Google App Engine
This is Rietveld 408576698