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 "cc/layer_tree_host_common.h" | 5 #include "cc/layer_tree_host_common.h" |
6 | 6 |
7 #include "cc/layer.h" | 7 #include "cc/layer.h" |
8 #include "cc/layer_impl.h" | 8 #include "cc/layer_impl.h" |
9 #include "cc/layer_iterator.h" | 9 #include "cc/layer_iterator.h" |
10 #include "cc/layer_sorter.h" | 10 #include "cc/layer_sorter.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // The draw transform for the layer is: | 436 // The draw transform for the layer is: |
437 // M[draw] = M[parent] * Tr[origin] * compositeLayerTransform * S[lay
er2content] | 437 // M[draw] = M[parent] * Tr[origin] * compositeLayerTransform * S[lay
er2content] |
438 // = M[parent] * Tr[layer->position() + anchor] * M[layer] *
Tr[anchor2origin] * S[layer2content] | 438 // = M[parent] * Tr[layer->position() + anchor] * M[layer] *
Tr[anchor2origin] * S[layer2content] |
439 // | 439 // |
440 // Interpreting the math left-to-right, this transforms from the laye
r's render surface to the origin of the layer in content space. | 440 // Interpreting the math left-to-right, this transforms from the laye
r's render surface to the origin of the layer in content space. |
441 // | 441 // |
442 // The screen space transform is: | 442 // The screen space transform is: |
443 // M[screenspace] = M[root] * Tr[origin] * compositeLayerTransform *
S[layer2content] | 443 // M[screenspace] = M[root] * Tr[origin] * compositeLayerTransform *
S[layer2content] |
444 // = M[root] * Tr[layer->position() + anchor] * M[laye
r] * Tr[anchor2origin] * S[layer2content] | 444 // = M[root] * Tr[layer->position() + anchor] * M[laye
r] * Tr[anchor2origin] * S[layer2content] |
445 // | 445 // |
446 // Interpreting the math left-to-right, this transforms from the root
render surface's content space to the local layer's origin in layer space. | 446 // Interpreting the math left-to-right, this transforms from the root
render surface's content space to the origin of the layer in content space. |
447 // | 447 // |
448 // The transform hierarchy that is passed on to children (i.e. the child's p
arentMatrix) is: | 448 // The transform hierarchy that is passed on to children (i.e. the child's p
arentMatrix) is: |
449 // M[parent]_for_child = M[parent] * Tr[origin] * compositeLayerTrans
form * compositeSublayerTransform | 449 // M[parent]_for_child = M[parent] * Tr[origin] * compositeLayerTrans
form * compositeSublayerTransform |
450 // = M[parent] * Tr[layer->position() + anchor] *
M[layer] * Tr[anchor2origin] * compositeSublayerTransform | 450 // = M[parent] * Tr[layer->position() + anchor] *
M[layer] * Tr[anchor2origin] * compositeSublayerTransform |
451 // | 451 // |
452 // and a similar matrix for the full hierarchy with respect to the ro
ot. | 452 // and a similar matrix for the full hierarchy with respect to the ro
ot. |
453 // | 453 // |
454 // Finally, note that the final matrix used by the shader for the layer is P
* M[draw] * S . This final product | 454 // Finally, note that the final matrix used by the shader for the layer is P
* M[draw] * S . This final product |
455 // is computed in drawTexturedQuad(), where: | 455 // is computed in drawTexturedQuad(), where: |
456 // P is the projection matrix | 456 // P is the projection matrix |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 | 926 |
927 foundLayer = currentLayer; | 927 foundLayer = currentLayer; |
928 break; | 928 break; |
929 } | 929 } |
930 | 930 |
931 // This can potentially return 0, which means the screenSpacePoint did not s
uccessfully hit test any layers, not even the root layer. | 931 // This can potentially return 0, which means the screenSpacePoint did not s
uccessfully hit test any layers, not even the root layer. |
932 return foundLayer; | 932 return foundLayer; |
933 } | 933 } |
934 | 934 |
935 } // namespace cc | 935 } // namespace cc |
OLD | NEW |