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 | 5 |
6 #include "config.h" | 6 #include "config.h" |
7 | 7 |
8 #include "CCLayerTreeHostCommon.h" | 8 #include "CCLayerTreeHostCommon.h" |
9 | 9 |
10 #include "CCLayerImpl.h" | 10 #include "CCLayerImpl.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 FloatPoint anchorPoint = layer->anchorPoint(); | 455 FloatPoint anchorPoint = layer->anchorPoint(); |
456 FloatPoint position = layer->position() - layer->scrollDelta(); | 456 FloatPoint position = layer->position() - layer->scrollDelta(); |
457 | 457 |
458 // Offset between anchor point and the center of the quad. | 458 // Offset between anchor point and the center of the quad. |
459 float centerOffsetX = (0.5 - anchorPoint.x()) * bounds.width(); | 459 float centerOffsetX = (0.5 - anchorPoint.x()) * bounds.width(); |
460 float centerOffsetY = (0.5 - anchorPoint.y()) * bounds.height(); | 460 float centerOffsetY = (0.5 - anchorPoint.y()) * bounds.height(); |
461 | 461 |
462 WebTransformationMatrix layerLocalTransform; | 462 WebTransformationMatrix layerLocalTransform; |
463 // LT = S[pageScaleDelta] | 463 // LT = S[pageScaleDelta] |
464 layerLocalTransform.scale(layer->pageScaleDelta()); | 464 layerLocalTransform.scale(layer->pageScaleDelta()); |
| 465 layerLocalTransform.scale(layer->pageScaleFactor()); |
| 466 layerLocalTransform.translate(layer->localOffset().width(), layer->localOffs
et().height()); |
465 // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] | 467 // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] |
466 layerLocalTransform.translate3d(position.x() + anchorPoint.x() * bounds.widt
h(), position.y() + anchorPoint.y() * bounds.height(), layer->anchorPointZ()); | 468 layerLocalTransform.translate3d(position.x() + anchorPoint.x() * bounds.widt
h(), position.y() + anchorPoint.y() * bounds.height(), layer->anchorPointZ()); |
467 // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] | 469 // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] |
468 layerLocalTransform.multiply(layer->transform()); | 470 layerLocalTransform.multiply(layer->transform()); |
469 // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] * Tr[a
nchor2center] | 471 // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] * Tr[a
nchor2center] |
470 layerLocalTransform.translate3d(centerOffsetX, centerOffsetY, -layer->anchor
PointZ()); | 472 layerLocalTransform.translate3d(centerOffsetX, centerOffsetY, -layer->anchor
PointZ()); |
471 | 473 |
472 WebTransformationMatrix combinedTransform = parentMatrix; | 474 WebTransformationMatrix combinedTransform = parentMatrix; |
473 combinedTransform.multiply(layerLocalTransform); | 475 combinedTransform.multiply(layerLocalTransform); |
474 | 476 |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 878 |
877 foundLayer = currentLayer; | 879 foundLayer = currentLayer; |
878 break; | 880 break; |
879 } | 881 } |
880 | 882 |
881 // This can potentially return 0, which means the viewportPoint did not succ
essfully hit test any layers, not even the root layer. | 883 // This can potentially return 0, which means the viewportPoint did not succ
essfully hit test any layers, not even the root layer. |
882 return foundLayer; | 884 return foundLayer; |
883 } | 885 } |
884 | 886 |
885 } // namespace WebCore | 887 } // namespace WebCore |
OLD | NEW |