--- 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.