зеркало из https://github.com/mozilla/gecko-dev.git
Bug 753784; add the ability to force a single tile. r=roc
This commit is contained in:
Родитель
3a9339038d
Коммит
13553ad870
|
@ -916,7 +916,8 @@ TiledTextureImage::TiledTextureImage(GLContext* aGL,
|
|||
, mTextureState(Created)
|
||||
, mIterationCallback(nsnull)
|
||||
{
|
||||
mTileSize = mGL->WantsSmallTiles() ? 256 : mGL->GetMaxTextureSize();
|
||||
mTileSize = (!(aFlags & TextureImage::ForceSingleTile) && mGL->WantsSmallTiles())
|
||||
? 256 : mGL->GetMaxTextureSize();
|
||||
if (aSize != nsIntSize(0,0)) {
|
||||
Resize(aSize);
|
||||
}
|
||||
|
|
|
@ -94,7 +94,8 @@ public:
|
|||
enum Flags {
|
||||
NoFlags = 0x0,
|
||||
UseNearestFilter = 0x1,
|
||||
NeedsYFlip = 0x2
|
||||
NeedsYFlip = 0x2,
|
||||
ForceSingleTile = 0x4
|
||||
};
|
||||
|
||||
typedef gfxASurface::gfxContentType ContentType;
|
||||
|
|
|
@ -604,10 +604,19 @@ public:
|
|||
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
|
||||
}
|
||||
|
||||
/**
|
||||
* if true, the image will only be backed by a single tile texture
|
||||
*/
|
||||
void SetForceSingleTile(bool aForceSingleTile)
|
||||
{
|
||||
mForceSingleTile = aForceSingleTile;
|
||||
Mutated();
|
||||
}
|
||||
|
||||
protected:
|
||||
ImageLayer(LayerManager* aManager, void* aImplData)
|
||||
: Layer(aManager, aImplData), mFilter(gfxPattern::FILTER_GOOD)
|
||||
, mScaleMode(SCALE_NONE) {}
|
||||
, mScaleMode(SCALE_NONE), mForceSingleTile(false) {}
|
||||
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
|
||||
|
@ -616,6 +625,7 @@ protected:
|
|||
gfxPattern::GraphicsFilter mFilter;
|
||||
gfxIntSize mScaleToSize;
|
||||
ScaleMode mScaleMode;
|
||||
bool mForceSingleTile;
|
||||
};
|
||||
|
||||
/****** Image subtypes for the different formats ******/
|
||||
|
|
|
@ -2546,7 +2546,7 @@ public:
|
|||
|
||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ImageLayerAttributes(mFilter);
|
||||
aAttrs = ImageLayerAttributes(mFilter, mForceSingleTile);
|
||||
}
|
||||
|
||||
virtual Layer* AsLayer() { return this; }
|
||||
|
|
|
@ -94,7 +94,10 @@ struct ThebesLayerAttributes {
|
|||
struct ContainerLayerAttributes{ FrameMetrics metrics; };
|
||||
struct ColorLayerAttributes { gfxRGBA color; };
|
||||
struct CanvasLayerAttributes { GraphicsFilterType filter; };
|
||||
struct ImageLayerAttributes { GraphicsFilterType filter; };
|
||||
struct ImageLayerAttributes {
|
||||
GraphicsFilterType filter;
|
||||
bool forceSingleTile;
|
||||
};
|
||||
|
||||
union SpecificLayerAttributes {
|
||||
null_t;
|
||||
|
|
|
@ -253,13 +253,15 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
specific.get_CanvasLayerAttributes().filter());
|
||||
break;
|
||||
|
||||
case Specific::TImageLayerAttributes:
|
||||
case Specific::TImageLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] image layer"));
|
||||
|
||||
static_cast<ImageLayer*>(layer)->SetFilter(
|
||||
specific.get_ImageLayerAttributes().filter());
|
||||
ImageLayer* imageLayer = static_cast<ImageLayer*>(layer);
|
||||
const ImageLayerAttributes& attrs = specific.get_ImageLayerAttributes();
|
||||
imageLayer->SetFilter(attrs.filter());
|
||||
imageLayer->SetForceSingleTile(attrs.forceSingleTile());
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
NS_RUNTIMEABORT("not reached");
|
||||
}
|
||||
|
|
|
@ -660,7 +660,10 @@ ShadowImageLayerOGL::Init(const SharedImage& aFront)
|
|||
mSize = surf->GetSize();
|
||||
mTexImage = gl()->CreateTextureImage(nsIntSize(mSize.width, mSize.height),
|
||||
surf->GetContentType(),
|
||||
LOCAL_GL_CLAMP_TO_EDGE);
|
||||
LOCAL_GL_CLAMP_TO_EDGE,
|
||||
mForceSingleTile
|
||||
? TextureImage::ForceSingleTile
|
||||
: TextureImage::NoFlags);
|
||||
return true;
|
||||
} else {
|
||||
YUVImage yuv = aFront.get_YUVImage();
|
||||
|
|
|
@ -885,6 +885,7 @@ ContainerState::CreateOrRecycleMaskImageLayerFor(Layer* aLayer)
|
|||
if (!result)
|
||||
return nsnull;
|
||||
result->SetUserData(&gMaskLayerUserData, new MaskLayerUserData());
|
||||
result->SetForceSingleTile(true);
|
||||
}
|
||||
|
||||
return result.forget();
|
||||
|
|
Загрузка…
Ссылка в новой задаче