| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 LayoutPoint& offset_from_composited_ancestor, | 885 LayoutPoint& offset_from_composited_ancestor, |
| 886 IntPoint& snapped_offset_from_composited_ancestor) { | 886 IntPoint& snapped_offset_from_composited_ancestor) { |
| 887 LayoutRect local_raw_compositing_bounds = CompositedBounds(); | 887 LayoutRect local_raw_compositing_bounds = CompositedBounds(); |
| 888 offset_from_composited_ancestor = ComputeOffsetFromCompositedAncestor( | 888 offset_from_composited_ancestor = ComputeOffsetFromCompositedAncestor( |
| 889 &owning_layer_, composited_ancestor, | 889 &owning_layer_, composited_ancestor, |
| 890 local_raw_compositing_bounds.Location()); | 890 local_raw_compositing_bounds.Location()); |
| 891 snapped_offset_from_composited_ancestor = | 891 snapped_offset_from_composited_ancestor = |
| 892 IntPoint(offset_from_composited_ancestor.X().Round(), | 892 IntPoint(offset_from_composited_ancestor.X().Round(), |
| 893 offset_from_composited_ancestor.Y().Round()); | 893 offset_from_composited_ancestor.Y().Round()); |
| 894 | 894 |
| 895 LayoutSize subpixel_accumulation = | 895 LayoutSize subpixel_accumulation; |
| 896 offset_from_composited_ancestor - snapped_offset_from_composited_ancestor; | 896 if (!owning_layer_.Transform() || |
| 897 owning_layer_.Transform()->IsIdentityOrTranslation()) { |
| 898 subpixel_accumulation = offset_from_composited_ancestor - |
| 899 snapped_offset_from_composited_ancestor; |
| 900 } |
| 901 // Otherwise discard the sub-pixel remainder because paint offset can't be |
| 902 // transformed by a non-translation transform. |
| 897 owning_layer_.SetSubpixelAccumulation(subpixel_accumulation); | 903 owning_layer_.SetSubpixelAccumulation(subpixel_accumulation); |
| 898 | 904 |
| 899 // Move the bounds by the subpixel accumulation so that it pixel-snaps | 905 // Move the bounds by the subpixel accumulation so that it pixel-snaps |
| 900 // relative to absolute pixels instead of local coordinates. | 906 // relative to absolute pixels instead of local coordinates. |
| 901 local_raw_compositing_bounds.Move(subpixel_accumulation); | 907 local_raw_compositing_bounds.Move(subpixel_accumulation); |
| 902 local_bounds = PixelSnappedIntRect(local_raw_compositing_bounds); | 908 local_bounds = PixelSnappedIntRect(local_raw_compositing_bounds); |
| 903 | 909 |
| 904 compositing_bounds_relative_to_composited_ancestor = local_bounds; | 910 compositing_bounds_relative_to_composited_ancestor = local_bounds; |
| 905 compositing_bounds_relative_to_composited_ancestor.MoveBy( | 911 compositing_bounds_relative_to_composited_ancestor.MoveBy( |
| 906 snapped_offset_from_composited_ancestor); | 912 snapped_offset_from_composited_ancestor); |
| (...skipping 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3615 } else if (graphics_layer == decoration_outline_layer_.get()) { | 3621 } else if (graphics_layer == decoration_outline_layer_.get()) { |
| 3616 name = "Decoration Layer"; | 3622 name = "Decoration Layer"; |
| 3617 } else { | 3623 } else { |
| 3618 NOTREACHED(); | 3624 NOTREACHED(); |
| 3619 } | 3625 } |
| 3620 | 3626 |
| 3621 return name; | 3627 return name; |
| 3622 } | 3628 } |
| 3623 | 3629 |
| 3624 } // namespace blink | 3630 } // namespace blink |
| OLD | NEW |