Chromium Code Reviews| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 | 63 |
| 64 struct SameSizeAsBorderValue { | 64 struct SameSizeAsBorderValue { |
| 65 RGBA32 m_color; | 65 RGBA32 m_color; |
| 66 unsigned m_bitfield; | 66 unsigned m_bitfield; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 ASSERT_SIZE(BorderValue, SameSizeAsBorderValue); | 69 ASSERT_SIZE(BorderValue, SameSizeAsBorderValue); |
| 70 | 70 |
| 71 // Since different compilers/architectures pack ComputedStyle differently, | 71 // Since different compilers/architectures pack ComputedStyle differently, |
| 72 // re-create the same structure for an accurate size comparison. | 72 // re-create the same structure for an accurate size comparison. |
| 73 struct SameSizeAsComputedStyle : public ComputedStyleBase, | 73 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { |
| 74 public RefCounted<ComputedStyle> { | 74 struct ComputedStyleBase { |
| 75 unsigned m_bitfields[3]; | |
| 76 } m_base; | |
| 77 | |
| 75 void* dataRefs[7]; | 78 void* dataRefs[7]; |
| 76 void* ownPtrs[1]; | 79 void* ownPtrs[1]; |
| 77 void* dataRefSvgStyle; | 80 void* dataRefSvgStyle; |
| 78 | 81 |
| 79 struct InheritedData { | 82 struct InheritedData { |
| 80 unsigned m_bitfields[1]; | 83 unsigned m_bitfields[1]; |
| 81 } m_inheritedData; | 84 } m_inheritedData; |
| 82 | 85 |
| 83 struct NonInheritedData { | 86 struct NonInheritedData { |
| 84 unsigned m_bitfields[2]; | 87 unsigned m_bitfields[2]; |
| 85 } m_nonInheritedData; | 88 } m_nonInheritedData; |
| 86 }; | 89 }; |
| 87 | 90 |
| 91 // If this assert fails, it means that size of ComputedStyle has changed. Please | |
| 92 // update the SameSizeAsComputedStyle struct to mirror the updated storage of | |
|
sashab
2017/02/24 06:05:41
Check that you really *do* want to increase the si
esprehn
2017/02/24 17:59:48
Word.
shend
2017/02/27 19:36:44
Done.
| |
| 93 // ComputedStyle. | |
| 88 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); | 94 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); |
| 89 | 95 |
| 90 PassRefPtr<ComputedStyle> ComputedStyle::create() { | 96 PassRefPtr<ComputedStyle> ComputedStyle::create() { |
| 91 return adoptRef(new ComputedStyle()); | 97 return adoptRef(new ComputedStyle()); |
| 92 } | 98 } |
| 93 | 99 |
| 94 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() { | 100 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() { |
| 95 return adoptRef(new ComputedStyle(InitialStyle)); | 101 return adoptRef(new ComputedStyle(InitialStyle)); |
| 96 } | 102 } |
| 97 | 103 |
| (...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2471 if (value < 0) | 2477 if (value < 0) |
| 2472 fvalue -= 0.5f; | 2478 fvalue -= 0.5f; |
| 2473 else | 2479 else |
| 2474 fvalue += 0.5f; | 2480 fvalue += 0.5f; |
| 2475 } | 2481 } |
| 2476 | 2482 |
| 2477 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2483 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
| 2478 } | 2484 } |
| 2479 | 2485 |
| 2480 } // namespace blink | 2486 } // namespace blink |
| OLD | NEW |