OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 // FIXME: Not all cases in this method need both full layout and paint | 593 // FIXME: Not all cases in this method need both full layout and paint |
594 // invalidation. | 594 // invalidation. |
595 // Should move cases into DiffNeedsFullLayout() if | 595 // Should move cases into DiffNeedsFullLayout() if |
596 // - don't need paint invalidation at all; | 596 // - don't need paint invalidation at all; |
597 // - or the layoutObject knows how to exactly invalidate paints caused by the | 597 // - or the layoutObject knows how to exactly invalidate paints caused by the |
598 // layout change instead of forced full paint invalidation. | 598 // layout change instead of forced full paint invalidation. |
599 | 599 |
600 if (surround_data_.Get() != other.surround_data_.Get()) { | 600 if (surround_data_.Get() != other.surround_data_.Get()) { |
601 // If our border widths change, then we need to layout. Other changes to | 601 // If our border widths change, then we need to layout. Other changes to |
602 // borders only necessitate a paint invalidation. | 602 // borders only necessitate a paint invalidation. |
603 if (BorderLeftWidth() != other.BorderLeftWidth() || | 603 if (!(BorderWidthEquals(BorderLeftWidth(), other.BorderLeftWidth())) || |
604 BorderTopWidth() != other.BorderTopWidth() || | 604 !(BorderWidthEquals(BorderTopWidth(), other.BorderTopWidth())) || |
605 BorderBottomWidth() != other.BorderBottomWidth() || | 605 !(BorderWidthEquals(BorderBottomWidth(), other.BorderBottomWidth())) || |
606 BorderRightWidth() != other.BorderRightWidth()) | 606 !(BorderWidthEquals(BorderRightWidth(), other.BorderRightWidth()))) |
607 return true; | 607 return true; |
608 } | 608 } |
609 | 609 |
610 if (ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(other)) | 610 if (ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(other)) |
611 return true; | 611 return true; |
612 | 612 |
613 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { | 613 if (rare_non_inherited_data_.Get() != other.rare_non_inherited_data_.Get()) { |
614 if (rare_non_inherited_data_->appearance_ != | 614 if (rare_non_inherited_data_->appearance_ != |
615 other.rare_non_inherited_data_->appearance_ || | 615 other.rare_non_inherited_data_->appearance_ || |
616 rare_non_inherited_data_->margin_before_collapse != | 616 rare_non_inherited_data_->margin_before_collapse != |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 887 |
888 return false; | 888 return false; |
889 } | 889 } |
890 | 890 |
891 bool ComputedStyle::DiffNeedsPaintInvalidationObject( | 891 bool ComputedStyle::DiffNeedsPaintInvalidationObject( |
892 const ComputedStyle& other) const { | 892 const ComputedStyle& other) const { |
893 if (Visibility() != other.Visibility() || | 893 if (Visibility() != other.Visibility() || |
894 PrintColorAdjust() != other.PrintColorAdjust() || | 894 PrintColorAdjust() != other.PrintColorAdjust() || |
895 InsideLink() != other.InsideLink() || | 895 InsideLink() != other.InsideLink() || |
896 !Border().VisuallyEqual(other.Border()) || !RadiiEqual(other) || | 896 !Border().VisuallyEqual(other.Border()) || !RadiiEqual(other) || |
897 *background_data_ != *other.background_data_) | 897 !BorderSizeEquals(other) || *background_data_ != *other.background_data_) |
898 return true; | 898 return true; |
899 | 899 |
900 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { | 900 if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) { |
901 if (rare_inherited_data_->user_modify != | 901 if (rare_inherited_data_->user_modify != |
902 other.rare_inherited_data_->user_modify || | 902 other.rare_inherited_data_->user_modify || |
903 rare_inherited_data_->user_select != | 903 rare_inherited_data_->user_select != |
904 other.rare_inherited_data_->user_select || | 904 other.rare_inherited_data_->user_select || |
905 rare_inherited_data_->image_rendering_ != | 905 rare_inherited_data_->image_rendering_ != |
906 other.rare_inherited_data_->image_rendering_) | 906 other.rare_inherited_data_->image_rendering_) |
907 return true; | 907 return true; |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 if (value < 0) | 2510 if (value < 0) |
2511 fvalue -= 0.5f; | 2511 fvalue -= 0.5f; |
2512 else | 2512 else |
2513 fvalue += 0.5f; | 2513 fvalue += 0.5f; |
2514 } | 2514 } |
2515 | 2515 |
2516 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2516 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
2517 } | 2517 } |
2518 | 2518 |
2519 } // namespace blink | 2519 } // namespace blink |
OLD | NEW |