Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: Source/core/layout/LayoutTableCell.cpp

Issue 1306433002: Let collapsed border drawings be cacheable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 borderValues.append(borderValue); 944 borderValues.append(borderValue);
945 } 945 }
946 946
947 void LayoutTableCell::collectBorderValues(LayoutTable::CollapsedBorderValues& bo rderValues) 947 void LayoutTableCell::collectBorderValues(LayoutTable::CollapsedBorderValues& bo rderValues)
948 { 948 {
949 CollapsedBorderValue startBorder = computeCollapsedStartBorder(); 949 CollapsedBorderValue startBorder = computeCollapsedStartBorder();
950 CollapsedBorderValue endBorder = computeCollapsedEndBorder(); 950 CollapsedBorderValue endBorder = computeCollapsedEndBorder();
951 CollapsedBorderValue beforeBorder = computeCollapsedBeforeBorder(); 951 CollapsedBorderValue beforeBorder = computeCollapsedBeforeBorder();
952 CollapsedBorderValue afterBorder = computeCollapsedAfterBorder(); 952 CollapsedBorderValue afterBorder = computeCollapsedAfterBorder();
953 LayoutTableSection* section = this->section(); 953 LayoutTableSection* section = this->section();
954 section->setCachedCollapsedBorder(this, CBSStart, startBorder); 954 bool changed = section->setCachedCollapsedBorder(this, CBSStart, startBorder );
955 section->setCachedCollapsedBorder(this, CBSEnd, endBorder); 955 changed |= section->setCachedCollapsedBorder(this, CBSEnd, endBorder);
956 section->setCachedCollapsedBorder(this, CBSBefore, beforeBorder); 956 changed |= section->setCachedCollapsedBorder(this, CBSBefore, beforeBorder);
957 section->setCachedCollapsedBorder(this, CBSAfter, afterBorder); 957 changed |= section->setCachedCollapsedBorder(this, CBSAfter, afterBorder);
958
959 // In slimming paint mode, we need to invalidate all cells with collapsed bo rder changed.
960 // FIXME: Need a way to invalidate/repaint the borders only. crbug.com/45109 0#c5.
961 if (changed && RuntimeEnabledFeatures::slimmingPaintEnabled())
962 invalidateDisplayItemClient(*this);
958 963
959 addBorderStyle(borderValues, startBorder); 964 addBorderStyle(borderValues, startBorder);
960 addBorderStyle(borderValues, endBorder); 965 addBorderStyle(borderValues, endBorder);
961 addBorderStyle(borderValues, beforeBorder); 966 addBorderStyle(borderValues, beforeBorder);
962 addBorderStyle(borderValues, afterBorder); 967 addBorderStyle(borderValues, afterBorder);
963 } 968 }
964 969
965 static int compareBorderValuesForQSort(const void* pa, const void* pb) 970 static int compareBorderValuesForQSort(const void* pa, const void* pb)
966 { 971 {
967 const CollapsedBorderValue* a = static_cast<const CollapsedBorderValue*>(pa) ; 972 const CollapsedBorderValue* a = static_cast<const CollapsedBorderValue*>(pa) ;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 1031
1027 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject* parent) 1032 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject* parent)
1028 { 1033 {
1029 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen t()); 1034 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen t());
1030 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE_CELL); 1035 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE_CELL);
1031 newCell->setStyle(newStyle.release()); 1036 newCell->setStyle(newStyle.release());
1032 return newCell; 1037 return newCell;
1033 } 1038 }
1034 1039
1035 } // namespace blink 1040 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698