Back out 9fb78d71f361, 28f8ce199bed, 78ffaa79a3de, 9f6f9b74d685 (bug 779940 and bug 778036) because of Android failures

This commit is contained in:
Matt Brubeck 2012-08-06 21:59:01 -07:00
Родитель abdbb9d224
Коммит b9fbf3dea9
10 изменённых файлов: 33 добавлений и 157 удалений

Просмотреть файл

@ -102,7 +102,6 @@ TabChild::TabChild(PRUint32 aChromeFlags, bool aIsBrowserElement,
, mDidFakeShow(false)
, mIsBrowserElement(aIsBrowserElement)
, mAppId(aAppId)
, mNotified(false)
{
printf("creating %d!\n", NS_IsMainThread());
}
@ -1184,9 +1183,17 @@ TabChild::SetBackgroundColor(const nscolor& aColor)
void
TabChild::NotifyPainted()
{
if (UseDirectCompositor() && !mNotified) {
if (UseDirectCompositor()) {
// FIXME/bug XXXXXX: in theory, we should only have to push a
// txn to our remote frame once, and the
// display-list/FrameLayerBuilder code there will manage the
// tree from there on. But in practice, that doesn't work for
// some unknown reason. So for now, always notify the content
// thread in the parent process. It's wasteful but won't
// result in unnecessary repainting or even composites
// (usually, unless timing is unlucky), since they're
// throttled.
mRemoteFrame->SendNotifyCompositorTransaction();
mNotified = true;
}
}

Просмотреть файл

@ -305,7 +305,6 @@ private:
ScrollingBehavior mScrolling;
bool mDidFakeShow;
bool mIsBrowserElement;
bool mNotified;
PRUint32 mAppId;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);

Просмотреть файл

@ -539,10 +539,8 @@ public:
NS_ASSERTION((aFlags & (CONTENT_OPAQUE | CONTENT_COMPONENT_ALPHA)) !=
(CONTENT_OPAQUE | CONTENT_COMPONENT_ALPHA),
"Can't be opaque and require component alpha");
if (mContentFlags != aFlags) {
mContentFlags = aFlags;
Mutated();
}
mContentFlags = aFlags;
Mutated();
}
/**
* CONSTRUCTION PHASE ONLY
@ -559,10 +557,8 @@ public:
*/
virtual void SetVisibleRegion(const nsIntRegion& aRegion)
{
if (!mVisibleRegion.IsEqual(aRegion)) {
mVisibleRegion = aRegion;
Mutated();
}
mVisibleRegion = aRegion;
Mutated();
}
/**
@ -572,10 +568,8 @@ public:
*/
void SetOpacity(float aOpacity)
{
if (mOpacity != aOpacity) {
mOpacity = aOpacity;
Mutated();
}
mOpacity = aOpacity;
Mutated();
}
/**
@ -590,25 +584,11 @@ public:
*/
void SetClipRect(const nsIntRect* aRect)
{
if (mUseClipRect) {
if (!aRect) {
mUseClipRect = false;
Mutated();
} else {
if (!aRect->IsEqualEdges(mClipRect)) {
mClipRect = *aRect;
Mutated();
}
}
} else {
if (aRect) {
Mutated();
mUseClipRect = true;
if (!aRect->IsEqualEdges(mClipRect)) {
mClipRect = *aRect;
}
}
mUseClipRect = aRect != nullptr;
if (aRect) {
mClipRect = *aRect;
}
Mutated();
}
/**
@ -657,10 +637,8 @@ public:
}
#endif
if (mMaskLayer != aMaskLayer) {
mMaskLayer = aMaskLayer;
Mutated();
}
mMaskLayer = aMaskLayer;
Mutated();
}
/**
@ -672,9 +650,6 @@ public:
*/
void SetBaseTransform(const gfx3DMatrix& aMatrix)
{
if (mTransform == aMatrix) {
return;
}
mTransform = aMatrix;
Mutated();
}
@ -1129,10 +1104,8 @@ public:
*/
void SetFrameMetrics(const FrameMetrics& aFrameMetrics)
{
if (mFrameMetrics != aFrameMetrics) {
mFrameMetrics = aFrameMetrics;
Mutated();
}
mFrameMetrics = aFrameMetrics;
Mutated();
}
void SetPreScale(float aXScale, float aYScale)
@ -1422,10 +1395,7 @@ public:
void SetReferentId(uint64_t aId)
{
MOZ_ASSERT(aId != 0);
if (mId != aId) {
mId = aId;
Mutated();
}
mId = aId;
}
/**
* CONSTRUCTION PHASE ONLY

Просмотреть файл

@ -320,16 +320,6 @@ CompositorParent::ScheduleTask(CancelableTask* task, int time)
}
}
void
CompositorParent::NotifyShadowTreeTransaction()
{
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
if (shadow) {
shadow->NotifyShadowTreeTransaction();
}
ScheduleComposition();
}
void
CompositorParent::ScheduleComposition()
{
@ -896,10 +886,6 @@ CompositorParent::ShadowLayersUpdated(ShadowLayersParent* aLayerTree,
SetShadowProperties(root);
}
ScheduleComposition();
ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
if (shadow) {
shadow->NotifyShadowTreeTransaction();
}
}
PLayersParent*
@ -1207,7 +1193,7 @@ CrossProcessCompositorParent::ShadowLayersUpdated(
}
UpdateIndirectTree(id, shadowRoot, isFirstPaint);
sCurrentCompositor->NotifyShadowTreeTransaction();
sCurrentCompositor->ScheduleComposition();
}
void

Просмотреть файл

@ -86,7 +86,6 @@ public:
void ScheduleResumeOnCompositorThread(int width, int height);
virtual void ScheduleComposition();
void NotifyShadowTreeTransaction();
/**
* Returns a pointer to the compositor corresponding to the given ID.

Просмотреть файл

@ -411,8 +411,6 @@ public:
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowRefLayer> CreateShadowRefLayer() { return nullptr; }
virtual void NotifyShadowTreeTransaction() {}
/**
* Try to open |aDescriptor| for direct texturing. If the
* underlying surface supports direct texturing, a non-null

Просмотреть файл

@ -506,12 +506,6 @@ LayerManagerOGL::RootLayer() const
bool LayerManagerOGL::sDrawFPS = false;
void
LayerManagerOGL::FPSState::NotifyShadowTreeTransaction()
{
contentFCount++;
}
/* This function tries to stick to portable C89 as much as possible
* so that it can be easily copied into other applications */
void
@ -527,13 +521,6 @@ LayerManagerOGL::FPSState::DrawFPS(GLContext* context, ShaderProgramOGL* copypro
fps = rate / duration.ToSeconds() + .5;
fcount = 0;
}
if (contentFCount >= rate) {
TimeStamp now = TimeStamp::Now();
TimeDuration duration = now - contentLast;
contentLast = now;
contentFps = contentFCount / duration.ToSeconds() + .5;
contentFCount = 0;
}
GLint viewport[4];
context->fGetIntegerv(LOCAL_GL_VIEWPORT, viewport);
@ -588,34 +575,13 @@ LayerManagerOGL::FPSState::DrawFPS(GLContext* context, ShaderProgramOGL* copypro
{ -1.0f + 44.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 44.f / viewport[2], 1.0f },
{ -1.0f + 66.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 66.f / viewport[2], 1.0f },
};
const Vertex2D vertices2[] = {
{ -1.0f + 80.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 80.f / viewport[2], 1.0f },
{ -1.0f + 102.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 102.f / viewport[2], 1.0f },
{ -1.0f + 102.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 102.f / viewport[2], 1.0f },
{ -1.0f + 124.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 124.f / viewport[2], 1.0f },
{ -1.0f + 124.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 124.f / viewport[2], 1.0f },
{ -1.0f + 146.f / viewport[2], 1.0f - 42.f / viewport[3] },
{ -1.0f + 146.f / viewport[2], 1.0f },
{ -1.0f + 66.f / viewport[2], 1.0f }
};
int v1 = fps % 10;
int v10 = (fps % 100) / 10;
int v100 = (fps % 1000) / 100;
int content1 = contentFps % 10;
int content10 = (contentFps % 100) / 10;
int content100 = (contentFps % 1000) / 100;
// Feel free to comment these texture coordinates out and use one
// of the ones below instead, or play around with your own values.
const GLfloat texCoords[] = {
@ -634,23 +600,6 @@ LayerManagerOGL::FPSState::DrawFPS(GLContext* context, ShaderProgramOGL* copypro
(v1 * 4.f + 4) / 64, 7.f / 8,
(v1 * 4.f + 4) / 64, 0.0f,
};
const GLfloat texCoords2[] = {
(content100 * 4.f) / 64, 7.f / 8,
(content100 * 4.f) / 64, 0.0f,
(content100 * 4.f + 4) / 64, 7.f / 8,
(content100 * 4.f + 4) / 64, 0.0f,
(content10 * 4.f) / 64, 7.f / 8,
(content10 * 4.f) / 64, 0.0f,
(content10 * 4.f + 4) / 64, 7.f / 8,
(content10 * 4.f + 4) / 64, 0.0f,
(content1 * 4.f) / 64, 7.f / 8,
(content1 * 4.f) / 64, 0.0f,
(content1 * 4.f + 4) / 64, 7.f / 8,
(content1 * 4.f + 4) / 64, 0.0f,
};
// Turn necessary features on
context->fEnable(LOCAL_GL_BLEND);
@ -688,18 +637,6 @@ LayerManagerOGL::FPSState::DrawFPS(GLContext* context, ShaderProgramOGL* copypro
0, texCoords);
context->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 12);
context->fVertexAttribPointer(vcattr,
2, LOCAL_GL_FLOAT,
LOCAL_GL_FALSE,
0, vertices2);
context->fVertexAttribPointer(tcattr,
2, LOCAL_GL_FLOAT,
LOCAL_GL_FALSE,
0, texCoords2);
context->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 12);
}
// |aTexCoordRect| is the rectangle from the texture that we want to
@ -777,12 +714,6 @@ LayerManagerOGL::BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
}
}
void
LayerManagerOGL::NotifyShadowTreeTransaction()
{
mFPS.NotifyShadowTreeTransaction();
}
void
LayerManagerOGL::Render()
{

Просмотреть файл

@ -103,7 +103,6 @@ public:
void EndConstruction();
virtual bool EndEmptyTransaction();
virtual void NotifyShadowTreeTransaction();
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData,
EndTransactionFlags aFlags = END_DEFAULT);
@ -443,22 +442,15 @@ private:
int fcount;
TimeStamp last;
int contentFps;
int contentFCount;
TimeStamp contentLast;
FPSState()
: texture(0)
, fps(0)
, initialized(false)
, fcount(0)
, contentFps(0)
, contentFCount(0)
{
contentLast = last = TimeStamp::Now();
last = TimeStamp::Now();
}
void DrawFPS(GLContext*, ShaderProgramOGL*);
void NotifyShadowTreeTransaction();
} mFPS;
static bool sDrawFPS;

Просмотреть файл

@ -584,8 +584,7 @@ already_AddRefed<Layer>
RenderFrameParent::BuildLayer(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
LayerManager* aManager,
const nsIntRect& aVisibleRect,
nsDisplayItem* aItem)
const nsIntRect& aVisibleRect)
{
NS_ABORT_IF_FALSE(aFrame,
"makes no sense to have a shadow tree without a frame");
@ -608,17 +607,13 @@ RenderFrameParent::BuildLayer(nsDisplayListBuilder* aBuilder,
if (0 != id) {
MOZ_ASSERT(!GetRootLayer());
nsRefPtr<Layer> layer =
(GetLayerBuilderForManager(aManager)->GetLeafLayerFor(aBuilder, aManager, aItem));
if (!layer) {
layer = aManager->CreateRefLayer();
}
nsRefPtr<RefLayer> layer = aManager->CreateRefLayer();
if (!layer) {
// Probably a temporary layer manager that doesn't know how to
// use ref layers.
return nullptr;
}
static_cast<RefLayer*>(layer.get())->SetReferentId(id);
layer->SetReferentId(id);
layer->SetVisibleRegion(aVisibleRect);
nsIntPoint rootFrameOffset = GetRootFrameOffset(aFrame, aBuilder);
layer->SetBaseTransform(
@ -867,7 +862,7 @@ nsDisplayRemote::BuildLayer(nsDisplayListBuilder* aBuilder,
{
PRInt32 appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
nsIntRect visibleRect = GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel);
nsRefPtr<Layer> layer = mRemoteFrame->BuildLayer(aBuilder, mFrame, aManager, visibleRect, this);
nsRefPtr<Layer> layer = mRemoteFrame->BuildLayer(aBuilder, mFrame, aManager, visibleRect);
return layer.forget();
}

Просмотреть файл

@ -82,8 +82,7 @@ public:
already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
LayerManager* aManager,
const nsIntRect& aVisibleRect,
nsDisplayItem* aItem);
const nsIntRect& aVisibleRect);
void OwnerContentChanged(nsIContent* aContent);