Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/tiled_layer.h" | 7 #include "cc/tiled_layer.h" |
| 8 | 8 |
| 9 #include "cc/bitmap_content_layer_updater.h" | 9 #include "cc/bitmap_content_layer_updater.h" |
| 10 #include "cc/layer_painter.h" | 10 #include "cc/layer_painter.h" |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1161 TestOcclusionTracker occluded; | 1161 TestOcclusionTracker occluded; |
| 1162 | 1162 |
| 1163 // The tile size is 100x100. | 1163 // The tile size is 100x100. |
| 1164 | 1164 |
| 1165 // This makes sure the painting works when the content space is scaled to | 1165 // This makes sure the painting works when the content space is scaled to |
| 1166 // a different layer space. In this case tiles are scaled to be 200x200 | 1166 // a different layer space. In this case tiles are scaled to be 200x200 |
| 1167 // pixels, which means none should be occluded. | 1167 // pixels, which means none should be occluded. |
| 1168 layer->setContentsScale(0.5); | 1168 layer->setContentsScale(0.5); |
| 1169 layer->setBounds(IntSize(600, 600)); | 1169 layer->setBounds(IntSize(600, 600)); |
| 1170 WebTransformationMatrix drawTransform; | 1170 WebTransformationMatrix drawTransform; |
| 1171 drawTransform.scale(1 / layer->contentsScale()); | 1171 drawTransform.scale(1 / layer->contentsScaleX()); |
|
enne (OOO)
2012/10/29 19:19:41
Also assert that contentsScaleX == contentsScaleY,
wangxianzhu
2012/10/30 02:14:21
Done.
| |
| 1172 layer->setDrawTransform(drawTransform); | 1172 layer->setDrawTransform(drawTransform); |
| 1173 layer->setScreenSpaceTransform(drawTransform); | 1173 layer->setScreenSpaceTransform(drawTransform); |
| 1174 | 1174 |
| 1175 occluded.setOcclusion(IntRect(200, 200, 300, 100)); | 1175 occluded.setOcclusion(IntRect(200, 200, 300, 100)); |
| 1176 layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); | 1176 layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); |
| 1177 layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); | 1177 layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); |
| 1178 layer->invalidateContentRect(IntRect(0, 0, 600, 600)); | 1178 layer->invalidateContentRect(IntRect(0, 0, 600, 600)); |
| 1179 layer->setTexturePriorities(m_priorityCalculator); | 1179 layer->setTexturePriorities(m_priorityCalculator); |
| 1180 m_textureManager->prioritizeTextures(); | 1180 m_textureManager->prioritizeTextures(); |
| 1181 layer->update(*m_queue.get(), &occluded, m_stats); | 1181 layer->update(*m_queue.get(), &occluded, m_stats); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1619 updateTextures(); | 1619 updateTextures(); |
| 1620 | 1620 |
| 1621 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. | 1621 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. |
| 1622 layer->setNeedsDisplayRect(layerRect); | 1622 layer->setNeedsDisplayRect(layerRect); |
| 1623 layer->update(*m_queue.get(), 0, m_stats); | 1623 layer->update(*m_queue.get(), 0, m_stats); |
| 1624 | 1624 |
| 1625 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); | 1625 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); |
| 1626 } | 1626 } |
| 1627 | 1627 |
| 1628 } // namespace | 1628 } // namespace |
| OLD | NEW |