| Index: cc/render_surface_impl.cc
|
| diff --git a/cc/render_surface_impl.cc b/cc/render_surface_impl.cc
|
| index e5f0324802fe4e7ed2cd38b5e957e391b0a65799..e1ebc61b099af3de76cbb7c5319821c45b3d84bd 100644
|
| --- a/cc/render_surface_impl.cc
|
| +++ b/cc/render_surface_impl.cc
|
| @@ -32,7 +32,7 @@ static const int debugReplicaBorderColorRed = 160;
|
| static const int debugReplicaBorderColorGreen = 0;
|
| static const int debugReplicaBorderColorBlue = 255;
|
|
|
| -CCRenderSurface::CCRenderSurface(CCLayerImpl* owningLayer)
|
| +RenderSurfaceImpl::RenderSurfaceImpl(LayerImpl* owningLayer)
|
| : m_owningLayer(owningLayer)
|
| , m_surfacePropertyChanged(false)
|
| , m_drawOpacity(1)
|
| @@ -43,25 +43,25 @@ CCRenderSurface::CCRenderSurface(CCLayerImpl* owningLayer)
|
| , m_targetRenderSurfaceLayerIndexHistory(0)
|
| , m_currentLayerIndexHistory(0)
|
| {
|
| - m_damageTracker = CCDamageTracker::create();
|
| + m_damageTracker = DamageTracker::create();
|
| }
|
|
|
| -CCRenderSurface::~CCRenderSurface()
|
| +RenderSurfaceImpl::~RenderSurfaceImpl()
|
| {
|
| }
|
|
|
| -FloatRect CCRenderSurface::drawableContentRect() const
|
| +FloatRect RenderSurfaceImpl::drawableContentRect() const
|
| {
|
| - FloatRect drawableContentRect = CCMathUtil::mapClippedRect(m_drawTransform, m_contentRect);
|
| + FloatRect drawableContentRect = MathUtil::mapClippedRect(m_drawTransform, m_contentRect);
|
| if (m_owningLayer->hasReplica())
|
| - drawableContentRect.unite(CCMathUtil::mapClippedRect(m_replicaDrawTransform, m_contentRect));
|
| + drawableContentRect.unite(MathUtil::mapClippedRect(m_replicaDrawTransform, m_contentRect));
|
|
|
| return drawableContentRect;
|
| }
|
|
|
| -std::string CCRenderSurface::name() const
|
| +std::string RenderSurfaceImpl::name() const
|
| {
|
| - return base::StringPrintf("RenderSurface(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->debugName().data());
|
| + return base::StringPrintf("RenderSurfaceImpl(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->debugName().data());
|
| }
|
|
|
| static std::string indentString(int indent)
|
| @@ -72,7 +72,7 @@ static std::string indentString(int indent)
|
| return str;
|
| }
|
|
|
| -void CCRenderSurface::dumpSurface(std::string* str, int indent) const
|
| +void RenderSurfaceImpl::dumpSurface(std::string* str, int indent) const
|
| {
|
| std::string indentStr = indentString(indent);
|
| str->append(indentStr);
|
| @@ -95,13 +95,13 @@ void CCRenderSurface::dumpSurface(std::string* str, int indent) const
|
| m_damageTracker->currentDamageRect().width(), m_damageTracker->currentDamageRect().height());
|
| }
|
|
|
| -int CCRenderSurface::owningLayerId() const
|
| +int RenderSurfaceImpl::owningLayerId() const
|
| {
|
| return m_owningLayer ? m_owningLayer->id() : 0;
|
| }
|
|
|
|
|
| -void CCRenderSurface::setClipRect(const IntRect& clipRect)
|
| +void RenderSurfaceImpl::setClipRect(const IntRect& clipRect)
|
| {
|
| if (m_clipRect == clipRect)
|
| return;
|
| @@ -110,12 +110,12 @@ void CCRenderSurface::setClipRect(const IntRect& clipRect)
|
| m_clipRect = clipRect;
|
| }
|
|
|
| -bool CCRenderSurface::contentsChanged() const
|
| +bool RenderSurfaceImpl::contentsChanged() const
|
| {
|
| return !m_damageTracker->currentDamageRect().isEmpty();
|
| }
|
|
|
| -void CCRenderSurface::setContentRect(const IntRect& contentRect)
|
| +void RenderSurfaceImpl::setContentRect(const IntRect& contentRect)
|
| {
|
| if (m_contentRect == contentRect)
|
| return;
|
| @@ -124,7 +124,7 @@ void CCRenderSurface::setContentRect(const IntRect& contentRect)
|
| m_contentRect = contentRect;
|
| }
|
|
|
| -bool CCRenderSurface::surfacePropertyChanged() const
|
| +bool RenderSurfaceImpl::surfacePropertyChanged() const
|
| {
|
| // Surface property changes are tracked as follows:
|
| //
|
| @@ -138,30 +138,30 @@ bool CCRenderSurface::surfacePropertyChanged() const
|
| return m_surfacePropertyChanged || m_owningLayer->layerPropertyChanged();
|
| }
|
|
|
| -bool CCRenderSurface::surfacePropertyChangedOnlyFromDescendant() const
|
| +bool RenderSurfaceImpl::surfacePropertyChangedOnlyFromDescendant() const
|
| {
|
| return m_surfacePropertyChanged && !m_owningLayer->layerPropertyChanged();
|
| }
|
|
|
| -void CCRenderSurface::addContributingDelegatedRenderPassLayer(CCLayerImpl* layer)
|
| +void RenderSurfaceImpl::addContributingDelegatedRenderPassLayer(LayerImpl* layer)
|
| {
|
| ASSERT(std::find(m_layerList.begin(), m_layerList.end(), layer) != m_layerList.end());
|
| - CCDelegatedRendererLayerImpl* delegatedRendererLayer = static_cast<CCDelegatedRendererLayerImpl*>(layer);
|
| + DelegatedRendererLayerImpl* delegatedRendererLayer = static_cast<DelegatedRendererLayerImpl*>(layer);
|
| m_contributingDelegatedRenderPassLayerList.push_back(delegatedRendererLayer);
|
| }
|
|
|
| -void CCRenderSurface::clearLayerLists()
|
| +void RenderSurfaceImpl::clearLayerLists()
|
| {
|
| m_layerList.clear();
|
| m_contributingDelegatedRenderPassLayerList.clear();
|
| }
|
|
|
| -static inline IntRect computeClippedRectInTarget(const CCLayerImpl* owningLayer)
|
| +static inline IntRect computeClippedRectInTarget(const LayerImpl* owningLayer)
|
| {
|
| ASSERT(owningLayer->parent());
|
|
|
| - const CCLayerImpl* renderTarget = owningLayer->parent()->renderTarget();
|
| - const CCRenderSurface* self = owningLayer->renderSurface();
|
| + const LayerImpl* renderTarget = owningLayer->parent()->renderTarget();
|
| + const RenderSurfaceImpl* self = owningLayer->renderSurface();
|
|
|
| IntRect clippedRectInTarget = self->clipRect();
|
| if (owningLayer->backgroundFilters().hasFilterThatMovesPixels()) {
|
| @@ -176,50 +176,50 @@ static inline IntRect computeClippedRectInTarget(const CCLayerImpl* owningLayer)
|
| return clippedRectInTarget;
|
| }
|
|
|
| -CCRenderPass::Id CCRenderSurface::renderPassId()
|
| +RenderPass::Id RenderSurfaceImpl::renderPassId()
|
| {
|
| int layerId = m_owningLayer->id();
|
| int subId = 0;
|
| ASSERT(layerId > 0);
|
| - return CCRenderPass::Id(layerId, subId);
|
| + return RenderPass::Id(layerId, subId);
|
| }
|
|
|
| -void CCRenderSurface::appendRenderPasses(CCRenderPassSink& passSink)
|
| +void RenderSurfaceImpl::appendRenderPasses(RenderPassSink& passSink)
|
| {
|
| for (size_t i = 0; i < m_contributingDelegatedRenderPassLayerList.size(); ++i)
|
| m_contributingDelegatedRenderPassLayerList[i]->appendContributingRenderPasses(passSink);
|
|
|
| - scoped_ptr<CCRenderPass> pass = CCRenderPass::create(renderPassId(), m_contentRect, m_screenSpaceTransform);
|
| + scoped_ptr<RenderPass> pass = RenderPass::create(renderPassId(), m_contentRect, m_screenSpaceTransform);
|
| pass->setDamageRect(m_damageTracker->currentDamageRect());
|
| pass->setFilters(m_owningLayer->filters());
|
| pass->setBackgroundFilters(m_owningLayer->backgroundFilters());
|
| passSink.appendRenderPass(pass.Pass());
|
| }
|
|
|
| -void CCRenderSurface::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appendQuadsData, bool forReplica, CCRenderPass::Id renderPassId)
|
| +void RenderSurfaceImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuadsData, bool forReplica, RenderPass::Id renderPassId)
|
| {
|
| ASSERT(!forReplica || m_owningLayer->hasReplica());
|
|
|
| IntRect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer);
|
| bool isOpaque = false;
|
| const WebTransformationMatrix& drawTransform = forReplica ? m_replicaDrawTransform : m_drawTransform;
|
| - CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(CCSharedQuadState::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity, isOpaque).Pass());
|
| + SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(SharedQuadState::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity, isOpaque).Pass());
|
|
|
| if (m_owningLayer->hasDebugBorders()) {
|
| int red = forReplica ? debugReplicaBorderColorRed : debugSurfaceBorderColorRed;
|
| int green = forReplica ? debugReplicaBorderColorGreen : debugSurfaceBorderColorGreen;
|
| int blue = forReplica ? debugReplicaBorderColorBlue : debugSurfaceBorderColorBlue;
|
| SkColor color = SkColorSetARGB(debugSurfaceBorderAlpha, red, green, blue);
|
| - quadSink.append(CCDebugBorderDrawQuad::create(sharedQuadState, contentRect(), color, debugSurfaceBorderWidth).PassAs<CCDrawQuad>(), appendQuadsData);
|
| + quadSink.append(DebugBorderDrawQuad::create(sharedQuadState, contentRect(), color, debugSurfaceBorderWidth).PassAs<DrawQuad>(), appendQuadsData);
|
| }
|
|
|
| - // FIXME: By using the same RenderSurface for both the content and its reflection,
|
| + // FIXME: By using the same RenderSurfaceImpl for both the content and its reflection,
|
| // it's currently not possible to apply a separate mask to the reflection layer
|
| // or correctly handle opacity in reflections (opacity must be applied after drawing
|
| - // both the layer and its reflection). The solution is to introduce yet another RenderSurface
|
| + // both the layer and its reflection). The solution is to introduce yet another RenderSurfaceImpl
|
| // to draw the layer and its reflection in. For now we only apply a separate reflection
|
| // mask if the contents don't have a mask of their own.
|
| - CCLayerImpl* maskLayer = m_owningLayer->maskLayer();
|
| + LayerImpl* maskLayer = m_owningLayer->maskLayer();
|
| if (maskLayer && (!maskLayer->drawsContent() || maskLayer->bounds().isEmpty()))
|
| maskLayer = 0;
|
|
|
| @@ -240,11 +240,11 @@ void CCRenderSurface::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& appen
|
| maskTexCoordOffsetY = static_cast<float>(contentRect().y()) / contentRect().height() * maskTexCoordScaleY;
|
| }
|
|
|
| - CCResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->contentsResourceId() : 0;
|
| + ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->contentsResourceId() : 0;
|
| IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : IntRect();
|
|
|
| - quadSink.append(CCRenderPassDrawQuad::create(sharedQuadState, contentRect(), renderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame,
|
| - maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY).PassAs<CCDrawQuad>(), appendQuadsData);
|
| + quadSink.append(RenderPassDrawQuad::create(sharedQuadState, contentRect(), renderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame,
|
| + maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY).PassAs<DrawQuad>(), appendQuadsData);
|
| }
|
|
|
| }
|
|
|