| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 backgroundRect, baseBackgroundColor, | 160 backgroundRect, baseBackgroundColor, |
| 161 shouldClearCanvas ? SkBlendMode::kSrc : SkBlendMode::kSrcOver); | 161 shouldClearCanvas ? SkBlendMode::kSrc : SkBlendMode::kSrcOver); |
| 162 } | 162 } |
| 163 context.beginLayer(); | 163 context.beginLayer(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 Color combinedBackgroundColor = | 166 Color combinedBackgroundColor = |
| 167 shouldDrawBackgroundInSeparateBuffer | 167 shouldDrawBackgroundInSeparateBuffer |
| 168 ? rootBackgroundColor | 168 ? rootBackgroundColor |
| 169 : baseBackgroundColor.blend(rootBackgroundColor); | 169 : baseBackgroundColor.blend(rootBackgroundColor); |
| 170 if (combinedBackgroundColor != frameView.baseBackgroundColor() && |
| 171 !context.getPaintController().nonDefaultBackgroundColorPainted()) { |
| 172 TRACE_EVENT_INSTANT0("blink.user_timing", "paintNonDefaultBackgroundColor", |
| 173 TRACE_EVENT_SCOPE_GLOBAL); |
| 174 context.getPaintController().setNonDefaultBackgroundColorPainted(); |
| 175 } |
| 170 if (combinedBackgroundColor.alpha()) { | 176 if (combinedBackgroundColor.alpha()) { |
| 171 if (!combinedBackgroundColor.hasAlpha() && | 177 if (!combinedBackgroundColor.hasAlpha() && |
| 172 RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 178 RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 173 recorder.setKnownToBeOpaque(); | 179 recorder.setKnownToBeOpaque(); |
| 174 context.fillRect(backgroundRect, combinedBackgroundColor, | 180 context.fillRect(backgroundRect, combinedBackgroundColor, |
| 175 (shouldDrawBackgroundInSeparateBuffer || shouldClearCanvas) | 181 (shouldDrawBackgroundInSeparateBuffer || shouldClearCanvas) |
| 176 ? SkBlendMode::kSrc | 182 ? SkBlendMode::kSrc |
| 177 : SkBlendMode::kSrcOver); | 183 : SkBlendMode::kSrcOver); |
| 178 } else if (shouldClearCanvas && !shouldDrawBackgroundInSeparateBuffer) { | 184 } else if (shouldClearCanvas && !shouldDrawBackgroundInSeparateBuffer) { |
| 179 context.fillRect(backgroundRect, Color(), SkBlendMode::kClear); | 185 context.fillRect(backgroundRect, Color(), SkBlendMode::kClear); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 198 LayoutRect(paintRect), BackgroundBleedNone); | 204 LayoutRect(paintRect), BackgroundBleedNone); |
| 199 context.restore(); | 205 context.restore(); |
| 200 } | 206 } |
| 201 } | 207 } |
| 202 | 208 |
| 203 if (shouldDrawBackgroundInSeparateBuffer) | 209 if (shouldDrawBackgroundInSeparateBuffer) |
| 204 context.endLayer(); | 210 context.endLayer(); |
| 205 } | 211 } |
| 206 | 212 |
| 207 } // namespace blink | 213 } // namespace blink |
| OLD | NEW |