Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / core / paint / ObjectPainter.h
blob9c8076f06e2fbe0ca403e38d4456afb1efaccbda
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.
5 #ifndef ObjectPainter_h
6 #define ObjectPainter_h
8 #include "core/style/ComputedStyleConstants.h"
9 #include "wtf/Allocator.h"
10 #include "wtf/Vector.h"
12 namespace blink {
14 class Color;
15 class GraphicsContext;
16 class LayoutPoint;
17 class LayoutRect;
18 class LayoutSize;
19 struct PaintInfo;
20 class LayoutObject;
21 class ComputedStyle;
23 class ObjectPainter {
24 STACK_ALLOCATED();
25 public:
26 ObjectPainter(LayoutObject& layoutObject) : m_layoutObject(layoutObject) { }
28 void paintOutline(const PaintInfo&, const LayoutPoint& paintOffset);
29 void paintInlineChildrenOutlines(const PaintInfo&, const LayoutPoint& paintOffset);
30 void addPDFURLRectIfNeeded(const PaintInfo&, const LayoutPoint& paintOffset);
32 static void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide, Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false);
34 private:
35 static void drawDashedOrDottedBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2,
36 BoxSide, Color, int thickness, EBorderStyle, bool antialias);
37 static void drawDoubleBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2,
38 int length, BoxSide, Color, int thickness, int adjacentWidth1, int adjacentWidth2, bool antialias);
39 static void drawRidgeOrGrooveBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2,
40 BoxSide, Color, EBorderStyle, int adjacentWidth1, int adjacentWidth2, bool antialias);
41 static void drawSolidBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2,
42 BoxSide, Color, int adjacentWidth1, int adjacentWidth2, bool antialias);
44 LayoutObject& m_layoutObject;
47 } // namespace blink
49 #endif