| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // pre-multiply any fixed-position layer's drawTransform to undo the scrollD
eltas -- as long as | 331 // pre-multiply any fixed-position layer's drawTransform to undo the scrollD
eltas -- as long as |
| 332 // that fixed position layer is fixed onto the same renderTarget as this scr
ollingLayer. | 332 // that fixed position layer is fixed onto the same renderTarget as this scr
ollingLayer. |
| 333 // | 333 // |
| 334 | 334 |
| 335 gfx::Transform partialLayerOriginTransform = parentMatrix; | 335 gfx::Transform partialLayerOriginTransform = parentMatrix; |
| 336 partialLayerOriginTransform.PreconcatTransform(scrollingLayer->implTransform
()); | 336 partialLayerOriginTransform.PreconcatTransform(scrollingLayer->implTransform
()); |
| 337 | 337 |
| 338 gfx::Transform scrollCompensationForThisLayer = partialLayerOriginTransform;
// Step 3 | 338 gfx::Transform scrollCompensationForThisLayer = partialLayerOriginTransform;
// Step 3 |
| 339 scrollCompensationForThisLayer.Translate(scrollingLayer->scrollDelta().x(),
scrollingLayer->scrollDelta().y()); // Step 2 | 339 scrollCompensationForThisLayer.Translate(scrollingLayer->scrollDelta().x(),
scrollingLayer->scrollDelta().y()); // Step 2 |
| 340 | 340 |
| 341 gfx::Vector2dF desktopCompatibilityViewportDelta = scrollingLayer->desktopCo
mpatibilityViewportOffsetFromScrollPositionDelta(); |
| 342 scrollCompensationForThisLayer.Translate(desktopCompatibilityViewportDelta.x
(), desktopCompatibilityViewportDelta.y()); |
| 343 |
| 344 { |
| 345 gfx::Vector2dF tmp = scrollingLayer->desktopCompatibilityViewportOffsetF
romScrollPosition(); |
| 346 gfx::Vector2dF tmp2 = scrollingLayer->desktopCompatibilityViewportOffset
FromScrollPositionDelta(); |
| 347 fprintf (stderr, "offset: %f %f\n", tmp.x(), tmp.y()); |
| 348 fprintf (stderr, "delta : %f %f\n", tmp2.x(), tmp2.y()); |
| 349 } |
| 350 |
| 341 gfx::Transform inversePartialLayerOriginTransform(gfx::Transform::kSkipIniti
alization); | 351 gfx::Transform inversePartialLayerOriginTransform(gfx::Transform::kSkipIniti
alization); |
| 342 if (!partialLayerOriginTransform.GetInverse(&inversePartialLayerOriginTransf
orm)) { | 352 if (!partialLayerOriginTransform.GetInverse(&inversePartialLayerOriginTransf
orm)) { |
| 343 // TODO(shawnsingh): Either we need to handle uninvertible transforms | 353 // TODO(shawnsingh): Either we need to handle uninvertible transforms |
| 344 // here, or DCHECK that the transform is invertible. | 354 // here, or DCHECK that the transform is invertible. |
| 345 } | 355 } |
| 346 scrollCompensationForThisLayer.PreconcatTransform(inversePartialLayerOriginT
ransform); // Step 1 | 356 scrollCompensationForThisLayer.PreconcatTransform(inversePartialLayerOriginT
ransform); // Step 1 |
| 347 return scrollCompensationForThisLayer; | 357 return scrollCompensationForThisLayer; |
| 348 } | 358 } |
| 349 | 359 |
| 350 gfx::Transform computeScrollCompensationMatrixForChildren(Layer* currentLayer, c
onst gfx::Transform& currentParentMatrix, const gfx::Transform& currentScrollCom
pensation) | 360 gfx::Transform computeScrollCompensationMatrixForChildren(Layer* currentLayer, c
onst gfx::Transform& currentParentMatrix, const gfx::Transform& currentScrollCom
pensation) |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 | 1193 |
| 1184 // At this point, we think the point does hit the touch event handler region o
n the layer, but we need to walk up | 1194 // At this point, we think the point does hit the touch event handler region o
n the layer, but we need to walk up |
| 1185 // the parents to ensure that the layer was not clipped in such a way that the | 1195 // the parents to ensure that the layer was not clipped in such a way that the |
| 1186 // hit point actually should not hit the layer. | 1196 // hit point actually should not hit the layer. |
| 1187 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) | 1197 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) |
| 1188 return false; | 1198 return false; |
| 1189 | 1199 |
| 1190 return true; | 1200 return true; |
| 1191 } | 1201 } |
| 1192 } // namespace cc | 1202 } // namespace cc |
| OLD | NEW |