summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2018-10-19 13:26:05 +0200
committerMichael BrĂ¼ning <michael.bruning@qt.io>2018-11-05 15:37:03 +0000
commit5d514fa9baf044e77594471e1dce04e7c93e83cd (patch)
treea0c24642deaf6c062f510280bf139808fff3cac8
parent8a39f81276fe83e66bd0955cefadd620c591c3fb (diff)
[Backport][Blink/SPv175+] Change DCHECK(chunk clip escaped layer clip) to a DLOG
This is a scaled-back version of a same-named previous CL. This version only converts the DCHECK into a DLOG, but keep the not-so-robust error recovery algorithm as-is. The PaintChunkToCcLayer algorithm was originally designed for SPv2 compositor, and it was expected the layerization algorithm should never assign a chunk to a excessively clipped layer, thus the DCHECK. Later this algorithm was adopted in SPv175 to be used with the SPv1 compositor. There is a known bug that in certain corner case we can fail to escape clip, and the bug is difficult to fix in the legacy architecture. The DCHECK is expected to be a "soft" one that we have a fail-safe path to recover in a sane way. BUG=881788,853357 Reviewed-on: https://chromium-review.googlesource.com/1227062 Change-Id: Ifacb936064536c44bc544fa89de6e4d699d65f1d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp b/chromium/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp
index 512fcc2884d..8a4c647abcb 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp
+++ b/chromium/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayer.cpp
@@ -174,12 +174,22 @@ void ConversionContext::SwitchToClip(const ClipPaintPropertyNode* target_clip) {
const ClipPaintPropertyNode* lca_clip =
&LowestCommonAncestor(*target_clip, *current_clip_);
while (current_clip_ != lca_clip) {
- DCHECK(state_stack_.size() &&
- state_stack_.back().type == StateEntry::PairedType::kClip)
- << "Error: Chunk has a clip that escaped its effect's clip.";
- if (!state_stack_.size() ||
- state_stack_.back().type != StateEntry::PairedType::kClip)
+ if (!state_stack_.size() || state_stack_.back().type != StateEntry::PairedType::kClip) {
+#if DCHECK_IS_ON()
+ DLOG(ERROR) << "Error: Chunk has a clip that escaped its layer's or "
+ "effect's clip."
+ << "\ntarget_clip:\n"
+ << target_clip->ToTreeString().Utf8().data()
+ << "current_clip_:\n"
+ << current_clip_->ToTreeString().Utf8().data();
+#endif
+ // This bug is known to happen in SPv1 due to some clip-escaping corner
+ // cases that are very difficult to fix in legacy architecture.
+ // In SPv2 this should never happen.
+ if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
+ NOTREACHED();
break;
+ }
StateEntry& previous_state = state_stack_.back();
current_transform_ = previous_state.transform;
current_clip_ = previous_state.clip;