| 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 "platform/graphics/CompositingReasons.h" | 5 #include "platform/graphics/CompositingReasons.h" |
| 6 | 6 |
| 7 #include "wtf/StdLibExtras.h" | 7 #include "wtf/StdLibExtras.h" |
| 8 #include "wtf/text/StringBuilder.h" | 8 #include "wtf/text/StringBuilder.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 "composited layer tree"}, | 134 "composited layer tree"}, |
| 135 {CompositingReasonLayerForScrollingBlockSelection, | 135 {CompositingReasonLayerForScrollingBlockSelection, |
| 136 "layerForScrollingBlockSelection", | 136 "layerForScrollingBlockSelection", |
| 137 "Secondary layer, to house block selection gaps for composited scrolling " | 137 "Secondary layer, to house block selection gaps for composited scrolling " |
| 138 "with no scrolling contents"}, | 138 "with no scrolling contents"}, |
| 139 {CompositingReasonLayerForDecoration, "layerForDecoration", | 139 {CompositingReasonLayerForDecoration, "layerForDecoration", |
| 140 "Layer painted on top of other layers as decoration"}, | 140 "Layer painted on top of other layers as decoration"}, |
| 141 {CompositingReasonInlineTransform, "inlineTransform", | 141 {CompositingReasonInlineTransform, "inlineTransform", |
| 142 "Has an inline transform, which causes subsequent layers to assume " | 142 "Has an inline transform, which causes subsequent layers to assume " |
| 143 "overlap"}, | 143 "overlap"}, |
| 144 {CompositingReasonSkewWithCompositedSkewedAncestor, |
| 145 "layerForSkewWithCompositedSkewedAncestor", |
| 146 "Has skewed text in promoted skewed ancestor which causes blurriness " |
| 147 "without separately compositing"}, |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 const size_t kNumberOfCompositingReasons = | 150 const size_t kNumberOfCompositingReasons = |
| 147 WTF_ARRAY_LENGTH(kCompositingReasonStringMap); | 151 WTF_ARRAY_LENGTH(kCompositingReasonStringMap); |
| 148 | 152 |
| 149 String compositingReasonsAsString(CompositingReasons reasons) { | 153 String compositingReasonsAsString(CompositingReasons reasons) { |
| 150 if (!reasons) | 154 if (!reasons) |
| 151 return "none"; | 155 return "none"; |
| 152 | 156 |
| 153 StringBuilder builder; | 157 StringBuilder builder; |
| 154 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { | 158 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { |
| 155 if (reasons & kCompositingReasonStringMap[i].reason) { | 159 if (reasons & kCompositingReasonStringMap[i].reason) { |
| 156 if (builder.length()) | 160 if (builder.length()) |
| 157 builder.append(','); | 161 builder.append(','); |
| 158 builder.append(kCompositingReasonStringMap[i].shortName); | 162 builder.append(kCompositingReasonStringMap[i].shortName); |
| 159 } | 163 } |
| 160 } | 164 } |
| 161 return builder.toString(); | 165 return builder.toString(); |
| 162 } | 166 } |
| 163 | 167 |
| 164 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |