OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/FramePainter.h" | 6 #include "core/paint/FramePainter.h" |
7 | 7 |
8 #include "core/editing/markers/DocumentMarkerController.h" | 8 #include "core/editing/markers/DocumentMarkerController.h" |
9 #include "core/fetch/MemoryCache.h" | 9 #include "core/fetch/MemoryCache.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 return; | 159 return; |
160 | 160 |
161 paintScrollCorner(context, frameView().scrollCornerRect()); | 161 paintScrollCorner(context, frameView().scrollCornerRect()); |
162 } | 162 } |
163 | 163 |
164 void FramePainter::paintScrollCorner(GraphicsContext* context, const IntRect& co rnerRect) | 164 void FramePainter::paintScrollCorner(GraphicsContext* context, const IntRect& co rnerRect) |
165 { | 165 { |
166 if (frameView().scrollCorner()) { | 166 if (frameView().scrollCorner()) { |
167 bool needsBackground = frameView().frame().isMainFrame(); | 167 bool needsBackground = frameView().frame().isMainFrame(); |
168 if (needsBackground && !LayoutObjectDrawingRecorder::useCachedDrawingIfP ossible(*context, *frameView().layoutView(), DisplayItem::ScrollbarCorner)) { | 168 if (needsBackground && !LayoutObjectDrawingRecorder::useCachedDrawingIfP ossible(*context, *frameView().layoutView(), DisplayItem::ScrollbarCorner)) { |
169 LayoutObjectDrawingRecorder drawingRecorder(*context, *frameView().l ayoutView(), DisplayItem::ScrollbarCorner, cornerRect); | 169 LayoutObjectDrawingRecorder drawingRecorder(*context, *frameView().l ayoutView(), DisplayItem::ScrollbarCorner, LayoutRect(cornerRect)); |
jbroman
2015/08/26 19:06:43
ditto: no need to go via LayoutRect
chrishtr
2015/08/26 20:53:51
Fixed.
| |
170 context->fillRect(cornerRect, frameView().baseBackgroundColor()); | 170 context->fillRect(cornerRect, frameView().baseBackgroundColor()); |
171 | 171 |
172 } | 172 } |
173 ScrollbarPainter::paintIntoRect(frameView().scrollCorner(), context, cor nerRect.location(), LayoutRect(cornerRect)); | 173 ScrollbarPainter::paintIntoRect(frameView().scrollCorner(), context, cor nerRect.location(), LayoutRect(cornerRect)); |
174 return; | 174 return; |
175 } | 175 } |
176 | 176 |
177 ScrollbarTheme::theme()->paintScrollCorner(context, *frameView().layoutView( ), cornerRect); | 177 ScrollbarTheme::theme()->paintScrollCorner(context, *frameView().layoutView( ), cornerRect); |
178 } | 178 } |
179 | 179 |
180 void FramePainter::paintScrollbar(GraphicsContext* context, Scrollbar* bar, cons t IntRect& rect) | 180 void FramePainter::paintScrollbar(GraphicsContext* context, Scrollbar* bar, cons t IntRect& rect) |
181 { | 181 { |
182 bool needsBackground = bar->isCustomScrollbar() && frameView().frame().isMai nFrame(); | 182 bool needsBackground = bar->isCustomScrollbar() && frameView().frame().isMai nFrame(); |
183 if (needsBackground) { | 183 if (needsBackground) { |
184 IntRect toFill = bar->frameRect(); | 184 IntRect toFill = bar->frameRect(); |
185 toFill.intersect(rect); | 185 toFill.intersect(rect); |
186 context->fillRect(toFill, frameView().baseBackgroundColor()); | 186 context->fillRect(toFill, frameView().baseBackgroundColor()); |
187 } | 187 } |
188 | 188 |
189 bar->paint(context, rect); | 189 bar->paint(context, rect); |
190 } | 190 } |
191 | 191 |
192 FrameView& FramePainter::frameView() | 192 FrameView& FramePainter::frameView() |
193 { | 193 { |
194 return *m_frameView; | 194 return *m_frameView; |
195 } | 195 } |
196 | 196 |
197 } // namespace blink | 197 } // namespace blink |
OLD | NEW |