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

Side by Side Diff: Source/core/paint/ScrollbarPainter.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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/ScrollbarPainter.h"
7
8 #include "core/paint/BlockPainter.h"
9 #include "core/rendering/PaintInfo.h"
10 #include "core/rendering/RenderScrollbar.h"
11 #include "core/rendering/RenderScrollbarPart.h"
12 #include "platform/graphics/GraphicsContext.h"
13 namespace blink {
14
15 void ScrollbarPainter::paintPart(GraphicsContext* graphicsContext, ScrollbarPart partType, const IntRect& rect)
16 {
17 RenderScrollbarPart* partRenderer = m_renderScrollbar.getPart(partType);
18 if (!partRenderer)
19 return;
20 paintIntoRect(partRenderer, graphicsContext, m_renderScrollbar.location(), r ect);
21 }
22
23 void ScrollbarPainter::paintIntoRect(RenderScrollbarPart* renderScrollbarPart, G raphicsContext* graphicsContext, const LayoutPoint& paintOffset, const LayoutRec t& rect)
24 {
25 // Make sure our dimensions match the rect.
26 // FIXME: Setting these is a bad layering violation!
27 renderScrollbarPart->setLocation(rect.location() - toSize(paintOffset));
28 renderScrollbarPart->setWidth(rect.width());
29 renderScrollbarPart->setHeight(rect.height());
30
31 // Now do the paint.
32 PaintInfo paintInfo(graphicsContext, pixelSnappedIntRect(rect), PaintPhaseBl ockBackground, PaintBehaviorNormal);
33 BlockPainter blockPainter(*renderScrollbarPart);
34 blockPainter.paint(paintInfo, paintOffset);
35 paintInfo.phase = PaintPhaseChildBlockBackgrounds;
36 blockPainter.paint(paintInfo, paintOffset);
37 paintInfo.phase = PaintPhaseFloat;
38 blockPainter.paint(paintInfo, paintOffset);
39 paintInfo.phase = PaintPhaseForeground;
40 blockPainter.paint(paintInfo, paintOffset);
41 paintInfo.phase = PaintPhaseOutline;
42 blockPainter.paint(paintInfo, paintOffset);
43 }
44
45 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/ScrollbarPainter.h ('k') | Source/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698