This source file includes following definitions.
- assign
- paintScrollbarBackground
- paintTrackBackground
- paintBackTrackPart
- paintForwardTrackPart
- paintBackButtonStart
- paintBackButtonEnd
- paintForwardButtonStart
- paintForwardButtonEnd
- paintTickmarks
- paintThumb
- m_scrollbar
#include "config.h"
#include "public/platform/WebScrollbarThemePainter.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/scroll/Scrollbar.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "public/platform/WebRect.h"
using namespace WebCore;
namespace blink {
void WebScrollbarThemePainter::assign(const WebScrollbarThemePainter& painter)
{
m_theme = painter.m_theme;
m_scrollbar = painter.m_scrollbar;
}
void WebScrollbarThemePainter::paintScrollbarBackground(WebCanvas* canvas, const WebRect& rect)
{
SkRect clip = SkRect::MakeXYWH(rect.x, rect.y, rect.width, rect.height);
canvas->clipRect(clip);
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintScrollbarBackground(&context, m_scrollbar);
}
void WebScrollbarThemePainter::paintTrackBackground(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintTrackBackground(&context, m_scrollbar, IntRect(rect));
}
void WebScrollbarThemePainter::paintBackTrackPart(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintTrackPiece(&context, m_scrollbar, IntRect(rect), WebCore::BackTrackPart);
}
void WebScrollbarThemePainter::paintForwardTrackPart(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintTrackPiece(&context, m_scrollbar, IntRect(rect), WebCore::ForwardTrackPart);
}
void WebScrollbarThemePainter::paintBackButtonStart(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintButton(&context, m_scrollbar, IntRect(rect), WebCore::BackButtonStartPart);
}
void WebScrollbarThemePainter::paintBackButtonEnd(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintButton(&context, m_scrollbar, IntRect(rect), WebCore::BackButtonEndPart);
}
void WebScrollbarThemePainter::paintForwardButtonStart(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintButton(&context, m_scrollbar, IntRect(rect), WebCore::ForwardButtonStartPart);
}
void WebScrollbarThemePainter::paintForwardButtonEnd(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintButton(&context, m_scrollbar, IntRect(rect), WebCore::ForwardButtonEndPart);
}
void WebScrollbarThemePainter::paintTickmarks(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintTickmarks(&context, m_scrollbar, IntRect(rect));
}
void WebScrollbarThemePainter::paintThumb(WebCanvas* canvas, const WebRect& rect)
{
GraphicsContext context(canvas);
context.setCertainlyOpaque(false);
m_theme->paintThumb(&context, m_scrollbar, IntRect(rect));
}
WebScrollbarThemePainter::WebScrollbarThemePainter(WebCore::ScrollbarTheme* theme, WebCore::Scrollbar* scrollbar)
: m_theme(theme)
, m_scrollbar(scrollbar)
{
}
}