Address next set of review comments.

This commit is contained in:
Ali Juma 2012-01-16 10:31:16 -05:00
parent a40fdfe089
commit 8e3b3d5ff3
11 changed files with 12 additions and 147 deletions

View File

@ -131,7 +131,6 @@ endif
EXPORTS_NAMESPACES = gfxipc mozilla/layers
EXPORTS_gfxipc = ShadowLayerUtils.h
EXPORTS_mozilla/layers =\
Compositor.h \
CompositorChild.h \
CompositorParent.h \
ShadowLayers.h \
@ -141,7 +140,6 @@ EXPORTS_mozilla/layers =\
$(NULL)
CPPSRCS += \
Compositor.cpp \
CompositorChild.cpp \
CompositorParent.cpp \
ShadowLayers.cpp \

View File

@ -1,58 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=2 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Content App.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Benoit Girard <bgirard@mozilla.com>
* Ali Juma <ajuma@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "CompositorParent.h"
#include "Compositor.h"
#include "nsDebug.h"
namespace mozilla {
namespace layers {
namespace compositor {
LayerManager*
GetLayerManager(CompositorParent* aParent)
{
return aParent->GetLayerManager();
}
}
}
}

View File

@ -1,64 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Content App.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Benoit Girard <bgirard@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef mozilla_layers_Compositor_h
#define mozilla_layers_Compositor_h
// Note we can't include IPDL generated headers here
#include "Layers.h"
#include "nsDebug.h"
namespace mozilla {
namespace layers {
class CompositorParent;
class LayerManager;
namespace compositor {
// Needed when we cannot directly include CompositorParent.h since it includes
// an IPDL-generated header (e.g. IPDL-generated headers cannot be included in
// widget/src/cocoa).
LayerManager* GetLayerManager(CompositorParent* aParent);
}
}
}
#endif

View File

@ -40,12 +40,10 @@
#include "CompositorChild.h"
#include "CompositorParent.h"
#include "Compositor.h"
#include "LayerManagerOGL.h"
#include "mozilla/layers/ShadowLayersChild.h"
using mozilla::layers::ShadowLayersChild;
using namespace mozilla::layers::compositor;
namespace mozilla {
namespace layers {

View File

@ -57,13 +57,6 @@ CompositorParent::~CompositorParent()
MOZ_COUNT_DTOR(CompositorParent);
}
bool
CompositorParent::RecvFixMeDoNotCall()
{
NS_RUNTIMEABORT("not reached");
return NULL;
}
void
CompositorParent::Destroy()
{
@ -104,6 +97,7 @@ CompositorParent::Composite()
static void
SetShadowProperties(Layer* aLayer)
{
// FIXME: Bug 717688 -- Do these updates in ShadowLayersParent::RecvUpdate.
ShadowLayer* shadow = aLayer->AsShadowLayer();
shadow->SetShadowTransform(aLayer->GetTransform());
shadow->SetShadowVisibleRegion(aLayer->GetVisibleRegion());
@ -134,6 +128,7 @@ CompositorParent::AllocPLayers(const LayersBackend &backendType)
{
if (backendType == LayerManager::LAYERS_OPENGL) {
nsRefPtr<LayerManagerOGL> layerManager = new LayerManagerOGL(mWidget);
mWidget = NULL;
mLayerManager = layerManager;
if (!layerManager->Initialize()) {

View File

@ -60,12 +60,9 @@ public:
CompositorParent(nsIWidget* aWidget);
virtual ~CompositorParent();
bool RecvStop();
virtual bool RecvStop() MOZ_OVERRIDE;
// Workaround for Bug 717027.
bool RecvFixMeDoNotCall();
virtual void ShadowLayersUpdated();
virtual void ShadowLayersUpdated() MOZ_OVERRIDE;
void Destroy();
LayerManager* GetLayerManager() { return mLayerManager; }

View File

@ -64,9 +64,6 @@ parent:
// Clean up in preparation for destruction.
sync Stop();
// Workaround for Bug 717027.
async FixMeDoNotCall();
sync PLayers(LayersBackend backend);
};

View File

@ -86,7 +86,7 @@ public:
void ContentViewScaleChanged(nsContentView* aView);
virtual void ShadowLayersUpdated();
virtual void ShadowLayersUpdated() MOZ_OVERRIDE;
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame,

View File

@ -145,3 +145,5 @@ LDFLAGS += \
-framework IOKit \
-F/System/Library/PrivateFrameworks -framework CoreUI \
$(NULL)
include $(topsrcdir)/ipc/chromium/chromium-config.mk

View File

@ -41,10 +41,9 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/layers/CompositorParent.h"
#include "mozilla/Util.h"
#include "mozilla/layers/Compositor.h"
#ifdef MOZ_LOGGING
#define FORCE_PR_LOG
#endif
@ -1778,7 +1777,7 @@ nsChildView::CreateCompositor()
nsBaseWidget::CreateCompositor();
if (mCompositorChild) {
LayerManagerOGL *manager =
static_cast<LayerManagerOGL*>(compositor::GetLayerManager(mCompositorParent));
static_cast<LayerManagerOGL*>(mCompositorParent->GetLayerManager());
NSOpenGLContext *glContext =
(NSOpenGLContext *) manager->gl()->GetNativeData(GLContext::NativeGLContext);

View File

@ -837,7 +837,8 @@ void nsBaseWidget::CreateCompositor()
AsyncChannel *parentChannel = mCompositorParent->GetIPCChannel();
AsyncChannel::Side childSide = mozilla::ipc::AsyncChannel::Child;
mCompositorChild->Open(parentChannel, childMessageLoop, childSide);
PLayersChild* shadowManager = mCompositorChild->SendPLayersConstructor( LayerManager::LAYERS_OPENGL);
PLayersChild* shadowManager =
mCompositorChild->SendPLayersConstructor(LayerManager::LAYERS_OPENGL);
if (shadowManager) {
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
@ -882,7 +883,7 @@ LayerManager* nsBaseWidget::GetLayerManager(PLayersChild* aShadowManager,
nsRefPtr<LayerManagerOGL> layerManager = new LayerManagerOGL(this);
/**
* XXX - On several OSes initialization is expected to fail for now.
* If we'd get a none-basic layer manager they'd crash. This is ok though
* If we'd get a non-basic layer manager they'd crash. This is ok though
* since on those platforms it will fail. Anyone implementing new
* platforms on LayerManagerOGL should ensure their widget is able to
* deal with it though!