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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 m_isTrackingRasterInvalidations(client && | 103 m_isTrackingRasterInvalidations(client && |
104 client->isTrackingRasterInvalidations()), | 104 client->isTrackingRasterInvalidations()), |
105 m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip), | 105 m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip), |
106 m_parent(0), | 106 m_parent(0), |
107 m_maskLayer(0), | 107 m_maskLayer(0), |
108 m_contentsClippingMaskLayer(0), | 108 m_contentsClippingMaskLayer(0), |
109 m_paintCount(0), | 109 m_paintCount(0), |
110 m_contentsLayer(0), | 110 m_contentsLayer(0), |
111 m_contentsLayerId(0), | 111 m_contentsLayerId(0), |
112 m_scrollableArea(nullptr), | 112 m_scrollableArea(nullptr), |
113 m_renderingContext3d(0), | 113 m_renderingContext3d(0) { |
114 m_hasPreferredRasterBounds(false) { | |
115 #if DCHECK_IS_ON() | 114 #if DCHECK_IS_ON() |
116 if (m_client) | 115 if (m_client) |
117 m_client->verifyNotPainting(); | 116 m_client->verifyNotPainting(); |
118 #endif | 117 #endif |
119 m_contentLayerDelegate = WTF::makeUnique<ContentLayerDelegate>(this); | 118 m_contentLayerDelegate = WTF::makeUnique<ContentLayerDelegate>(this); |
120 m_layer = Platform::current()->compositorSupport()->createContentLayer( | 119 m_layer = Platform::current()->compositorSupport()->createContentLayer( |
121 m_contentLayerDelegate.get()); | 120 m_contentLayerDelegate.get()); |
122 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); | 121 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); |
123 m_layer->layer()->setLayerClient(this); | 122 m_layer->layer()->setLayerClient(this); |
124 } | 123 } |
(...skipping 18 matching lines...) Expand all Loading... |
143 LayoutRect GraphicsLayer::visualRect() const { | 142 LayoutRect GraphicsLayer::visualRect() const { |
144 LayoutRect bounds = LayoutRect(FloatPoint(), size()); | 143 LayoutRect bounds = LayoutRect(FloatPoint(), size()); |
145 bounds.move(offsetFromLayoutObjectWithSubpixelAccumulation()); | 144 bounds.move(offsetFromLayoutObjectWithSubpixelAccumulation()); |
146 return bounds; | 145 return bounds; |
147 } | 146 } |
148 | 147 |
149 void GraphicsLayer::setHasWillChangeTransformHint(bool hasWillChangeTransform) { | 148 void GraphicsLayer::setHasWillChangeTransformHint(bool hasWillChangeTransform) { |
150 m_layer->layer()->setHasWillChangeTransformHint(hasWillChangeTransform); | 149 m_layer->layer()->setHasWillChangeTransformHint(hasWillChangeTransform); |
151 } | 150 } |
152 | 151 |
153 void GraphicsLayer::setPreferredRasterBounds(const IntSize& bounds) { | |
154 m_preferredRasterBounds = bounds; | |
155 m_hasPreferredRasterBounds = true; | |
156 m_layer->layer()->setPreferredRasterBounds(bounds); | |
157 } | |
158 | |
159 void GraphicsLayer::clearPreferredRasterBounds() { | |
160 m_preferredRasterBounds = IntSize(); | |
161 m_hasPreferredRasterBounds = false; | |
162 m_layer->layer()->clearPreferredRasterBounds(); | |
163 } | |
164 | |
165 void GraphicsLayer::setParent(GraphicsLayer* layer) { | 152 void GraphicsLayer::setParent(GraphicsLayer* layer) { |
166 #if DCHECK_IS_ON() | 153 #if DCHECK_IS_ON() |
167 DCHECK(!layer || !layer->hasAncestor(this)); | 154 DCHECK(!layer || !layer->hasAncestor(this)); |
168 #endif | 155 #endif |
169 m_parent = layer; | 156 m_parent = layer; |
170 } | 157 } |
171 | 158 |
172 #if DCHECK_IS_ON() | 159 #if DCHECK_IS_ON() |
173 | 160 |
174 bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const { | 161 bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const { |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 json->setBoolean("drawsContent", m_drawsContent); | 659 json->setBoolean("drawsContent", m_drawsContent); |
673 | 660 |
674 if (!m_contentsVisible) | 661 if (!m_contentsVisible) |
675 json->setBoolean("contentsVisible", m_contentsVisible); | 662 json->setBoolean("contentsVisible", m_contentsVisible); |
676 | 663 |
677 if (!m_backfaceVisibility) { | 664 if (!m_backfaceVisibility) { |
678 json->setString("backfaceVisibility", | 665 json->setString("backfaceVisibility", |
679 m_backfaceVisibility ? "visible" : "hidden"); | 666 m_backfaceVisibility ? "visible" : "hidden"); |
680 } | 667 } |
681 | 668 |
682 if (m_hasPreferredRasterBounds) { | |
683 json->setArray("preferredRasterBounds", | |
684 sizeAsJSONArray(m_preferredRasterBounds)); | |
685 } | |
686 | |
687 if (flags & LayerTreeIncludesDebugInfo) | 669 if (flags & LayerTreeIncludesDebugInfo) |
688 json->setString("client", pointerAsString(m_client)); | 670 json->setString("client", pointerAsString(m_client)); |
689 | 671 |
690 if (m_backgroundColor.alpha()) { | 672 if (m_backgroundColor.alpha()) { |
691 json->setString("backgroundColor", | 673 json->setString("backgroundColor", |
692 m_backgroundColor.nameForLayoutTreeAsText()); | 674 m_backgroundColor.nameForLayoutTreeAsText()); |
693 } | 675 } |
694 | 676 |
695 if (!m_transform.isIdentity()) | 677 if (!m_transform.isIdentity()) |
696 json->setArray("transform", transformAsJSONArray(m_transform)); | 678 json->setArray("transform", transformAsJSONArray(m_transform)); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
1309 if (!layer) { | 1291 if (!layer) { |
1310 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1292 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
1311 return; | 1293 return; |
1312 } | 1294 } |
1313 | 1295 |
1314 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1296 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1315 LOG(INFO) << output.utf8().data(); | 1297 LOG(INFO) << output.utf8().data(); |
1316 } | 1298 } |
1317 #endif | 1299 #endif |
OLD | NEW |