OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G
raphicsLayerClient* client) | 75 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G
raphicsLayerClient* client) |
76 { | 76 { |
77 return factory->createGraphicsLayer(client); | 77 return factory->createGraphicsLayer(client); |
78 } | 78 } |
79 | 79 |
80 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client) | 80 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client) |
81 : m_client(client) | 81 : m_client(client) |
82 , m_anchorPoint(0.5f, 0.5f, 0) | 82 , m_anchorPoint(0.5f, 0.5f, 0) |
83 , m_opacity(1) | 83 , m_opacity(1) |
84 , m_zPosition(0) | 84 , m_zPosition(0) |
| 85 , m_blendMode(blink::WebBlendModeNormal) |
85 , m_contentsOpaque(false) | 86 , m_contentsOpaque(false) |
86 , m_preserves3D(false) | 87 , m_preserves3D(false) |
87 , m_backfaceVisibility(true) | 88 , m_backfaceVisibility(true) |
88 , m_masksToBounds(false) | 89 , m_masksToBounds(false) |
89 , m_drawsContent(false) | 90 , m_drawsContent(false) |
90 , m_contentsVisible(true) | 91 , m_contentsVisible(true) |
| 92 , m_isRootForIsolatedGroup(false) |
91 , m_hasScrollParent(false) | 93 , m_hasScrollParent(false) |
92 , m_hasClipParent(false) | 94 , m_hasClipParent(false) |
93 , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip) | 95 , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip) |
94 , m_contentsOrientation(CompositingCoordinatesTopDown) | 96 , m_contentsOrientation(CompositingCoordinatesTopDown) |
95 , m_parent(0) | 97 , m_parent(0) |
96 , m_maskLayer(0) | 98 , m_maskLayer(0) |
97 , m_contentsClippingMaskLayer(0) | 99 , m_contentsClippingMaskLayer(0) |
98 , m_replicaLayer(0) | 100 , m_replicaLayer(0) |
99 , m_replicatedLayer(0) | 101 , m_replicatedLayer(0) |
100 , m_paintCount(0) | 102 , m_paintCount(0) |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 if (m_size != IntSize()) { | 604 if (m_size != IntSize()) { |
603 writeIndent(ts, indent + 1); | 605 writeIndent(ts, indent + 1); |
604 ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n"; | 606 ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n"; |
605 } | 607 } |
606 | 608 |
607 if (m_opacity != 1) { | 609 if (m_opacity != 1) { |
608 writeIndent(ts, indent + 1); | 610 writeIndent(ts, indent + 1); |
609 ts << "(opacity " << m_opacity << ")\n"; | 611 ts << "(opacity " << m_opacity << ")\n"; |
610 } | 612 } |
611 | 613 |
| 614 if (m_blendMode != blink::WebBlendModeNormal) { |
| 615 writeIndent(ts, indent + 1); |
| 616 ts << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blen
dMode) << ")\n"; |
| 617 } |
| 618 |
| 619 if (m_isRootForIsolatedGroup) { |
| 620 writeIndent(ts, indent + 1); |
| 621 ts << "(isolate " << m_isRootForIsolatedGroup << ")\n"; |
| 622 } |
| 623 |
612 if (m_contentsOpaque) { | 624 if (m_contentsOpaque) { |
613 writeIndent(ts, indent + 1); | 625 writeIndent(ts, indent + 1); |
614 ts << "(contentsOpaque " << m_contentsOpaque << ")\n"; | 626 ts << "(contentsOpaque " << m_contentsOpaque << ")\n"; |
615 } | 627 } |
616 | 628 |
617 if (m_preserves3D) { | 629 if (m_preserves3D) { |
618 writeIndent(ts, indent + 1); | 630 writeIndent(ts, indent + 1); |
619 ts << "(preserves3D " << m_preserves3D << ")\n"; | 631 ts << "(preserves3D " << m_preserves3D << ")\n"; |
620 } | 632 } |
621 | 633 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 m_layer->setDoubleSided(m_backfaceVisibility); | 950 m_layer->setDoubleSided(m_backfaceVisibility); |
939 } | 951 } |
940 | 952 |
941 void GraphicsLayer::setOpacity(float opacity) | 953 void GraphicsLayer::setOpacity(float opacity) |
942 { | 954 { |
943 float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f); | 955 float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f); |
944 m_opacity = clampedOpacity; | 956 m_opacity = clampedOpacity; |
945 platformLayer()->setOpacity(opacity); | 957 platformLayer()->setOpacity(opacity); |
946 } | 958 } |
947 | 959 |
| 960 void GraphicsLayer::setBlendMode(blink::WebBlendMode blendMode) |
| 961 { |
| 962 if (m_blendMode == blendMode) |
| 963 return; |
| 964 m_blendMode = blendMode; |
| 965 platformLayer()->setBlendMode(blink::WebBlendMode(blendMode)); |
| 966 } |
| 967 |
| 968 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated) |
| 969 { |
| 970 if (m_isRootForIsolatedGroup == isolated) |
| 971 return; |
| 972 m_isRootForIsolatedGroup = isolated; |
| 973 platformLayer()->setIsRootForIsolatedGroup(isolated); |
| 974 } |
| 975 |
948 void GraphicsLayer::setContentsNeedsDisplay() | 976 void GraphicsLayer::setContentsNeedsDisplay() |
949 { | 977 { |
950 if (WebLayer* contentsLayer = contentsLayerIfRegistered()) { | 978 if (WebLayer* contentsLayer = contentsLayerIfRegistered()) { |
951 contentsLayer->invalidate(); | 979 contentsLayer->invalidate(); |
952 addRepaintRect(contentsRect()); | 980 addRepaintRect(contentsRect()); |
953 } | 981 } |
954 } | 982 } |
955 | 983 |
956 void GraphicsLayer::setNeedsDisplay() | 984 void GraphicsLayer::setNeedsDisplay() |
957 { | 985 { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 #ifndef NDEBUG | 1252 #ifndef NDEBUG |
1225 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) | 1253 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) |
1226 { | 1254 { |
1227 if (!layer) | 1255 if (!layer) |
1228 return; | 1256 return; |
1229 | 1257 |
1230 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); | 1258 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); |
1231 fprintf(stderr, "%s\n", output.utf8().data()); | 1259 fprintf(stderr, "%s\n", output.utf8().data()); |
1232 } | 1260 } |
1233 #endif | 1261 #endif |
OLD | NEW |