Bug 721489 - Backout changeset 0cb6641ab21a for a more desirable fix.

--HG--
extra : rebase_source : b8100a07f626c3cc51e019911a3b023b482d23b9
This commit is contained in:
Benoit Girard 2012-02-10 15:12:35 -05:00
parent 7f7fa10d9e
commit ece165b571
11 changed files with 7 additions and 94 deletions

View File

@ -603,12 +603,6 @@ GLContext::IsExtensionSupported(const char *extension)
return ListHasExtension(fGetString(LOCAL_GL_EXTENSIONS), extension);
}
bool
GLContext::PreferPowerOfTwoTextures()
{
return Renderer() == RendererAdreno200;
}
bool
GLContext::CanUploadSubTextures()
{

View File

@ -704,12 +704,6 @@ public:
bool CanUploadSubTextures();
// Quirks mode to force the platform to use Power of Two.
// Currently provided only as a best effort. We're not in a
// state where we can yet quarante that the platform will honor
// this.
bool PreferPowerOfTwoTextures();
/**
* If this context wraps a double-buffered target, swap the back
* and front buffers. It should be assumed that after a swap, the

View File

@ -74,14 +74,6 @@ struct OpCreateImageLayer { PLayer layer; };
struct OpCreateColorLayer { PLayer layer; };
struct OpCreateCanvasLayer { PLayer layer; };
struct LayerForwarderQuirks {
// 1 << 0 -> Use power of two Shmem for GPU that require it.
// The other alternative would be to memcpy the Shmem
// into a PoT buffer before the upload and wasting bandwidth.
// 1 << 1 -> Unused
uint32_t quirks;
};
struct SurfaceDescriptorD3D10 {
WindowsHandle handle;
};
@ -240,11 +232,6 @@ sync protocol PLayers {
parent:
async PLayer();
// LayersBackend can request the quirks from the layer
// fowarder.
sync GetForwarderQuirks()
returns (LayerForwarderQuirks Quirks);
sync Update(Edit[] cset)
returns (EditReply[] reply);

View File

@ -392,7 +392,7 @@ ShadowLayerForwarder::AllocBuffer(const gfxIntSize& aSize,
SharedMemory::SharedMemoryType shmemType = OptimalShmemType();
nsRefPtr<gfxSharedImageSurface> back =
gfxSharedImageSurface::CreateUnsafe(mShadowManager, aSize, format, shmemType, mUsePoTShmem);
gfxSharedImageSurface::CreateUnsafe(mShadowManager, aSize, format, shmemType);
if (!back)
return false;
@ -507,11 +507,6 @@ ShadowLayerForwarder::ConstructShadowFor(ShadowableLayer* aLayer)
return mShadowManager->SendPLayerConstructor(new ShadowLayerChild(aLayer));
}
LayerForwarderQuirks
ShadowLayerManager::GetForwarderQuirks()
{
return LayerForwarderQuirks(0);
}
void
ShadowLayerManager::DestroySharedSurface(gfxSharedImageSurface* aSurface,
@ -588,11 +583,5 @@ IsSurfaceDescriptorValid(const SurfaceDescriptor& aSurface)
return SurfaceDescriptor::T__None != aSurface.type();
}
void
ShadowLayerForwarder::SetForwarderQuirks(LayerForwarderQuirks aQuirks)
{
mUsePoTShmem = aQuirks.quirks() & (1 << 0);
}
} // namespace layers
} // namespace mozilla

View File

@ -42,8 +42,7 @@
#define mozilla_layers_ShadowLayers_h 1
#include "gfxASurface.h"
#include "ShadowLayers.h"
#include "ShadowLayersManager.h"
#include "ImageLayers.h"
#include "Layers.h"
@ -52,7 +51,6 @@ class gfxSharedImageSurface;
namespace mozilla {
namespace layers {
class LayerForwarderQuirks;
class Edit;
class EditReply;
class OptionalThebesBuffer;
@ -310,8 +308,6 @@ public:
*/
bool ShouldDoubleBuffer() { return GetParentBackendType() == LayerManager::LAYERS_BASIC; }
void SetForwarderQuirks(LayerForwarderQuirks aQuirks);
protected:
ShadowLayerForwarder();
@ -336,7 +332,6 @@ private:
Transaction* mTxn;
LayersBackend mParentBackend;
bool mUsePoTShmem;
};
@ -364,8 +359,6 @@ public:
/** CONSTRUCTION PHASE ONLY */
virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer() = 0;
virtual LayerForwarderQuirks GetForwarderQuirks();
static void PlatformSyncBeforeReplyUpdate();
protected:

View File

@ -388,12 +388,6 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
return true;
}
bool
ShadowLayersParent::RecvGetForwarderQuirks(mozilla::layers::LayerForwarderQuirks* aQuirks) {
*aQuirks = layer_manager()->GetForwarderQuirks();
return true;
}
PLayerParent*
ShadowLayersParent::AllocPLayer()
{

View File

@ -80,8 +80,6 @@ protected:
NS_OVERRIDE virtual bool RecvUpdate(const EditArray& cset,
EditReplyArray* reply);
NS_OVERRIDE virtual bool RecvGetForwarderQuirks(mozilla::layers::LayerForwarderQuirks* aQuirks);
NS_OVERRIDE virtual PLayerParent* AllocPLayer();
NS_OVERRIDE virtual bool DeallocPLayer(PLayerParent* actor);

View File

@ -921,17 +921,6 @@ LayerManagerOGL::WorldTransformRect(nsIntRect& aRect)
aRect.SetRect(grect.X(), grect.Y(), grect.Width(), grect.Height());
}
LayerForwarderQuirks
LayerManagerOGL::GetForwarderQuirks()
{
uint16_t quirks = 0;
if (mGLContext->PreferPowerOfTwoTextures()) {
quirks |= 1 << 0;
}
return LayerForwarderQuirks(quirks);
}
void
LayerManagerOGL::SetupPipeline(int aWidth, int aHeight, WorldTransforPolicy aTransformPolicy)
{

View File

@ -397,8 +397,6 @@ public:
gfxMatrix& GetWorldTransform(void);
void WorldTransformRect(nsIntRect& aRect);
LayerForwarderQuirks GetForwarderQuirks();
private:
/** Widget associated with this layer manager */
nsIWidget *mWidget;

View File

@ -85,11 +85,9 @@ public:
CreateUnsafe(ShmemAllocator* aAllocator,
const gfxIntSize& aSize,
gfxImageFormat aFormat,
SharedMemory::SharedMemoryType aShmType = SharedMemory::TYPE_BASIC,
bool aUsePoTSharedSurface = false)
SharedMemory::SharedMemoryType aShmType = SharedMemory::TYPE_BASIC)
{
return Create<ShmemAllocator, true>(aAllocator, aSize, aFormat,
aShmType, aUsePoTSharedSurface);
return Create<ShmemAllocator, true>(aAllocator, aSize, aFormat, aShmType);
}
Shmem& GetShmem() { return mShmem; }
@ -108,30 +106,14 @@ private:
Create(ShmemAllocator* aAllocator,
const gfxIntSize& aSize,
gfxImageFormat aFormat,
SharedMemory::SharedMemoryType aShmType,
bool aUsePoTSharedSurface = false)
SharedMemory::SharedMemoryType aShmType)
{
if (!CheckSurfaceSize(aSize))
return nsnull;
Shmem shmem;
long stride;
size_t size;
if (aUsePoTSharedSurface) {
printf_stderr("Buffer PoT\n");
int potW = 1;
while( potW < aSize.width ) potW <<= 1;
int potH = 1;
while( potH < aSize.height ) potH <<= 1;
stride = ComputeStride(gfxIntSize(potW, potH), aFormat);
size = GetAlignedSize(gfxIntSize(potW, potH), stride);
} else {
printf_stderr("Buffer NOT PoT\n");
stride = ComputeStride(aSize, aFormat);
size = GetAlignedSize(aSize, stride);
}
long stride = ComputeStride(aSize, aFormat);
size_t size = GetAlignedSize(aSize, stride);
if (!Unsafe) {
if (!aAllocator->AllocShmem(size, aShmType, &shmem))
return nsnull;

View File

@ -40,7 +40,6 @@
#include "mozilla/layers/CompositorChild.h"
#include "mozilla/layers/CompositorParent.h"
#include "mozilla/layers/PLayersChild.h"
#include "nsBaseWidget.h"
#include "nsDeviceContext.h"
#include "nsCOMPtr.h"
@ -858,12 +857,8 @@ void nsBaseWidget::CreateCompositor()
PLayersChild* shadowManager =
mCompositorChild->SendPLayersConstructor(LayerManager::LAYERS_OPENGL);
LayerForwarderQuirks forwarderQuirk;
shadowManager->SendGetForwarderQuirks(&forwarderQuirk);
if (shadowManager) {
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
lf->SetForwarderQuirks(forwarderQuirk);
if (!lf) {
delete lm;
mCompositorChild = nsnull;