| Index: cc/CCLayerTreeHostCommon.cpp
|
| diff --git a/cc/CCLayerTreeHostCommon.cpp b/cc/CCLayerTreeHostCommon.cpp
|
| index 24274a6f6f59f4213fdfc1fe73a6070a74b84329..d10002461cd33209656c3bf4d62a9c396fc48c8d 100644
|
| --- a/cc/CCLayerTreeHostCommon.cpp
|
| +++ b/cc/CCLayerTreeHostCommon.cpp
|
| @@ -363,7 +363,7 @@ void setupRootLayerAndSurfaceForRecursion(LayerType* rootLayer, LayerList& rende
|
| template<typename LayerType, typename LayerList, typename RenderSurfaceType, typename LayerSorter>
|
| static void calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLayer, const WebTransformationMatrix& parentMatrix,
|
| const WebTransformationMatrix& fullHierarchyMatrix, const WebTransformationMatrix& currentScrollCompensationMatrix,
|
| - const IntRect& clipRectFromAncestor, bool ancestorClipsSubtree,
|
| + const IntRect& clipRectFromAncestor, bool ancestorClipsSubtree, bool canUseLCDText,
|
| RenderSurfaceType* nearestAncestorThatMovesPixels, LayerList& renderSurfaceLayerList, LayerList& layerList,
|
| LayerSorter* layerSorter, int maxTextureSize, float deviceScaleFactor, IntRect& drawableContentRectOfSubtree)
|
| {
|
| @@ -512,6 +512,9 @@ static void calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay
|
| animatingTransformToScreen |= layer->parent()->screenSpaceTransformIsAnimating();
|
| }
|
|
|
| + bool shouldAdjustTextAA = !(drawOpacityIsAnimating || animatingTransformToScreen);
|
| + bool layerCanUseLCDText = shouldAdjustTextAA ? canUseLCDText && (drawOpacity == 1.0) && drawTransform.isIntegerTranslation() : false;
|
| +
|
| FloatRect contentRect(FloatPoint(), layer->contentBounds());
|
|
|
| // fullHierarchyMatrix is the matrix that transforms objects between screen space (except projection matrix) and the most recent RenderSurface's space.
|
| @@ -567,6 +570,10 @@ static void calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay
|
| // current target surface space that could cause more w < 0 headaches.
|
| subtreeShouldBeClipped = false;
|
|
|
| + // If the new renderSurface is drawn translucent or with a non-integral translation
|
| + // then the subtree that gets drawn on this renderSurface cannot use LCD text.
|
| + canUseLCDText = layerCanUseLCDText;
|
| +
|
| if (layer->maskLayer()) {
|
| layer->maskLayer()->setRenderTarget(layer);
|
| layer->maskLayer()->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
|
| @@ -619,6 +626,9 @@ static void calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay
|
| }
|
| }
|
|
|
| + if (shouldAdjustTextAA)
|
| + layer->setCanUseLCDText(layerCanUseLCDText);
|
| +
|
| IntRect rectInTargetSpace = enclosingIntRect(CCMathUtil::mapClippedRect(layer->drawTransform(), contentRect));
|
|
|
| if (layerClipsSubtree(layer)) {
|
| @@ -654,7 +664,7 @@ static void calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay
|
| LayerType* child = CCLayerTreeHostCommon::getChildAsRawPtr(layer->children(), i);
|
| IntRect drawableContentRectOfChildSubtree;
|
| calculateDrawTransformsInternal<LayerType, LayerList, RenderSurfaceType, LayerSorter>(child, rootLayer, sublayerMatrix, nextHierarchyMatrix, nextScrollCompensationMatrix,
|
| - clipRectForSubtree, subtreeShouldBeClipped, nearestAncestorThatMovesPixels,
|
| + clipRectForSubtree, subtreeShouldBeClipped, canUseLCDText, nearestAncestorThatMovesPixels,
|
| renderSurfaceLayerList, descendants, layerSorter, maxTextureSize, deviceScaleFactor, drawableContentRectOfChildSubtree);
|
| if (!drawableContentRectOfChildSubtree.isEmpty()) {
|
| accumulatedDrawableContentRectOfChildren.unite(drawableContentRectOfChildSubtree);
|
| @@ -773,7 +783,7 @@ void CCLayerTreeHostCommon::calculateDrawTransforms(LayerChromium* rootLayer, co
|
| setupRootLayerAndSurfaceForRecursion<LayerChromium, std::vector<scoped_refptr<LayerChromium> > >(rootLayer, renderSurfaceLayerList, deviceViewportSize);
|
|
|
| cc::calculateDrawTransformsInternal<LayerChromium, std::vector<scoped_refptr<LayerChromium> >, RenderSurfaceChromium, void>(rootLayer, rootLayer, deviceScaleTransform, identityMatrix, identityMatrix,
|
| - rootLayer->renderSurface()->contentRect(), true, 0, renderSurfaceLayerList,
|
| + rootLayer->renderSurface()->contentRect(), true, true, 0, renderSurfaceLayerList,
|
| rootLayer->renderSurface()->layerList(), 0, maxTextureSize, deviceScaleFactor, totalDrawableContentRect);
|
| }
|
|
|
| @@ -787,7 +797,7 @@ void CCLayerTreeHostCommon::calculateDrawTransforms(CCLayerImpl* rootLayer, cons
|
| setupRootLayerAndSurfaceForRecursion<CCLayerImpl, std::vector<CCLayerImpl*> >(rootLayer, renderSurfaceLayerList, deviceViewportSize);
|
|
|
| cc::calculateDrawTransformsInternal<CCLayerImpl, std::vector<CCLayerImpl*>, CCRenderSurface, CCLayerSorter>(rootLayer, rootLayer, deviceScaleTransform, identityMatrix, identityMatrix,
|
| - rootLayer->renderSurface()->contentRect(), true, 0, renderSurfaceLayerList,
|
| + rootLayer->renderSurface()->contentRect(), true, true, 0, renderSurfaceLayerList,
|
| rootLayer->renderSurface()->layerList(), layerSorter, maxTextureSize, deviceScaleFactor, totalDrawableContentRect);
|
| }
|
|
|
|
|