| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBoxModelObject.h" | 7 #include "core/layout/LayoutBoxModelObject.h" |
| 8 #include "core/layout/compositing/CompositedLayerMapping.h" | 8 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 9 #include "core/paint/PaintControllerPaintTest.h" | 9 #include "core/paint/PaintControllerPaintTest.h" |
| 10 #include "platform/graphics/GraphicsContext.h" | 10 #include "platform/graphics/GraphicsContext.h" |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 "</style> " | 1076 "</style> " |
| 1077 "<div id='target'></div>"); | 1077 "<div id='target'></div>"); |
| 1078 PaintLayer* targetLayer = | 1078 PaintLayer* targetLayer = |
| 1079 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); | 1079 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); |
| 1080 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), | 1080 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), |
| 1081 GlobalPaintNormalPhase, LayoutSize()); | 1081 GlobalPaintNormalPhase, LayoutSize()); |
| 1082 EXPECT_FALSE( | 1082 EXPECT_FALSE( |
| 1083 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); | 1083 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 TEST_P(PaintLayerPainterTest, DoPaintWithTransformAnimationZeroOpacity) { | 1086 TEST_P(PaintLayerPainterTest, DoNotPaintWithTransformAnimationZeroOpacity) { |
| 1087 setBodyInnerHTML( | 1087 setBodyInnerHTML( |
| 1088 "<style> " | 1088 "<style> " |
| 1089 "div#target { " | 1089 "div#target { " |
| 1090 " animation-name: example; " | 1090 " animation-name: example; " |
| 1091 " animation-duration: 4s; " | 1091 " animation-duration: 4s; " |
| 1092 " opacity: 0.0; " | 1092 " opacity: 0.0; " |
| 1093 "} " | 1093 "} " |
| 1094 "@keyframes example { " | 1094 "@keyframes example { " |
| 1095 " from { transform: translate(0px, 0px); } " | 1095 " from { transform: translate(0px, 0px); } " |
| 1096 " to { transform: translate(3em, 0px); } " | 1096 " to { transform: translate(3em, 0px); } " |
| 1097 "} " | 1097 "} " |
| 1098 "</style> " | 1098 "</style> " |
| 1099 "<div id='target'>x</div></div>"); | 1099 "<div id='target'>x</div></div>"); |
| 1100 PaintLayer* targetLayer = | 1100 PaintLayer* targetLayer = |
| 1101 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); | 1101 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); |
| 1102 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), | 1102 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), |
| 1103 GlobalPaintNormalPhase, LayoutSize()); | 1103 GlobalPaintNormalPhase, LayoutSize()); |
| 1104 EXPECT_FALSE( | 1104 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 1105 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); | 1105 EXPECT_TRUE( |
| 1106 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1107 } else { |
| 1108 EXPECT_FALSE( |
| 1109 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1110 } |
| 1106 } | 1111 } |
| 1107 | 1112 |
| 1108 } // namespace blink | 1113 } // namespace blink |
| OLD | NEW |