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

Side by Side Diff: third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
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 "core/paint/ScrollableAreaPainter.h" 5 #include "core/paint/ScrollableAreaPainter.h"
6 6
7 #include "core/layout/LayoutView.h" 7 #include "core/layout/LayoutView.h"
8 #include "core/page/Page.h" 8 #include "core/page/Page.h"
9 #include "core/paint/LayoutObjectDrawingRecorder.h" 9 #include "core/paint/LayoutObjectDrawingRecorder.h"
10 #include "core/paint/PaintInfo.h" 10 #include "core/paint/PaintInfo.h"
(...skipping 16 matching lines...) Expand all
27 return; 27 return;
28 absRect.moveBy(paintOffset); 28 absRect.moveBy(paintOffset);
29 29
30 if (scrollableArea().resizer()) { 30 if (scrollableArea().resizer()) {
31 if (!cullRect.intersectsCullRect(absRect)) 31 if (!cullRect.intersectsCullRect(absRect))
32 return; 32 return;
33 ScrollbarPainter::paintIntoRect(*scrollableArea().resizer(), context, pa intOffset, LayoutRect(absRect)); 33 ScrollbarPainter::paintIntoRect(*scrollableArea().resizer(), context, pa intOffset, LayoutRect(absRect));
34 return; 34 return;
35 } 35 }
36 36
37 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, scrolla bleArea().box(), DisplayItem::Resizer, paintOffset)) 37 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, scrolla bleArea().box(), DisplayItem::Resizer))
38 return; 38 return;
39 39
40 LayoutObjectDrawingRecorder recorder(context, scrollableArea().box(), Displa yItem::Resizer, absRect, paintOffset); 40 LayoutObjectDrawingRecorder recorder(context, scrollableArea().box(), Displa yItem::Resizer, absRect);
41 41
42 drawPlatformResizerImage(context, absRect); 42 drawPlatformResizerImage(context, absRect);
43 43
44 // Draw a frame around the resizer (1px grey line) if there are any scrollba rs present. 44 // Draw a frame around the resizer (1px grey line) if there are any scrollba rs present.
45 // Clipping will exclude the right and bottom edges of this frame. 45 // Clipping will exclude the right and bottom edges of this frame.
46 if (!scrollableArea().hasOverlayScrollbars() && scrollableArea().hasScrollba r()) { 46 if (!scrollableArea().hasOverlayScrollbars() && scrollableArea().hasScrollba r()) {
47 GraphicsContextStateSaver stateSaver(context); 47 GraphicsContextStateSaver stateSaver(context);
48 context.clip(absRect); 48 context.clip(absRect);
49 IntRect largerCorner = absRect; 49 IntRect largerCorner = absRect;
50 largerCorner.setSize(IntSize(largerCorner.width() + 1, largerCorner.heig ht() + 1)); 50 largerCorner.setSize(IntSize(largerCorner.width() + 1, largerCorner.heig ht() + 1));
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return; 177 return;
178 ScrollbarPainter::paintIntoRect(*scrollableArea().scrollCorner(), contex t, paintOffset, LayoutRect(absRect)); 178 ScrollbarPainter::paintIntoRect(*scrollableArea().scrollCorner(), contex t, paintOffset, LayoutRect(absRect));
179 return; 179 return;
180 } 180 }
181 181
182 // We don't want to paint white if we have overlay scrollbars, since we need 182 // We don't want to paint white if we have overlay scrollbars, since we need
183 // to see what is behind it. 183 // to see what is behind it.
184 if (scrollableArea().hasOverlayScrollbars()) 184 if (scrollableArea().hasOverlayScrollbars())
185 return; 185 return;
186 186
187 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, scrolla bleArea().box(), DisplayItem::ScrollbarCorner, paintOffset)) 187 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, scrolla bleArea().box(), DisplayItem::ScrollbarCorner))
188 return; 188 return;
189 189
190 LayoutObjectDrawingRecorder recorder(context, scrollableArea().box(), Displa yItem::ScrollbarCorner, absRect, paintOffset); 190 LayoutObjectDrawingRecorder recorder(context, scrollableArea().box(), Displa yItem::ScrollbarCorner, absRect);
191 context.fillRect(absRect, Color::white); 191 context.fillRect(absRect, Color::white);
192 } 192 }
193 193
194 PaintLayerScrollableArea& ScrollableAreaPainter::scrollableArea() const 194 PaintLayerScrollableArea& ScrollableAreaPainter::scrollableArea() const
195 { 195 {
196 return *m_scrollableArea; 196 return *m_scrollableArea;
197 } 197 }
198 198
199 } // namespace blink 199 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGShapePainter.cpp ('k') | third_party/WebKit/Source/core/paint/TableCellPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698