summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp')
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
index 9a88376c2..9434dc59c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
@@ -71,7 +71,7 @@ CCLayerImpl::CCLayerImpl(int id)
, m_isContainerForFixedPositionLayers(false)
, m_fixedToContainerLayer(false)
, m_pageScaleDelta(1)
- , m_targetRenderSurface(0)
+ , m_renderTarget(0)
, m_drawDepth(0)
, m_drawOpacity(0)
, m_drawOpacityIsAnimating(false)
@@ -133,7 +133,7 @@ void CCLayerImpl::createRenderSurface()
{
ASSERT(!m_renderSurface);
m_renderSurface = adoptPtr(new CCRenderSurface(this));
- setTargetRenderSurface(m_renderSurface.get());
+ setRenderTarget(this);
}
bool CCLayerImpl::descendantDrawsContent()
@@ -147,7 +147,14 @@ bool CCLayerImpl::descendantDrawsContent()
PassOwnPtr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const
{
- return CCSharedQuadState::create(quadTransform(), m_visibleContentRect, m_scissorRect, m_drawOpacity, m_opaque);
+ WebTransformationMatrix quadTransformation = drawTransform();
+ if (!contentBounds().isEmpty() && !bounds().isEmpty()) {
+ quadTransformation.scaleNonUniform(bounds().width() / static_cast<double>(contentBounds().width()),
+ bounds().height() / static_cast<double>(contentBounds().height()));
+ quadTransformation.translate(-contentBounds().width() / 2.0, -contentBounds().height() / 2.0);
+ }
+
+ return CCSharedQuadState::create(quadTransformation, m_visibleContentRect, m_scissorRect, m_drawOpacity, m_opaque);
}
void CCLayerImpl::willDraw(CCRenderer*, CCGraphicsContext*)
@@ -235,17 +242,6 @@ const IntRect CCLayerImpl::getDrawRect() const
return mappedRect;
}
-WebTransformationMatrix CCLayerImpl::quadTransform() const
-{
- WebTransformationMatrix quadTransformation = drawTransform();
-
- float offsetX = -0.5 * bounds().width();
- float offsetY = -0.5 * bounds().height();
- quadTransformation.translate(offsetX, offsetY);
-
- return quadTransformation;
-}
-
void CCLayerImpl::writeIndent(TextStream& ts, int indent)
{
for (int i = 0; i != indent; ++i)
@@ -260,9 +256,9 @@ void CCLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
writeIndent(ts, indent);
ts << "bounds: " << bounds().width() << ", " << bounds().height() << "\n";
- if (m_targetRenderSurface) {
+ if (m_renderTarget) {
writeIndent(ts, indent);
- ts << "targetRenderSurface: " << m_targetRenderSurface->name() << "\n";
+ ts << "renderTarget: " << m_renderTarget->m_layerId << "\n";
}
writeIndent(ts, indent);