Bug 805689. Don't copy when we don't need subpixel AA. r=mwoodrow

Avoid copying the background for subpixel AA when we aren't using
subpixel AA rendering.
This commit is contained in:
Jeff Muizelaar 2012-10-31 22:12:26 -04:00
parent f42a5be8e2
commit 7cb5d16857
2 changed files with 12 additions and 2 deletions

View File

@ -5,6 +5,7 @@
#include "ContainerLayerOGL.h"
#include "gfxUtils.h"
#include "gfxPlatform.h"
namespace mozilla {
namespace layers {
@ -209,10 +210,12 @@ ContainerRender(Container* aContainer,
// not safe.
if (HasOpaqueAncestorLayer(aContainer) &&
transform3D.Is2D(&transform) && !transform.HasNonIntegerTranslation()) {
mode = LayerManagerOGL::InitModeCopy;
mode = gfxPlatform::GetPlatform()->UsesSubpixelAATextRendering() ?
LayerManagerOGL::InitModeCopy :
LayerManagerOGL::InitModeClear;
framebufferRect.x += transform.x0;
framebufferRect.y += transform.y0;
aContainer->mSupportsComponentAlphaChildren = true;
aContainer->mSupportsComponentAlphaChildren = gfxPlatform::GetPlatform()->UsesSubpixelAATextRendering();
}
}

View File

@ -310,6 +310,13 @@ public:
*/
virtual bool FontHintingEnabled() { return true; }
bool UsesSubpixelAATextRendering() {
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
return false;
#endif
return true;
}
/**
* Whether to check all font cmaps during system font fallback
*/