Backout cf585138ff25 (bug 805939) for Windows build bustage on a CLOSED TREE

This commit is contained in:
Mark Hammond 2012-12-21 15:30:02 +11:00
parent 33743f8965
commit e249240d97
18 changed files with 31 additions and 203 deletions

View File

@ -615,6 +615,3 @@ pref("memory.free_dirty_pages", true);
// UAProfile settings
pref("wap.UAProf.url", "");
pref("wap.UAProf.tagname", "x-wap-profile");
// Wait up to this much milliseconds when orientation changed
pref("layers.orientation.sync.timeout", 1000);

View File

@ -5,6 +5,8 @@
#ifndef mozilla_dom_ScreenOrientation_h
#define mozilla_dom_ScreenOrientation_h
#include "ipc/IPCMessageUtils.h"
namespace mozilla {
namespace dom {

View File

@ -94,7 +94,6 @@ LOCAL_INCLUDES += \
-I$(topsrcdir)/widget/xpwidgets \
-I$(topsrcdir)/dom/bluetooth \
-I$(topsrcdir)/dom/bluetooth/ipc \
-I$(topsrcdir)/hal \
$(NULL)
DEFINES += -DBIN_SUFFIX='"$(BIN_SUFFIX)"'

View File

@ -20,7 +20,6 @@ include "gfxMatrix.h";
include "FrameMetrics.h";
include "IPC/nsGUIEventIPC.h";
include "mozilla/dom/TabMessageUtils.h";
include "mozilla/dom/ScreenOrientation.h";
include "mozilla/dom/PermissionMessageUtils.h";
include "mozilla/layout/RenderFrameUtils.h";
@ -48,7 +47,6 @@ using nsSelectionEvent;
using nsTextEvent;
using nsTouchEvent;
using RemoteDOMEvent;
using mozilla::dom::ScreenOrientation;
namespace mozilla {
namespace dom {
@ -290,7 +288,7 @@ child:
LoadURL(nsCString uri);
UpdateDimensions(nsRect rect, nsIntSize size, ScreenOrientation orientation) compress;
UpdateDimensions(nsRect rect, nsIntSize size) compress;
UpdateFrame(FrameMetrics frame) compress;

View File

@ -168,7 +168,6 @@ TabChild::TabChild(const TabContext& aContext, uint32_t aChromeFlags)
, mNotified(false)
, mContentDocumentIsDisplayed(false)
, mTriedBrowserInit(false)
, mOrientation(eScreenOrientation_PortraitPrimary)
{
printf("creating %d!\n", NS_IsMainThread());
}
@ -1120,7 +1119,7 @@ TabChild::RecvShow(const nsIntSize& size)
}
bool
TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const ScreenOrientation& orientation)
TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size)
{
if (!mRemoteFrame) {
return true;
@ -1131,7 +1130,6 @@ TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const
mOuterRect.width = rect.width;
mOuterRect.height = rect.height;
mOrientation = orientation;
mInnerSize = size;
mWidget->Resize(0, 0, size.width, size.height,
true);

View File

@ -197,7 +197,7 @@ public:
virtual bool RecvLoadURL(const nsCString& uri);
virtual bool RecvShow(const nsIntSize& size);
virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const ScreenOrientation& orientation);
virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size);
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
virtual bool RecvHandleDoubleTap(const nsIntPoint& aPoint);
virtual bool RecvHandleSingleTap(const nsIntPoint& aPoint);
@ -291,8 +291,6 @@ public:
gfxSize GetZoom() { return mLastMetrics.mZoom; }
ScreenOrientation GetOrientation() { return mOrientation; }
void SetBackgroundColor(const nscolor& aColor);
void NotifyPainted();
@ -419,7 +417,6 @@ private:
bool mContentDocumentIsDisplayed;
bool mTriedBrowserInit;
nsString mAppType;
ScreenOrientation mOrientation;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};

View File

@ -51,7 +51,6 @@
#include "nsThreadUtils.h"
#include "StructuredCloneUtils.h"
#include "TabChild.h"
#include "Hal.h"
using namespace mozilla::dom;
using namespace mozilla::ipc;
@ -257,10 +256,7 @@ TabParent::UpdateDimensions(const nsRect& rect, const nsIntSize& size)
if (mIsDestroyed) {
return;
}
hal::ScreenConfiguration config;
hal::GetCurrentScreenConfiguration(&config);
unused << SendUpdateDimensions(rect, size, config.orientation());
unused << SendUpdateDimensions(rect, size);
if (RenderFrameParent* rfp = GetRenderFrame()) {
rfp->NotifyDimensionsChanged(size.width, size.height);
}

View File

@ -199,7 +199,6 @@ include $(topsrcdir)/ipc/chromium/chromium-config.mk
LOCAL_INCLUDES += \
-I$(topsrcdir)/content/events/src \
-I$(topsrcdir)/hal \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright/openmax \
$(NULL)

View File

@ -15,7 +15,6 @@
#include "nsXULAppAPI.h"
#include "RenderTrace.h"
#include "sampler.h"
#include "Hal.h"
#define PIXMAN_DONT_DEFINE_STDINT
#include "pixman.h"
@ -1095,17 +1094,7 @@ BasicShadowLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
// don't signal a new transaction to ShadowLayerForwarder. Carry on adding
// to the previous transaction.
if (HasShadowManager()) {
ScreenOrientation orientation;
nsIntRect clientBounds;
if (TabChild* window = mWidget->GetOwningTabChild()) {
orientation = window->GetOrientation();
} else {
hal::ScreenConfiguration currentConfig;
hal::GetCurrentScreenConfiguration(&currentConfig);
orientation = currentConfig.orientation();
}
mWidget->GetClientBounds(clientBounds);
ShadowLayerForwarder::BeginTransaction(mTargetBounds, mTargetRotation, clientBounds, orientation);
ShadowLayerForwarder::BeginTransaction(mTargetBounds, mTargetRotation);
// If we're drawing on behalf of a context with async pan/zoom
// enabled, then the entire buffer of thebes layers might be

View File

@ -34,14 +34,9 @@
#include "AnimationCommon.h"
#include "nsAnimationManager.h"
#include "TiledLayerBuffer.h"
#include "gfxPlatform.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/AutoRestore.h"
using namespace base;
using namespace mozilla;
using namespace mozilla::ipc;
using namespace mozilla::dom;
using namespace std;
namespace mozilla {
@ -65,7 +60,6 @@ static MessageLoop* sCompositorLoop = nullptr;
struct LayerTreeState {
nsRefPtr<Layer> mRoot;
nsRefPtr<AsyncPanZoomController> mController;
TargetConfig mTargetConfig;
};
static uint8_t sPanZoomUserDataKey;
@ -178,8 +172,6 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
, mEGLSurfaceSize(aSurfaceWidth, aSurfaceHeight)
, mPauseCompositionMonitor("PauseCompositionMonitor")
, mResumeCompositionMonitor("ResumeCompositionMonitor")
, mForceCompositionTask(nullptr)
, mOverrideComposeReadiness(false)
{
NS_ABORT_IF_FALSE(sCompositorThread != nullptr || sCompositorThreadID,
"The compositor thread must be Initialized before instanciating a COmpositorParent.");
@ -354,14 +346,6 @@ CompositorParent::ResumeComposition()
lock.NotifyAll();
}
void
CompositorParent::ForceComposition()
{
// Cancel the orientation changed state to force composition
mForceCompositionTask = nullptr;
ScheduleRenderOnCompositorThread();
}
void
CompositorParent::SetEGLSurfaceSize(int width, int height)
{
@ -485,15 +469,12 @@ public:
* guaranteed by this helper only being used during the drawing
* phase.
*/
AutoResolveRefLayers(Layer* aRoot, const TargetConfig& aConfig) : mRoot(aRoot), mTargetConfig(aConfig), mReadyForCompose(true)
AutoResolveRefLayers(Layer* aRoot) : mRoot(aRoot)
{ WalkTheTree<Resolve>(mRoot, nullptr); }
~AutoResolveRefLayers()
{ WalkTheTree<Detach>(mRoot, nullptr); }
bool IsReadyForCompose()
{ return mReadyForCompose; }
private:
enum Op { Resolve, Detach };
template<Op OP>
@ -501,28 +482,19 @@ private:
{
if (RefLayer* ref = aLayer->AsRefLayer()) {
if (const LayerTreeState* state = GetIndirectShadowTree(ref->GetReferentId())) {
Layer* referent = state->mRoot;
if (!ref->GetVisibleRegion().IsEmpty()) {
ScreenOrientation chromeOrientation = mTargetConfig.orientation();
ScreenOrientation contentOrientation = state->mTargetConfig.orientation();
if (!IsSameDimension(chromeOrientation, contentOrientation) &&
ContentMightReflowOnOrientationChange(mTargetConfig.clientBounds())) {
mReadyForCompose = false;
}
}
if (OP == Resolve) {
ref->ConnectReferentLayer(referent);
if (AsyncPanZoomController* apzc = state->mController) {
referent->SetUserData(&sPanZoomUserDataKey,
new PanZoomUserData(apzc));
if (Layer* referent = state->mRoot) {
if (OP == Resolve) {
ref->ConnectReferentLayer(referent);
if (AsyncPanZoomController* apzc = state->mController) {
referent->SetUserData(&sPanZoomUserDataKey,
new PanZoomUserData(apzc));
} else {
CompensateForContentScrollOffset(ref, referent);
}
} else {
CompensateForContentScrollOffset(ref, referent);
ref->DetachReferentLayer(referent);
referent->RemoveUserData(&sPanZoomUserDataKey);
}
} else {
ref->DetachReferentLayer(referent);
referent->RemoveUserData(&sPanZoomUserDataKey);
}
}
}
@ -557,19 +529,7 @@ private:
aContainer->AsShadowLayer()->SetShadowTransform(m);
}
bool IsSameDimension(ScreenOrientation o1, ScreenOrientation o2) {
bool isO1portrait = (o1 == eScreenOrientation_PortraitPrimary || o1 == eScreenOrientation_PortraitSecondary);
bool isO2portrait = (o2 == eScreenOrientation_PortraitPrimary || o2 == eScreenOrientation_PortraitSecondary);
return !(isO1portrait ^ isO2portrait);
}
bool ContentMightReflowOnOrientationChange(nsIntRect& rect) {
return rect.width != rect.height;
}
Layer* mRoot;
TargetConfig mTargetConfig;
bool mReadyForCompose;
AutoResolveRefLayers(const AutoResolveRefLayers&) MOZ_DELETE;
AutoResolveRefLayers& operator=(const AutoResolveRefLayers&) MOZ_DELETE;
@ -589,15 +549,7 @@ CompositorParent::Composite()
}
Layer* layer = mLayerManager->GetRoot();
AutoResolveRefLayers resolve(layer, mTargetConfig);
if (mForceCompositionTask && !mOverrideComposeReadiness) {
if (!resolve.IsReadyForCompose()) {
return;
} else {
mForceCompositionTask->Cancel();
mForceCompositionTask = nullptr;
}
}
AutoResolveRefLayers resolve(layer);
bool requestNextFrame = TransformShadowTree(mLastCompose);
if (requestNextFrame) {
@ -626,13 +578,9 @@ CompositorParent::Composite()
void
CompositorParent::ComposeToTarget(gfxContext* aTarget)
{
AutoRestore<bool> override(mOverrideComposeReadiness);
mOverrideComposeReadiness = true;
if (!CanComposite()) {
return;
}
mLayerManager->BeginTransactionWithTarget(aTarget);
// Since CanComposite() is true, Composite() must end the layers txn
// we opened above.
@ -1042,22 +990,6 @@ CompositorParent::ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
const TargetConfig& aTargetConfig,
bool isFirstPaint)
{
if (!isFirstPaint && !mIsFirstPaint && mTargetConfig.orientation() != aTargetConfig.orientation()) {
if (mForceCompositionTask != NULL) {
mForceCompositionTask->Cancel();
}
mForceCompositionTask = NewRunnableMethod(this, &CompositorParent::ForceComposition);
ScheduleTask(mForceCompositionTask, gfxPlatform::GetPlatform()->GetOrientationSyncMillis());
}
// Instruct the LayerManager to update its render bounds now. Since all the orientation
// change, dimension change would be done at the stage, update the size here is free of
// race condition.
if (LAYERS_OPENGL == mLayerManager->GetBackendType()) {
LayerManagerOGL* lm = static_cast<LayerManagerOGL*>(mLayerManager.get());
lm->UpdateRenderBounds(aTargetConfig.clientBounds());
}
mTargetConfig = aTargetConfig;
mIsFirstPaint = mIsFirstPaint || isFirstPaint;
mLayersUpdated = true;
@ -1320,10 +1252,9 @@ CompositorParent::Create(Transport* aTransport, ProcessId aOtherProcess)
}
static void
UpdateIndirectTree(uint64_t aId, Layer* aRoot, const TargetConfig& aTargetConfig, bool isFirstPaint)
UpdateIndirectTree(uint64_t aId, Layer* aRoot, bool isFirstPaint)
{
sIndirectLayerTrees[aId].mRoot = aRoot;
sIndirectLayerTrees[aId].mTargetConfig = aTargetConfig;
if (ContainerLayer* root = aRoot->AsContainerLayer()) {
if (AsyncPanZoomController* apzc = sIndirectLayerTrees[aId].mController) {
apzc->NotifyLayersUpdated(root->GetFrameMetrics(), isFirstPaint);
@ -1390,7 +1321,7 @@ CrossProcessCompositorParent::ShadowLayersUpdated(
if (shadowRoot) {
SetShadowProperties(shadowRoot);
}
UpdateIndirectTree(id, shadowRoot, aTargetConfig, isFirstPaint);
UpdateIndirectTree(id, shadowRoot, isFirstPaint);
sCurrentCompositor->NotifyShadowTreeTransaction();
}

View File

@ -58,7 +58,6 @@ class CompositorParent : public PCompositorParent,
public ShadowLayersManager
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorParent)
public:
CompositorParent(nsIWidget* aWidget,
bool aRenderToEGLSurface = false,
@ -181,7 +180,6 @@ private:
void PauseComposition();
void ResumeComposition();
void ResumeCompositionAndResize(int width, int height);
void ForceComposition();
// Sample transforms for layer trees. Return true to request
// another animation frame.
@ -293,9 +291,6 @@ private:
uint64_t mCompositorID;
bool mOverrideComposeReadiness;
CancelableTask* mForceCompositionTask;
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);
};

View File

@ -14,7 +14,6 @@ include protocol PRenderFrame;
include "gfxipc/ShadowLayerUtils.h";
include "mozilla/WidgetUtils.h";
include "mozilla/TimeStamp.h";
include "mozilla/dom/ScreenOrientation.h";
include "nsCSSProperty.h";
using gfxPoint3D;
@ -25,7 +24,6 @@ using mozilla::TimeDuration;
using mozilla::TimeStamp;
using mozilla::ScreenRotation;
using nsCSSProperty;
using mozilla::dom::ScreenOrientation;
/**
* The layers protocol is spoken between thread contexts that manage
@ -41,8 +39,6 @@ namespace layers {
struct TargetConfig {
nsIntRect naturalBounds;
ScreenRotation rotation;
nsIntRect clientBounds;
ScreenOrientation orientation;
};
// Create a shadow layer for |layer|

View File

@ -25,7 +25,6 @@
using namespace mozilla::ipc;
using namespace mozilla::gl;
using namespace mozilla::dom;
namespace mozilla {
namespace layers {
@ -43,8 +42,7 @@ public:
, mRotationChanged(false)
{}
void Begin(const nsIntRect& aTargetBounds, ScreenRotation aRotation,
const nsIntRect& aClientBounds, ScreenOrientation aOrientation)
void Begin(const nsIntRect& aTargetBounds, ScreenRotation aRotation)
{
mOpen = true;
mTargetBounds = aTargetBounds;
@ -52,8 +50,6 @@ public:
mRotationChanged = true;
}
mTargetRotation = aRotation;
mClientBounds = aClientBounds;
mTargetOrientation = aOrientation;
}
void AddEdit(const Edit& aEdit)
@ -111,8 +107,6 @@ public:
ShadowableLayerSet mMutants;
nsIntRect mTargetBounds;
ScreenRotation mTargetRotation;
nsIntRect mClientBounds;
ScreenOrientation mTargetOrientation;
bool mSwapRequired;
private:
@ -146,13 +140,11 @@ ShadowLayerForwarder::~ShadowLayerForwarder()
void
ShadowLayerForwarder::BeginTransaction(const nsIntRect& aTargetBounds,
ScreenRotation aRotation,
const nsIntRect& aClientBounds,
ScreenOrientation aOrientation)
ScreenRotation aRotation)
{
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
NS_ABORT_IF_FALSE(mTxn->Finished(), "uncommitted txn?");
mTxn->Begin(aTargetBounds, aRotation, aClientBounds, aOrientation);
mTxn->Begin(aTargetBounds, aRotation);
}
static PLayerChild*
@ -366,7 +358,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies)
cset.AppendElements(&mTxn->mPaints.front(), mTxn->mPaints.size());
}
TargetConfig targetConfig(mTxn->mTargetBounds, mTxn->mTargetRotation, mTxn->mClientBounds, mTxn->mTargetOrientation);
TargetConfig targetConfig(mTxn->mTargetBounds, mTxn->mTargetRotation);
MOZ_LAYERS_LOG(("[LayersForwarder] syncing before send..."));
PlatformSyncBeforeUpdate();

View File

@ -14,7 +14,6 @@
#include "ImageLayers.h"
#include "mozilla/ipc/SharedMemory.h"
#include "mozilla/WidgetUtils.h"
#include "mozilla/dom/ScreenOrientation.h"
class gfxSharedImageSurface;
@ -117,9 +116,7 @@ public:
* ShadowLayerManager.
*/
void BeginTransaction(const nsIntRect& aTargetBounds,
ScreenRotation aRotation,
const nsIntRect& aClientBounds,
mozilla::dom::ScreenOrientation aOrientation);
ScreenRotation aRotation);
/**
* The following methods may only be called after BeginTransaction()

View File

@ -1037,14 +1037,10 @@ LayerManagerOGL::Render()
if (mIsRenderingToEGLSurface) {
rect = nsIntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
} else {
rect = mRenderBounds;
// If render bounds is not updated explicitly, try to infer it from widget
if (rect.width == 0 || rect.height == 0) {
// FIXME/bug XXXXXX this races with rotation changes on the main
// thread, and undoes all the care we take with layers txns being
// sent atomically with rotation changes
mWidget->GetClientBounds(rect);
}
// FIXME/bug XXXXXX this races with rotation changes on the main
// thread, and undoes all the care we take with layers txns being
// sent atomically with rotation changes
mWidget->GetClientBounds(rect);
}
WorldTransformRect(rect);
@ -1269,12 +1265,6 @@ LayerManagerOGL::WorldTransformRect(nsIntRect& aRect)
aRect.SetRect(grect.X(), grect.Y(), grect.Width(), grect.Height());
}
void
LayerManagerOGL::UpdateRenderBounds(const nsIntRect& aRect)
{
mRenderBounds = aRect;
}
void
LayerManagerOGL::SetSurfaceSize(int width, int height)
{

View File

@ -290,8 +290,6 @@ public:
gfxMatrix& GetWorldTransform(void);
void WorldTransformRect(nsIntRect& aRect);
void UpdateRenderBounds(const nsIntRect& aRect);
/**
* Set the size of the surface we're rendering to.
*/
@ -416,7 +414,6 @@ private:
void *mThebesLayerCallbackData;
gfxMatrix mWorldMatrix;
nsAutoPtr<FPSState> mFPS;
nsIntRect mRenderBounds;
#ifdef DEBUG
// NB: only interesting when this is a purely compositing layer
// manager. True after possibly onscreen layers have had their

View File

@ -174,29 +174,7 @@ FontPrefsObserver::Observe(nsISupports *aSubject,
return NS_OK;
}
class OrientationSyncPrefsObserver : public nsIObserver
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
};
NS_IMPL_ISUPPORTS1(OrientationSyncPrefsObserver, nsIObserver)
NS_IMETHODIMP
OrientationSyncPrefsObserver::Observe(nsISupports *aSubject,
const char *aTopic,
const PRUnichar *someData)
{
if (!someData) {
NS_ERROR("orientation sync pref observer broken");
return NS_ERROR_UNEXPECTED;
}
NS_ASSERTION(gfxPlatform::GetPlatform(), "the singleton instance has gone");
gfxPlatform::GetPlatform()->OrientationSyncPrefsObserverChanged();
return NS_OK;
}
// this needs to match the list of pref font.default.xx entries listed in all.js!
// the order *must* match the order in eFontPrefLang
@ -360,9 +338,6 @@ gfxPlatform::Init()
gPlatform->mFontPrefsObserver = new FontPrefsObserver();
Preferences::AddStrongObservers(gPlatform->mFontPrefsObserver, kObservedPrefs);
gPlatform->mOrientationSyncPrefsObserver = new OrientationSyncPrefsObserver();
Preferences::AddStrongObserver(gPlatform->mOrientationSyncPrefsObserver, "layers.orientation.sync.timeout");
gPlatform->mWorkAroundDriverBugs = Preferences::GetBool("gfx.work-around-driver-bugs", true);
mozilla::Preferences::AddBoolVarCache(&gPlatform->mWidgetUpdateFlashing,
@ -384,8 +359,6 @@ gfxPlatform::Init()
gPlatform->mRecorder = Factory::CreateEventRecorderForFile("browserrecording.aer");
Factory::SetGlobalEventRecorder(gPlatform->mRecorder);
}
gPlatform->mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
}
void
@ -1726,15 +1699,3 @@ gfxPlatform::OptimalFormatForContent(gfxASurface::gfxContentType aContent)
return gfxASurface::ImageFormatARGB32;
}
}
void
gfxPlatform::OrientationSyncPrefsObserverChanged()
{
mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
}
uint32_t
gfxPlatform::GetOrientationSyncMillis() const
{
return mOrientationSyncMillis;
}

View File

@ -469,8 +469,6 @@ public:
virtual void FontsPrefsChanged(const char *aPref);
void OrientationSyncPrefsObserverChanged();
int32_t GetBidiNumeralOption();
/**
@ -497,8 +495,6 @@ public:
bool WidgetUpdateFlashing() const { return mWidgetUpdateFlashing; }
uint32_t GetOrientationSyncMillis() const;
protected:
gfxPlatform();
virtual ~gfxPlatform();
@ -580,7 +576,6 @@ private:
nsTArray<uint32_t> mCJKPrefLangs;
nsCOMPtr<nsIObserver> mSRGBOverrideObserver;
nsCOMPtr<nsIObserver> mFontPrefsObserver;
nsCOMPtr<nsIObserver> mOrientationSyncPrefsObserver;
// The preferred draw target backend to use for canvas
mozilla::gfx::BackendType mPreferredCanvasBackend;
@ -594,7 +589,6 @@ private:
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
bool mWidgetUpdateFlashing;
uint32_t mOrientationSyncMillis;
};
#endif /* GFX_PLATFORM_H */