mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Backout 4b46f6eff8f4 (Bug 732988) for linux Cipc orange
This commit is contained in:
parent
e4efb8b1ed
commit
98a7f77a1c
@ -581,12 +581,6 @@ private:
|
||||
*/
|
||||
class THEBES_API ImageLayer : public Layer {
|
||||
public:
|
||||
enum ScaleMode {
|
||||
SCALE_NONE,
|
||||
SCALE_STRETCH // Unimplemented on GL layers and e10s
|
||||
// Unimplemented - SCALE_PRESERVE_ASPECT_RATIO_CONTAIN
|
||||
};
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Set the ImageContainer. aContainer must have the same layer manager
|
||||
@ -602,17 +596,6 @@ public:
|
||||
*/
|
||||
void SetFilter(gfxPattern::GraphicsFilter aFilter) { mFilter = aFilter; }
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Set the size to scale the image to and the mode at which to scale.
|
||||
*/
|
||||
void SetScaleToSize(const gfxIntSize &aSize, ScaleMode aMode)
|
||||
{
|
||||
mScaleToSize = aSize;
|
||||
mScaleMode = aMode;
|
||||
}
|
||||
|
||||
|
||||
ImageContainer* GetContainer() { return mContainer; }
|
||||
gfxPattern::GraphicsFilter GetFilter() { return mFilter; }
|
||||
|
||||
@ -637,16 +620,12 @@ public:
|
||||
|
||||
protected:
|
||||
ImageLayer(LayerManager* aManager, void* aImplData)
|
||||
: Layer(aManager, aImplData), mFilter(gfxPattern::FILTER_GOOD)
|
||||
, mScaleMode(SCALE_NONE) {}
|
||||
: Layer(aManager, aImplData), mFilter(gfxPattern::FILTER_GOOD) {}
|
||||
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
|
||||
|
||||
nsRefPtr<ImageContainer> mContainer;
|
||||
gfxPattern::GraphicsFilter mFilter;
|
||||
gfxIntSize mScaleToSize;
|
||||
ScaleMode mScaleMode;
|
||||
};
|
||||
|
||||
/****** Image subtypes for the different formats ******/
|
||||
|
@ -867,7 +867,8 @@ BasicThebesLayerBuffer::SetBackingBufferAndUpdateFrom(
|
||||
class BasicImageLayer : public ImageLayer, public BasicImplData {
|
||||
public:
|
||||
BasicImageLayer(BasicLayerManager* aLayerManager) :
|
||||
ImageLayer(aLayerManager, static_cast<BasicImplData*>(this))
|
||||
ImageLayer(aLayerManager, static_cast<BasicImplData*>(this)),
|
||||
mSize(-1, -1)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicImageLayer);
|
||||
}
|
||||
@ -900,6 +901,8 @@ protected:
|
||||
already_AddRefed<gfxPattern>
|
||||
GetAndPaintCurrentImage(gfxContext* aContext,
|
||||
float aOpacity);
|
||||
|
||||
gfxIntSize mSize;
|
||||
};
|
||||
|
||||
void
|
||||
@ -923,7 +926,7 @@ BasicImageLayer::GetAndPaintCurrentImage(gfxContext* aContext,
|
||||
nsRefPtr<gfxASurface> surface;
|
||||
AutoLockImage autoLock(mContainer, getter_AddRefs(surface));
|
||||
Image *image = autoLock.GetImage();
|
||||
gfxIntSize size = autoLock.GetSize();
|
||||
mSize = autoLock.GetSize();
|
||||
|
||||
if (!surface || surface->CairoStatus()) {
|
||||
return nsnull;
|
||||
@ -935,15 +938,6 @@ BasicImageLayer::GetAndPaintCurrentImage(gfxContext* aContext,
|
||||
}
|
||||
|
||||
pat->SetFilter(mFilter);
|
||||
gfxIntSize sourceSize = surface->GetSize();
|
||||
if (mScaleMode != SCALE_NONE) {
|
||||
NS_ASSERTION(mScaleMode == SCALE_STRETCH,
|
||||
"No other scalemodes than stretch and none supported yet.");
|
||||
gfxMatrix mat = pat->GetMatrix();
|
||||
mat.Scale(float(sourceSize.width) / mScaleToSize.width, float(sourceSize.height) / mScaleToSize.height);
|
||||
pat->SetMatrix(mat);
|
||||
size = mScaleToSize;
|
||||
}
|
||||
|
||||
// The visible region can extend outside the image. If we're not
|
||||
// tiling, we don't want to draw into that area, so just draw within
|
||||
@ -951,7 +945,7 @@ BasicImageLayer::GetAndPaintCurrentImage(gfxContext* aContext,
|
||||
const nsIntRect* tileSrcRect = GetTileSourceRect();
|
||||
AutoSetOperator setOperator(aContext, GetOperator());
|
||||
PaintContext(pat,
|
||||
tileSrcRect ? GetVisibleRegion() : nsIntRegion(nsIntRect(0, 0, size.width, size.height)),
|
||||
tileSrcRect ? GetVisibleRegion() : nsIntRegion(nsIntRect(0, 0, mSize.width, mSize.height)),
|
||||
tileSrcRect,
|
||||
aOpacity, aContext);
|
||||
|
||||
@ -2475,8 +2469,7 @@ class BasicShadowableImageLayer : public BasicImageLayer,
|
||||
public:
|
||||
BasicShadowableImageLayer(BasicShadowLayerManager* aManager) :
|
||||
BasicImageLayer(aManager),
|
||||
mBufferIsOpaque(false),
|
||||
mSize(-1, -1)
|
||||
mBufferIsOpaque(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicShadowableImageLayer);
|
||||
}
|
||||
@ -2543,7 +2536,6 @@ private:
|
||||
nsRefPtr<gfxSharedImageSurface> mBackBufferU;
|
||||
nsRefPtr<gfxSharedImageSurface> mBackBufferV;
|
||||
gfxIntSize mCbCrSize;
|
||||
gfxIntSize mSize;
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -130,8 +130,6 @@ ImageLayerD3D10::RenderLayer()
|
||||
return;
|
||||
}
|
||||
|
||||
gfxIntSize size = mScaleMode == SCALE_NONE ? image->GetSize() : mScaleToSize;
|
||||
|
||||
SetEffectTransformAndOpacity();
|
||||
|
||||
ID3D10EffectTechnique *technique;
|
||||
@ -139,6 +137,7 @@ ImageLayerD3D10::RenderLayer()
|
||||
if (image->GetFormat() == Image::CAIRO_SURFACE || image->GetFormat() == Image::REMOTE_IMAGE_BITMAP)
|
||||
{
|
||||
bool hasAlpha = false;
|
||||
gfxIntSize size;
|
||||
|
||||
if (image->GetFormat() == Image::REMOTE_IMAGE_BITMAP) {
|
||||
RemoteBitmapImage *remoteImage =
|
||||
@ -155,6 +154,7 @@ ImageLayerD3D10::RenderLayer()
|
||||
}
|
||||
|
||||
hasAlpha = remoteImage->mFormat == RemoteImageData::BGRA32;
|
||||
size = remoteImage->mSize;
|
||||
} else {
|
||||
CairoImage *cairoImage =
|
||||
static_cast<CairoImage*>(image);
|
||||
@ -174,6 +174,7 @@ ImageLayerD3D10::RenderLayer()
|
||||
}
|
||||
|
||||
hasAlpha = cairoImage->mSurface->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA;
|
||||
size = cairoImage->mSize;
|
||||
}
|
||||
|
||||
TextureD3D10BackendData *data =
|
||||
@ -285,8 +286,8 @@ ImageLayerD3D10::RenderLayer()
|
||||
ShaderConstantRectD3D10(
|
||||
(float)0,
|
||||
(float)0,
|
||||
(float)size.width,
|
||||
(float)size.height)
|
||||
(float)yuvImage->mSize.width,
|
||||
(float)yuvImage->mSize.height)
|
||||
);
|
||||
|
||||
effect()->GetVariableByName("vTextureCoords")->AsVector()->SetFloatVector(
|
||||
|
@ -325,11 +325,10 @@ ImageLayerD3D9::RenderLayer()
|
||||
|
||||
SetShaderTransformAndOpacity();
|
||||
|
||||
gfxIntSize size = mScaleMode == SCALE_NONE ? image->GetSize() : mScaleToSize;
|
||||
|
||||
if (image->GetFormat() == Image::CAIRO_SURFACE || image->GetFormat() == Image::REMOTE_IMAGE_BITMAP)
|
||||
{
|
||||
bool hasAlpha = false;
|
||||
gfxIntSize size;
|
||||
|
||||
if (image->GetFormat() == Image::REMOTE_IMAGE_BITMAP) {
|
||||
RemoteBitmapImage *remoteImage =
|
||||
@ -344,6 +343,7 @@ ImageLayerD3D9::RenderLayer()
|
||||
}
|
||||
|
||||
hasAlpha = remoteImage->mFormat == RemoteImageData::BGRA32;
|
||||
size = remoteImage->mSize;
|
||||
} else {
|
||||
CairoImage *cairoImage =
|
||||
static_cast<CairoImage*>(image);
|
||||
@ -361,6 +361,7 @@ ImageLayerD3D9::RenderLayer()
|
||||
}
|
||||
|
||||
hasAlpha = cairoImage->mSurface->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA;
|
||||
size = cairoImage->mSize;
|
||||
}
|
||||
|
||||
TextureD3D9BackendData *data =
|
||||
@ -432,8 +433,8 @@ ImageLayerD3D9::RenderLayer()
|
||||
device()->SetVertexShaderConstantF(CBvLayerQuad,
|
||||
ShaderConstantRect(0,
|
||||
0,
|
||||
size.width,
|
||||
size.height),
|
||||
yuvImage->mSize.width,
|
||||
yuvImage->mSize.height),
|
||||
1);
|
||||
|
||||
device()->SetVertexShaderConstantF(CBvTextureCoords,
|
||||
|
@ -230,8 +230,6 @@ ImageLayerOGL::RenderLayer(int,
|
||||
|
||||
NS_ASSERTION(image->GetFormat() != Image::REMOTE_IMAGE_BITMAP,
|
||||
"Remote images aren't handled yet in OGL layers!");
|
||||
NS_ASSERTION(mScaleMode == SCALE_NONE || image->GetSize() == mScaleToSize,
|
||||
"Scale modes other than none not handled yet in OGL layers!");
|
||||
|
||||
if (image->GetFormat() == Image::PLANAR_YCBCR) {
|
||||
PlanarYCbCrImage *yuvImage =
|
||||
|
Loading…
x
Reference in New Issue
Block a user