| 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 "core/paint/ViewPainter.h" | 5 #include "core/paint/ViewPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } else if (should_clear_canvas) { | 156 } else if (should_clear_canvas) { |
| 157 context.FillRect(background_rect, Color(), SkBlendMode::kClear); | 157 context.FillRect(background_rect, Color(), SkBlendMode::kClear); |
| 158 } | 158 } |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 | 161 |
| 162 BoxPainter::FillLayerOcclusionOutputList reversed_paint_list; | 162 BoxPainter::FillLayerOcclusionOutputList reversed_paint_list; |
| 163 bool should_draw_background_in_separate_buffer = | 163 bool should_draw_background_in_separate_buffer = |
| 164 BoxPainter(layout_view_) | 164 BoxPainter(layout_view_) |
| 165 .CalculateFillLayerOcclusionCulling( | 165 .CalculateFillLayerOcclusionCulling( |
| 166 reversed_paint_list, layout_view_.Style()->BackgroundLayers()); | 166 reversed_paint_list, layout_view_.Style()->BackgroundLayers(), |
| 167 layout_view_.GetDocument(), layout_view_.StyleRef()); |
| 167 DCHECK(reversed_paint_list.size()); | 168 DCHECK(reversed_paint_list.size()); |
| 168 | 169 |
| 169 // If the root background color is opaque, isolation group can be skipped | 170 // If the root background color is opaque, isolation group can be skipped |
| 170 // because the canvas | 171 // because the canvas |
| 171 // will be cleared by root background color. | 172 // will be cleared by root background color. |
| 172 if (!root_background_color.HasAlpha()) | 173 if (!root_background_color.HasAlpha()) |
| 173 should_draw_background_in_separate_buffer = false; | 174 should_draw_background_in_separate_buffer = false; |
| 174 | 175 |
| 175 // We are going to clear the canvas with transparent pixels, isolation group | 176 // We are going to clear the canvas with transparent pixels, isolation group |
| 176 // can be skipped. | 177 // can be skipped. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 LayoutRect(paint_rect), kBackgroundBleedNone); | 228 LayoutRect(paint_rect), kBackgroundBleedNone); |
| 228 context.Restore(); | 229 context.Restore(); |
| 229 } | 230 } |
| 230 } | 231 } |
| 231 | 232 |
| 232 if (should_draw_background_in_separate_buffer) | 233 if (should_draw_background_in_separate_buffer) |
| 233 context.EndLayer(); | 234 context.EndLayer(); |
| 234 } | 235 } |
| 235 | 236 |
| 236 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |