| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef ObjectPainter_h |
| #define ObjectPainter_h |
| |
| #include "core/rendering/style/RenderStyleConstants.h" |
| |
| namespace blink { |
| |
| class Color; |
| class GraphicsContext; |
| class LayoutPoint; |
| class LayoutRect; |
| struct PaintInfo; |
| class RenderObject; |
| class RenderStyle; |
| |
| class ObjectPainter { |
| public: |
| ObjectPainter(RenderObject& renderObject) : m_renderObject(renderObject) { } |
| |
| void paintOutline(PaintInfo&, const LayoutRect& paintRect); |
| void paintFocusRing(PaintInfo&, const LayoutPoint& paintOffset, RenderStyle*); |
| |
| static void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide, Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false); |
| static void drawDashedOrDottedBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, |
| BoxSide, Color, int thickness, EBorderStyle, bool antialias); |
| static void drawDoubleBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, |
| int length, BoxSide, Color, int thickness, int adjacentWidth1, int adjacentWidth2, bool antialias); |
| static void drawRidgeOrGrooveBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, |
| BoxSide, Color, EBorderStyle, int adjacentWidth1, int adjacentWidth2, bool antialias); |
| static void drawSolidBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, |
| BoxSide, Color, int adjacentWidth1, int adjacentWidth2, bool antialias); |
| private: |
| |
| RenderObject& m_renderObject; |
| }; |
| |
| } // namespace blink |
| |
| #endif |