PatternBlackBerry.cpp [plain text]
#include "config.h"
#include "Pattern.h"
#include "AffineTransform.h"
#include "Image.h"
#include "NativeImagePtr.h"
#include "Path.h"
#include <BlackBerryPlatformGraphicsContext.h>
using namespace std;
namespace WebCore {
void Pattern::platformDestroy()
{
delete m_pattern;
m_pattern = 0;
}
PlatformPatternPtr Pattern::platformPattern(const AffineTransform&)
{
if (m_pattern)
return m_pattern;
const NativeImagePtr image = m_tileImage->nativeImageForCurrentFrame();
m_pattern = BlackBerry::Platform::Graphics::Pattern::create();
m_pattern->setImage(image, m_repeatX, m_repeatY);
m_pattern->setLocalMatrix(reinterpret_cast<const double*>(&m_patternSpaceTransformation));
return m_pattern;
}
void Pattern::setPlatformPatternSpaceTransform()
{
if (m_pattern)
m_pattern->setLocalMatrix(reinterpret_cast<const double*>(&m_patternSpaceTransformation));
}
}