blob: 396ed2a193f1e2b7a72797cc96d412137ae404f9 [file] [log] [blame]
// 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 BoxPainter_h
#define BoxPainter_h
#include "core/layout/BackgroundBleedAvoidance.h"
#include "core/paint/RoundedInnerRectClipper.h"
#include "platform/geometry/LayoutSize.h"
#include "platform/graphics/GraphicsTypes.h"
#include "platform/wtf/Allocator.h"
namespace blink {
class LayoutPoint;
class LayoutRect;
struct PaintInfo;
class LayoutBox;
class Color;
class BoxPainter {
STACK_ALLOCATED();
public:
BoxPainter(const LayoutBox& layout_box) : layout_box_(layout_box) {}
void Paint(const PaintInfo&, const LayoutPoint&);
void PaintChildren(const PaintInfo&, const LayoutPoint&);
void PaintBoxDecorationBackground(const PaintInfo&, const LayoutPoint&);
void PaintMask(const PaintInfo&, const LayoutPoint&);
void PaintClippingMask(const PaintInfo&, const LayoutPoint&);
void PaintMaskImages(const PaintInfo&, const LayoutRect&);
void PaintBoxDecorationBackgroundWithRect(const PaintInfo&,
const LayoutPoint&,
const LayoutRect&);
LayoutRect BoundsForDrawingRecorder(const PaintInfo&,
const LayoutPoint& adjusted_paint_offset);
private:
void PaintBackground(const PaintInfo&,
const LayoutRect&,
const Color& background_color,
BackgroundBleedAvoidance = kBackgroundBleedNone);
const LayoutBox& layout_box_;
};
} // namespace blink
#endif