Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/tabs/tab.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1649 | 1649 |
| 1650 // Extends the area to the bottom when the crash animation is in progress. | 1650 // Extends the area to the bottom when the crash animation is in progress. |
| 1651 if (crash_icon_animation_->is_animating()) | 1651 if (crash_icon_animation_->is_animating()) |
| 1652 bounds.set_height(height() - bounds.y()); | 1652 bounds.set_height(height() - bounds.y()); |
| 1653 bounds.set_x(GetMirroredXForRect(bounds)); | 1653 bounds.set_x(GetMirroredXForRect(bounds)); |
| 1654 SchedulePaintInRect(bounds); | 1654 SchedulePaintInRect(bounds); |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 void Tab::GetFillPath(float scale, SkPath* fill) const { | 1657 void Tab::GetFillPath(float scale, SkPath* fill) const { |
| 1658 const float right = width() * scale; | 1658 const float right = width() * scale; |
| 1659 const float bottom = height() * scale; | 1659 const float bottom = std::ceil(height() * scale); |
|
Peter Kasting
2016/06/21 23:54:10
Add a comment explaining this ceil() call as it's
Bret
2016/06/22 01:00:48
Done.
| |
| 1660 const float unscaled_endcap_width = GetUnscaledEndcapWidth(); | 1660 const float unscaled_endcap_width = GetUnscaledEndcapWidth(); |
| 1661 | 1661 |
| 1662 fill->moveTo(right - 1, bottom); | 1662 fill->moveTo(right - 1, bottom); |
| 1663 fill->rCubicTo(-0.75 * scale, 0, -1.625 * scale, -0.5 * scale, -2 * scale, | 1663 fill->rCubicTo(-0.75 * scale, 0, -1.625 * scale, -0.5 * scale, -2 * scale, |
| 1664 -1.5 * scale); | 1664 -1.5 * scale); |
| 1665 fill->lineTo(right - 1 - (unscaled_endcap_width - 2) * scale, 2.5 * scale); | 1665 fill->lineTo(right - 1 - (unscaled_endcap_width - 2) * scale, 2.5 * scale); |
| 1666 // Prevent overdraw in the center near minimum width (only happens if | 1666 // Prevent overdraw in the center near minimum width (only happens if |
| 1667 // scale < 2). We could instead avoid this by increasing the tab inset | 1667 // scale < 2). We could instead avoid this by increasing the tab inset |
| 1668 // values, but that would shift all the content inward as well, unless we | 1668 // values, but that would shift all the content inward as well, unless we |
| 1669 // then overlapped the content on the endcaps, by which point we'd have a | 1669 // then overlapped the content on the endcaps, by which point we'd have a |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1760 inactive_images_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER); | 1760 inactive_images_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER); |
| 1761 inactive_images_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT); | 1761 inactive_images_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT); |
| 1762 inactive_images_.l_width = inactive_images_.image_l->width(); | 1762 inactive_images_.l_width = inactive_images_.image_l->width(); |
| 1763 inactive_images_.r_width = inactive_images_.image_r->width(); | 1763 inactive_images_.r_width = inactive_images_.image_r->width(); |
| 1764 | 1764 |
| 1765 mask_images_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_LEFT); | 1765 mask_images_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_LEFT); |
| 1766 mask_images_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_RIGHT); | 1766 mask_images_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_RIGHT); |
| 1767 mask_images_.l_width = mask_images_.image_l->width(); | 1767 mask_images_.l_width = mask_images_.image_l->width(); |
| 1768 mask_images_.r_width = mask_images_.image_r->width(); | 1768 mask_images_.r_width = mask_images_.image_r->width(); |
| 1769 } | 1769 } |
| OLD | NEW |