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 "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/heads_up_display_layer_impl.h" | 10 #include "cc/heads_up_display_layer_impl.h" |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 724 layerDrawProperties.screen_space_transform = fullHierarchyMatrix; | 724 layerDrawProperties.screen_space_transform = fullHierarchyMatrix; |
| 725 if (!layer->preserves3D()) | 725 if (!layer->preserves3D()) |
| 726 layerDrawProperties.screen_space_transform.FlattenTo2d(); | 726 layerDrawProperties.screen_space_transform.FlattenTo2d(); |
| 727 layerDrawProperties.screen_space_transform.PreconcatTransform(layerDrawPrope rties.target_space_transform); | 727 layerDrawProperties.screen_space_transform.PreconcatTransform(layerDrawPrope rties.target_space_transform); |
| 728 | 728 |
| 729 // Adjusting text AA method during animation may cause repaints, which in-tu rn causes jank. | 729 // Adjusting text AA method during animation may cause repaints, which in-tu rn causes jank. |
| 730 bool adjustTextAA = !animatingOpacityToScreen && !animatingTransformToScreen ; | 730 bool adjustTextAA = !animatingOpacityToScreen && !animatingTransformToScreen ; |
| 731 // To avoid color fringing, LCD text should only be used on opaque layers wi th just integral translation. | 731 // To avoid color fringing, LCD text should only be used on opaque layers wi th just integral translation. |
| 732 bool layerCanUseLCDText = subtreeCanUseLCDText && | 732 bool layerCanUseLCDText = subtreeCanUseLCDText && |
| 733 (accumulatedDrawOpacity == 1.0) && | 733 (accumulatedDrawOpacity == 1.0) && |
| 734 layerDrawProperties.target_space_transform.IsIdent ityOrIntegerTranslation(); | 734 layerDrawProperties.target_space_transform.IsAlmos tIdentityOrIntegerTranslation(); |
|
alokp
2013/03/08 19:40:06
If you make a decision based on rounded transform,
Xianzhu
2013/03/08 23:36:56
Do you have experience about how much pixel displa
| |
| 735 | 735 |
| 736 gfx::RectF contentRect(gfx::PointF(), layer->contentBounds()); | 736 gfx::RectF contentRect(gfx::PointF(), layer->contentBounds()); |
| 737 | 737 |
| 738 // fullHierarchyMatrix is the matrix that transforms objects between screen space (except projection matrix) and the most recent RenderSurfaceImpl's space. | 738 // fullHierarchyMatrix is the matrix that transforms objects between screen space (except projection matrix) and the most recent RenderSurfaceImpl's space. |
| 739 // nextHierarchyMatrix will only change if this layer uses a new RenderSurfa ceImpl, otherwise remains the same. | 739 // nextHierarchyMatrix will only change if this layer uses a new RenderSurfa ceImpl, otherwise remains the same. |
| 740 gfx::Transform nextHierarchyMatrix = fullHierarchyMatrix; | 740 gfx::Transform nextHierarchyMatrix = fullHierarchyMatrix; |
| 741 gfx::Transform sublayerMatrix; | 741 gfx::Transform sublayerMatrix; |
| 742 | 742 |
| 743 gfx::Vector2dF renderSurfaceSublayerScale = MathUtil::computeTransform2dScal eComponents(combinedTransform, deviceScaleFactor * pageScaleFactor); | 743 gfx::Vector2dF renderSurfaceSublayerScale = MathUtil::computeTransform2dScal eComponents(combinedTransform, deviceScaleFactor * pageScaleFactor); |
| 744 | 744 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1214 | 1214 |
| 1215 // At this point, we think the point does hit the touch event handler region o n the layer, but we need to walk up | 1215 // At this point, we think the point does hit the touch event handler region o n the layer, but we need to walk up |
| 1216 // the parents to ensure that the layer was not clipped in such a way that the | 1216 // the parents to ensure that the layer was not clipped in such a way that the |
| 1217 // hit point actually should not hit the layer. | 1217 // hit point actually should not hit the layer. |
| 1218 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) | 1218 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) |
| 1219 return false; | 1219 return false; |
| 1220 | 1220 |
| 1221 return true; | 1221 return true; |
| 1222 } | 1222 } |
| 1223 } // namespace cc | 1223 } // namespace cc |
| OLD | NEW |