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

Side by Side Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 613503002: Move paint code for RenderScrollbar and RenderScrollbarPart into ScrollbarPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/paint/ScrollbarPainter.cpp ('k') | Source/core/rendering/RenderScrollbar.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "core/editing/FrameSelection.h" 51 #include "core/editing/FrameSelection.h"
52 #include "core/frame/FrameView.h" 52 #include "core/frame/FrameView.h"
53 #include "core/frame/LocalFrame.h" 53 #include "core/frame/LocalFrame.h"
54 #include "core/html/HTMLFrameOwnerElement.h" 54 #include "core/html/HTMLFrameOwnerElement.h"
55 #include "core/inspector/InspectorInstrumentation.h" 55 #include "core/inspector/InspectorInstrumentation.h"
56 #include "core/page/Chrome.h" 56 #include "core/page/Chrome.h"
57 #include "core/page/EventHandler.h" 57 #include "core/page/EventHandler.h"
58 #include "core/page/FocusController.h" 58 #include "core/page/FocusController.h"
59 #include "core/page/Page.h" 59 #include "core/page/Page.h"
60 #include "core/page/scrolling/ScrollingCoordinator.h" 60 #include "core/page/scrolling/ScrollingCoordinator.h"
61 #include "core/paint/ScrollbarPainter.h"
61 #include "core/rendering/RenderGeometryMap.h" 62 #include "core/rendering/RenderGeometryMap.h"
62 #include "core/rendering/RenderScrollbar.h" 63 #include "core/rendering/RenderScrollbar.h"
63 #include "core/rendering/RenderScrollbarPart.h" 64 #include "core/rendering/RenderScrollbarPart.h"
64 #include "core/rendering/RenderTheme.h" 65 #include "core/rendering/RenderTheme.h"
65 #include "core/rendering/RenderView.h" 66 #include "core/rendering/RenderView.h"
66 #include "core/rendering/compositing/CompositedLayerMapping.h" 67 #include "core/rendering/compositing/CompositedLayerMapping.h"
67 #include "core/rendering/compositing/RenderLayerCompositor.h" 68 #include "core/rendering/compositing/RenderLayerCompositor.h"
68 #include "platform/PlatformGestureEvent.h" 69 #include "platform/PlatformGestureEvent.h"
69 #include "platform/PlatformMouseEvent.h" 70 #include "platform/PlatformMouseEvent.h"
70 #include "platform/graphics/GraphicsContextStateSaver.h" 71 #include "platform/graphics/GraphicsContextStateSaver.h"
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 } 1064 }
1064 1065
1065 void RenderLayerScrollableArea::paintScrollCorner(GraphicsContext* context, cons t IntPoint& paintOffset, const IntRect& damageRect) 1066 void RenderLayerScrollableArea::paintScrollCorner(GraphicsContext* context, cons t IntPoint& paintOffset, const IntRect& damageRect)
1066 { 1067 {
1067 IntRect absRect = scrollCornerRect(); 1068 IntRect absRect = scrollCornerRect();
1068 absRect.moveBy(paintOffset); 1069 absRect.moveBy(paintOffset);
1069 if (!absRect.intersects(damageRect)) 1070 if (!absRect.intersects(damageRect))
1070 return; 1071 return;
1071 1072
1072 if (m_scrollCorner) { 1073 if (m_scrollCorner) {
1073 m_scrollCorner->paintIntoRect(context, paintOffset, absRect); 1074 ScrollbarPainter::paintIntoRect(m_scrollCorner, context, paintOffset, ab sRect);
1074 return; 1075 return;
1075 } 1076 }
1076 1077
1077 // We don't want to paint white if we have overlay scrollbars, since we need 1078 // We don't want to paint white if we have overlay scrollbars, since we need
1078 // to see what is behind it. 1079 // to see what is behind it.
1079 if (!hasOverlayScrollbars()) 1080 if (!hasOverlayScrollbars())
1080 context->fillRect(absRect, Color::white); 1081 context->fillRect(absRect, Color::white);
1081 } 1082 }
1082 1083
1083 bool RenderLayerScrollableArea::hitTestOverflowControls(HitTestResult& result, c onst IntPoint& localPoint) 1084 bool RenderLayerScrollableArea::hitTestOverflowControls(HitTestResult& result, c onst IntPoint& localPoint)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 { 1172 {
1172 if (box().style()->resize() == RESIZE_NONE) 1173 if (box().style()->resize() == RESIZE_NONE)
1173 return; 1174 return;
1174 1175
1175 IntRect absRect = resizerCornerRect(box().pixelSnappedBorderBoxRect(), Resiz erForPointer); 1176 IntRect absRect = resizerCornerRect(box().pixelSnappedBorderBoxRect(), Resiz erForPointer);
1176 absRect.moveBy(paintOffset); 1177 absRect.moveBy(paintOffset);
1177 if (!absRect.intersects(damageRect)) 1178 if (!absRect.intersects(damageRect))
1178 return; 1179 return;
1179 1180
1180 if (m_resizer) { 1181 if (m_resizer) {
1181 m_resizer->paintIntoRect(context, paintOffset, absRect); 1182 ScrollbarPainter::paintIntoRect(m_resizer, context, paintOffset, absRect );
1182 return; 1183 return;
1183 } 1184 }
1184 1185
1185 drawPlatformResizerImage(context, absRect); 1186 drawPlatformResizerImage(context, absRect);
1186 1187
1187 // Draw a frame around the resizer (1px grey line) if there are any scrollba rs present. 1188 // Draw a frame around the resizer (1px grey line) if there are any scrollba rs present.
1188 // Clipping will exclude the right and bottom edges of this frame. 1189 // Clipping will exclude the right and bottom edges of this frame.
1189 if (!hasOverlayScrollbars() && hasScrollbar()) { 1190 if (!hasOverlayScrollbars() && hasScrollbar()) {
1190 GraphicsContextStateSaver stateSaver(*context); 1191 GraphicsContextStateSaver stateSaver(*context);
1191 context->clip(absRect); 1192 context->clip(absRect);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) 1470 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild)
1470 { 1471 {
1471 // We only want to track the topmost scroll child for scrollable areas with 1472 // We only want to track the topmost scroll child for scrollable areas with
1472 // overlay scrollbars. 1473 // overlay scrollbars.
1473 if (!hasOverlayScrollbars()) 1474 if (!hasOverlayScrollbars())
1474 return; 1475 return;
1475 m_nextTopmostScrollChild = scrollChild; 1476 m_nextTopmostScrollChild = scrollChild;
1476 } 1477 }
1477 1478
1478 } // namespace blink 1479 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/ScrollbarPainter.cpp ('k') | Source/core/rendering/RenderScrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698