This source file includes following definitions.
- defaultData
- outset
- outset
#include "config.h"
#include "core/rendering/style/NinePieceImage.h"
namespace WebCore {
static DataRef<NinePieceImageData>& defaultData()
{
static DataRef<NinePieceImageData>* data = new DataRef<NinePieceImageData>;
if (!data->get())
data->init();
return *data;
}
NinePieceImage::NinePieceImage()
: m_data(defaultData())
{
}
NinePieceImage::NinePieceImage(PassRefPtr<StyleImage> image, LengthBox imageSlices, bool fill, const BorderImageLengthBox& borderSlices, const BorderImageLengthBox& outset, ENinePieceImageRule horizontalRule, ENinePieceImageRule verticalRule)
{
m_data.init();
m_data.access()->image = image;
m_data.access()->imageSlices = imageSlices;
m_data.access()->borderSlices = borderSlices;
m_data.access()->outset = outset;
m_data.access()->fill = fill;
m_data.access()->horizontalRule = horizontalRule;
m_data.access()->verticalRule = verticalRule;
}
NinePieceImageData::NinePieceImageData()
: fill(false)
, horizontalRule(StretchImageRule)
, verticalRule(StretchImageRule)
, image(nullptr)
, imageSlices(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent))
, borderSlices(1.0, 1.0, 1.0, 1.0)
, outset(Length(0, Fixed), Length(0, Fixed), Length(0, Fixed), Length(0, Fixed))
{
}
NinePieceImageData::NinePieceImageData(const NinePieceImageData& other)
: RefCounted<NinePieceImageData>()
, fill(other.fill)
, horizontalRule(other.horizontalRule)
, verticalRule(other.verticalRule)
, image(other.image)
, imageSlices(other.imageSlices)
, borderSlices(other.borderSlices)
, outset(other.outset)
{
}
bool NinePieceImageData::operator==(const NinePieceImageData& other) const
{
return StyleImage::imagesEquivalent(image.get(), other.image.get())
&& imageSlices == other.imageSlices
&& fill == other.fill
&& borderSlices == other.borderSlices
&& outset == other.outset
&& horizontalRule == other.horizontalRule
&& verticalRule == other.verticalRule;
}
}