 Chromium Code Reviews
 Chromium Code Reviews Issue 1549693002:
  Optimize collapsed border painting  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1549693002:
  Optimize collapsed border painting  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 
| 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 
| 7 * | 7 * | 
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or | 
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public | 
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 bool exists() const { return m_precedence != BorderPrecedenceOff; } | 58 bool exists() const { return m_precedence != BorderPrecedenceOff; } | 
| 59 StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::curren tColor() : StyleColor(m_color); } | 59 StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::curren tColor() : StyleColor(m_color); } | 
| 60 bool isTransparent() const { return m_transparent; } | 60 bool isTransparent() const { return m_transparent; } | 
| 61 EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence> (m_precedence); } | 61 EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence> (m_precedence); } | 
| 62 | 62 | 
| 63 bool isSameIgnoringColor(const CollapsedBorderValue& o) const | 63 bool isSameIgnoringColor(const CollapsedBorderValue& o) const | 
| 64 { | 64 { | 
| 65 return width() == o.width() && style() == o.style() && precedence() == o .precedence(); | 65 return width() == o.width() && style() == o.style() && precedence() == o .precedence(); | 
| 66 } | 66 } | 
| 67 | 67 | 
| 68 bool equals(const CollapsedBorderValue& o) const | 68 bool visuallyEquals(const CollapsedBorderValue& o) const | 
| 69 { | 69 { | 
| 70 if (!isVisible() && !o.isVisible()) | |
| 71 return true; | |
| 
Xianzhu
2016/05/03 19:03:27
Previously cell borders were cached in LayoutTable
 | |
| 70 return color() == o.color() && isTransparent() == o.isTransparent() && i sSameIgnoringColor(o); | 72 return color() == o.color() && isTransparent() == o.isTransparent() && i sSameIgnoringColor(o); | 
| 71 } | 73 } | 
| 72 | 74 | 
| 73 bool isVisible() const | 75 bool isVisible() const | 
| 74 { | 76 { | 
| 75 return style() > BorderStyleHidden && !isTransparent() && exists(); | 77 return style() > BorderStyleHidden && !isTransparent() && exists(); | 
| 76 } | 78 } | 
| 77 | 79 | 
| 78 bool shouldPaint(const CollapsedBorderValue& tableCurrentBorderValue) const | 80 bool shouldPaint(const CollapsedBorderValue& tableCurrentBorderValue) const | 
| 79 { | 81 { | 
| 80 // Invisible borders are not cached so painters see visible borders only . | 82 return isVisible() && isSameIgnoringColor(tableCurrentBorderValue); | 
| 
Xianzhu
2016/05/03 19:03:27
The reason of this change is the same as the above
 | |
| 81 ASSERT(isVisible()); | |
| 82 return isSameIgnoringColor(tableCurrentBorderValue); | |
| 83 } | 83 } | 
| 84 | 84 | 
| 85 private: | 85 private: | 
| 86 Color m_color; | 86 Color m_color; | 
| 87 unsigned m_colorIsCurrentColor : 1; | 87 unsigned m_colorIsCurrentColor : 1; | 
| 88 unsigned m_width : 23; | 88 unsigned m_width : 23; | 
| 89 unsigned m_style : 4; // EBorderStyle | 89 unsigned m_style : 4; // EBorderStyle | 
| 90 unsigned m_precedence : 3; // EBorderPrecedence | 90 unsigned m_precedence : 3; // EBorderPrecedence | 
| 91 unsigned m_transparent : 1; | 91 unsigned m_transparent : 1; | 
| 92 }; | 92 }; | 
| 93 | 93 | 
| 94 } // namespace blink | 94 } // namespace blink | 
| 95 | 95 | 
| 96 #endif // CollapsedBorderValue_h | 96 #endif // CollapsedBorderValue_h | 
| OLD | NEW |