| 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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 setBodyInnerHTML( | 1053 setBodyInnerHTML( |
| 1054 "<div id='target' style='background: blue; opacity: 0.1'></div>"); | 1054 "<div id='target' style='background: blue; opacity: 0.1'></div>"); |
| 1055 PaintLayer* targetLayer = | 1055 PaintLayer* targetLayer = |
| 1056 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); | 1056 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); |
| 1057 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), | 1057 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), |
| 1058 GlobalPaintNormalPhase, LayoutSize()); | 1058 GlobalPaintNormalPhase, LayoutSize()); |
| 1059 EXPECT_FALSE( | 1059 EXPECT_FALSE( |
| 1060 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); | 1060 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 TEST_P(PaintLayerPainterTest, DoPaintWithEffectAnimationZeroOpacity) { |
| 1064 setBodyInnerHTML( |
| 1065 "<style> " |
| 1066 "div { " |
| 1067 " width: 100px; " |
| 1068 " height: 100px; " |
| 1069 " animation-name: example; " |
| 1070 " animation-duration: 4s; " |
| 1071 "} " |
| 1072 "@keyframes example { " |
| 1073 " from { opacity: 0.0;} " |
| 1074 " to { opacity: 1.0;} " |
| 1075 "} " |
| 1076 "</style> " |
| 1077 "<div id='target'></div>"); |
| 1078 PaintLayer* targetLayer = |
| 1079 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); |
| 1080 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), |
| 1081 GlobalPaintNormalPhase, LayoutSize()); |
| 1082 EXPECT_FALSE( |
| 1083 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1084 } |
| 1085 |
| 1086 TEST_P(PaintLayerPainterTest, DoPaintWithTransformAnimationZeroOpacity) { |
| 1087 setBodyInnerHTML( |
| 1088 "<style> " |
| 1089 "div#target { " |
| 1090 " animation-name: example; " |
| 1091 " animation-duration: 4s; " |
| 1092 " opacity: 0.0; " |
| 1093 "} " |
| 1094 "@keyframes example { " |
| 1095 " from { transform: translate(0px, 0px); } " |
| 1096 " to { transform: translate(3em, 0px); } " |
| 1097 "} " |
| 1098 "</style> " |
| 1099 "<div id='target'>x</div></div>"); |
| 1100 PaintLayer* targetLayer = |
| 1101 toLayoutBox(getLayoutObjectByElementId("target"))->layer(); |
| 1102 PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(), |
| 1103 GlobalPaintNormalPhase, LayoutSize()); |
| 1104 EXPECT_FALSE( |
| 1105 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1106 } |
| 1107 |
| 1063 } // namespace blink | 1108 } // namespace blink |
| OLD | NEW |