Build fixes and clean up
authorBenoit Girard <b56girard@gmail.com>
Wed, 08 Feb 2012 12:08:03 -0500
changeset 90907 b067db598cdd5941d64b165bc599caa09151bf9f
parent 90904 939db6b3f90aa04cdccc812c4366f9f5a43c0dd0
child 90909 932a5ef6c872505e19cc30370b1f931fd4b6e56a
child 90910 dbce328867a2e7a7188065eb7e187193ad4ce859
push idunknown
push userunknown
push dateunknown
milestone12.0a1
Build fixes and clean up
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/ipc/CompositorParent.h
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -47,19 +47,19 @@
 #include "AndroidBridge.h"
 #include <android/log.h>
 #endif
 
 namespace mozilla {
 namespace layers {
 
 CompositorParent::CompositorParent(nsIWidget* aWidget)
-  : mPaused(false)
-  , mWidget(aWidget)
+  : mWidget(aWidget)
   , mCurrentCompositeTask(NULL)
+  , mPaused(false)
 {
   MOZ_COUNT_CTOR(CompositorParent);
 }
 
 CompositorParent::~CompositorParent()
 {
   MOZ_COUNT_DTOR(CompositorParent);
 }
@@ -177,23 +177,28 @@ CompositorParent::Composite()
   RequestViewTransform();
 #endif
 
   gfx3DMatrix worldTransform;
   gfxPoint3D offset(-mScrollOffset.x, -mScrollOffset.y, 0.0f);
   printf_stderr("Correcting for position fixed %i, %i\n", -mScrollOffset.x, -mScrollOffset.y);
   worldTransform.Translate(offset);
   worldTransform.Scale(mXScale, mYScale, 1.0f);
+#ifdef MOZ_WIDGET_ANDROID
   Layer* layer = GetPrimaryScrollableLayer();
+#else
+  Layer* root = mLayerManager->GetRoot();
+#endif
   layer->AsShadowLayer()->SetShadowTransform(worldTransform);
 
   mLayerManager->EndEmptyTransaction();
   mLastCompose = mozilla::TimeStamp::Now();
 }
 
+#ifdef MOZ_WIDGET_ANDROID
 // Do a breadth-first search to find the first layer in the tree with a
 // displayport set.
 Layer*
 CompositorParent::GetPrimaryScrollableLayer()
 {
   Layer* root = mLayerManager->GetRoot();
 
   nsTArray<Layer*> queue;
@@ -213,16 +218,17 @@ CompositorParent::GetPrimaryScrollableLa
     while (child) {
       queue.AppendElement(child);
       child = child->GetNextSibling();
     }
   }
 
   return root;
 }
+#endif
 
 // Go down shadow layer tree, setting properties to match their non-shadow
 // counterparts.
 static void
 SetShadowProperties(Layer* aLayer)
 {
   // FIXME: Bug 717688 -- Do these updates in ShadowLayersParent::RecvUpdate.
   ShadowLayer* shadow = aLayer->AsShadowLayer();
@@ -406,22 +412,16 @@ CompositorParent::TestScroll()
   CancelableTask *composeTask = NewRunnableMethod(this, &CompositorParent::TestScroll);
   MessageLoop::current()->PostDelayedTask(FROM_HERE, composeTask, 1000/65);
 }
 #endif
 
 PLayersParent*
 CompositorParent::AllocPLayers(const LayersBackend &backendType)
 {
-#ifdef MOZ_WIDGET_ANDROID
-  // Registering with the compositor will create the surface view that
-  // the layer manager expects to attach to.
-  //RegisterCompositorWithJava();
-#endif
-
   if (backendType == LayerManager::LAYERS_OPENGL) {
     nsRefPtr<LayerManagerOGL> layerManager = new LayerManagerOGL(mWidget);
     mWidget = NULL;
     mLayerManager = layerManager;
 
     if (!layerManager->Initialize()) {
       NS_ERROR("Failed to init OGL Layers");
       return NULL;
@@ -440,19 +440,11 @@ CompositorParent::AllocPLayers(const Lay
 
 bool
 CompositorParent::DeallocPLayers(PLayersParent* actor)
 {
   delete actor;
   return true;
 }
 
-#ifdef MOZ_WIDGET_ANDROID
-void
-CompositorParent::RegisterCompositorWithJava()
-{
-  mozilla::AndroidBridge::Bridge()->RegisterCompositor();
-}
-#endif
-
 } // namespace layers
 } // namespace mozilla
 
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -110,23 +110,16 @@ private:
 #endif
   void TransformShadowTree(Layer* aLayer, const ViewTransform& aTransform,
                            float aTempScaleDiffX = 1.0,
                            float aTempScaleDiffY = 1.0);
 
   // Platform specific functions
 #ifdef MOZ_WIDGET_ANDROID
   /**
-   * Register the compositor thread with the Java native thread.
-   * This will replace the temporary compositor with the real
-   * Gecko compositor thread.
-   **/
-  void RegisterCompositorWithJava();
-
-  /**
    * Asks Java for the viewport position and updates the world transform
    * accordingly.
    */
   void RequestViewTransform();
 
   /**
    * Does a breadth-first search to find the first layer in the tree with a
    * displayport set.