Bug 634759 Allow buffer rotation for mobile r=roc
authorBenjamin Stover <bstover@mozilla.com>
Mon, 29 Aug 2011 10:56:50 -0700
changeset 76189 5e6848a5ca2a26a8266df2a4c10ad5828ddbc1c7
parent 76188 9f7ccdc68e3f087a805d21afd67ac6c981deb67e
child 76190 f092ce58bc204e65f01482da8e4a978cbce00fe3
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersroc
bugs634759
milestone9.0a1
Bug 634759 Allow buffer rotation for mobile r=roc
gfx/layers/basic/BasicLayers.cpp
gfx/layers/opengl/ThebesLayerOGL.cpp
--- a/gfx/layers/basic/BasicLayers.cpp
+++ b/gfx/layers/basic/BasicLayers.cpp
@@ -708,22 +708,23 @@ BasicThebesLayer::PaintThebes(gfxContext
 
       aContext->Restore();
     }
     return;
   }
 
   {
     PRUint32 flags = 0;
+#ifndef MOZ_GFX_OPTIMIZE_MOBILE
     gfxMatrix transform;
     if (!GetEffectiveTransform().CanDraw2D(&transform) ||
-        transform.HasNonIntegerTranslation() ||
-        MustRetainContent() /*<=> has shadow layer*/) {
+        transform.HasNonIntegerTranslation()) {
       flags |= ThebesLayerBuffer::PAINT_WILL_RESAMPLE;
     }
+#endif
     Buffer::PaintState state =
       mBuffer.BeginPaint(this, contentType, flags);
     mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);
 
     if (state.mContext) {
       // The area that became invalid and is visible needs to be repainted
       // (this could be the whole visible area if our buffer switched
       // from RGB to RGBA, because we might need to repaint with
--- a/gfx/layers/opengl/ThebesLayerOGL.cpp
+++ b/gfx/layers/opengl/ThebesLayerOGL.cpp
@@ -744,25 +744,27 @@ ThebesLayerOGL::RenderLayer(int aPreviou
 
   mOGLManager->MakeCurrent();
   gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
 
   TextureImage::ContentType contentType =
     CanUseOpaqueSurface() ? gfxASurface::CONTENT_COLOR :
                             gfxASurface::CONTENT_COLOR_ALPHA;
 
+  PRUint32 flags = 0;
+#ifndef MOZ_GFX_OPTIMIZE_MOBILE
   gfxMatrix transform2d;
-  PRUint32 flags = 0;
   if (GetEffectiveTransform().Is2D(&transform2d)) {
     if (transform2d.HasNonIntegerTranslation()) {
       flags |= ThebesLayerBufferOGL::PAINT_WILL_RESAMPLE;
     }
   } else {
     flags |= ThebesLayerBufferOGL::PAINT_WILL_RESAMPLE;
   }
+#endif
 
   Buffer::PaintState state = mBuffer->BeginPaint(contentType, flags);
   mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);
 
   if (state.mContext) {
     state.mRegionToInvalidate.And(state.mRegionToInvalidate, mVisibleRegion);
 
     LayerManager::DrawThebesLayerCallback callback =