OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return; | 144 return; |
145 | 145 |
146 if (rect.height() <= 0 || rect.width() <= 0) | 146 if (rect.height() <= 0 || rect.width() <= 0) |
147 return; | 147 return; |
148 | 148 |
149 Vector<IntRect> tickmarks; | 149 Vector<IntRect> tickmarks; |
150 scrollbar->getTickmarks(tickmarks); | 150 scrollbar->getTickmarks(tickmarks); |
151 if (!tickmarks.size()) | 151 if (!tickmarks.size()) |
152 return; | 152 return; |
153 | 153 |
| 154 if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, Displa
yItem::ScrollbarTickmarks)) |
| 155 return; |
| 156 |
154 DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarTickmar
ks, rect); | 157 DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarTickmar
ks, rect); |
155 if (recorder.canUseCachedDrawing()) | |
156 return; | |
157 | 158 |
158 // Inset a bit. | 159 // Inset a bit. |
159 IntRect tickmarkTrackRect = rect; | 160 IntRect tickmarkTrackRect = rect; |
160 tickmarkTrackRect.setX(tickmarkTrackRect.x() + 1); | 161 tickmarkTrackRect.setX(tickmarkTrackRect.x() + 1); |
161 tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 2); | 162 tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 2); |
162 paintGivenTickmarks(context->canvas(), scrollbar, tickmarkTrackRect, tickmar
ks); | 163 paintGivenTickmarks(context->canvas(), scrollbar, tickmarkTrackRect, tickmar
ks); |
163 } | 164 } |
164 | 165 |
165 ScrollbarThemeMacCommon::~ScrollbarThemeMacCommon() | 166 ScrollbarThemeMacCommon::~ScrollbarThemeMacCommon() |
166 { | 167 { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // static | 233 // static |
233 bool ScrollbarThemeMacCommon::isOverlayAPIAvailable() | 234 bool ScrollbarThemeMacCommon::isOverlayAPIAvailable() |
234 { | 235 { |
235 static bool apiAvailable = | 236 static bool apiAvailable = |
236 [NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scroll
erImpWithStyle:controlSize:horizontal:replacingScrollerImp:)] | 237 [NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scroll
erImpWithStyle:controlSize:horizontal:replacingScrollerImp:)] |
237 && [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@
selector(scrollerStyle)]; | 238 && [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@
selector(scrollerStyle)]; |
238 return apiAvailable; | 239 return apiAvailable; |
239 } | 240 } |
240 | 241 |
241 } // namespace blink | 242 } // namespace blink |
OLD | NEW |