Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in .cpp files in gfx/*. r=milan

MozReview-Commit-ID: 1jESowJKdyp

--HG--
extra : rebase_source : 3839cdea46729a9af05c777215cffcb9f42a2018
This commit is contained in:
Milan Sreckovic 2017-08-14 08:29:28 -04:00
Родитель f330369b4e
Коммит e3cd0a3157
60 изменённых файлов: 396 добавлений и 397 удалений

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

@ -502,13 +502,13 @@ AlphaBoxBlur::Init(const Rect& aRect,
mSkipRect = IntRect(0, 0, 0, 0);
}
CheckedInt<int32_t> stride = RoundUpToMultipleOf4(mRect.width);
CheckedInt<int32_t> stride = RoundUpToMultipleOf4(mRect.Width());
if (stride.isValid()) {
mStride = stride.value();
// We need to leave room for an additional 3 bytes for a potential overrun
// in our blurring code.
size_t size = BufferSizeFromStrideAndHeight(mStride, mRect.height, 3);
size_t size = BufferSizeFromStrideAndHeight(mStride, mRect.Height(), 3);
if (size != 0) {
mSurfaceAllocationSize = size;
}
@ -527,7 +527,7 @@ AlphaBoxBlur::AlphaBoxBlur(const Rect& aRect,
{
IntRect intRect;
if (aRect.ToIntRect(&intRect)) {
size_t minDataSize = BufferSizeFromStrideAndHeight(intRect.width, intRect.height);
size_t minDataSize = BufferSizeFromStrideAndHeight(intRect.Width(), intRect.Height());
if (minDataSize != 0) {
mSurfaceAllocationSize = minDataSize;
}
@ -542,7 +542,7 @@ AlphaBoxBlur::~AlphaBoxBlur()
IntSize
AlphaBoxBlur::GetSize()
{
IntSize size(mRect.width, mRect.height);
IntSize size(mRect.Width(), mRect.Height());
return size;
}

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

@ -192,8 +192,8 @@ DrawTargetD2D1::DrawSurface(SourceSurface *aSurface,
samplingBounds = D2D1::RectF(0, 0, Float(aSurface->GetSize().width), Float(aSurface->GetSize().height));
}
Float xScale = aDest.width / aSource.width;
Float yScale = aDest.height / aSource.height;
Float xScale = aDest.Width() / aSource.Width();
Float yScale = aDest.Height() / aSource.Height();
RefPtr<ID2D1ImageBrush> brush;
@ -425,8 +425,8 @@ DrawTargetD2D1::MaskSurface(const Pattern &aSource,
// we have to fixup our sizes here.
size.width = bitmap->GetSize().width;
size.height = bitmap->GetSize().height;
dest.width = size.width;
dest.height = size.height;
dest.SetWidth(size.width);
dest.SetHeight(size.height);
}
// FillOpacityMask only works if the antialias mode is MODE_ALIASED
@ -488,10 +488,10 @@ DrawTargetD2D1::CopySurface(SourceSurface *aSurface,
}
Rect srcRect(Float(sourceRect.x), Float(sourceRect.y),
Float(aSourceRect.width), Float(aSourceRect.height));
Float(aSourceRect.Width()), Float(aSourceRect.Height()));
Rect dstRect(Float(aDestination.x), Float(aDestination.y),
Float(aSourceRect.width), Float(aSourceRect.height));
Float(aSourceRect.Width()), Float(aSourceRect.Height()));
if (SUCCEEDED(hr) && bitmap) {
mDC->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_COPY);
@ -1881,7 +1881,7 @@ DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
mat.PreTranslate(pat->mSamplingRect.x, pat->mSamplingRect.y);
} else {
// We will do a partial upload of the sampling restricted area from GetImageForSurface.
samplingBounds = D2D1::RectF(0, 0, pat->mSamplingRect.width, pat->mSamplingRect.height);
samplingBounds = D2D1::RectF(0, 0, pat->mSamplingRect.Width(), pat->mSamplingRect.Height());
}
D2D1_EXTEND_MODE xRepeat = D2DExtend(pat->mExtendMode, Axis::X_AXIS);

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

@ -193,8 +193,8 @@ VerifyRGBXCorners(uint8_t* aData, const IntSize &aSize, const int32_t aStride, S
return true;
}
const int height = bounds.height;
const int width = bounds.width;
const int height = bounds.Height();
const int width = bounds.Width();
const int pixelSize = 4;
MOZ_ASSERT(aSize.width * pixelSize <= aStride);
@ -848,16 +848,16 @@ ShrinkClippedStrokedRect(const Rect &aStrokedRect, const IntRect &aDeviceClip,
Rect userSpaceStrokeClip =
UserSpaceStrokeClip(aDeviceClip, aTransform, aStrokeOptions);
RectDouble strokedRectDouble(
aStrokedRect.x, aStrokedRect.y, aStrokedRect.width, aStrokedRect.height);
aStrokedRect.x, aStrokedRect.y, aStrokedRect.Width(), aStrokedRect.Height());
RectDouble intersection =
strokedRectDouble.Intersect(RectDouble(userSpaceStrokeClip.x,
userSpaceStrokeClip.y,
userSpaceStrokeClip.width,
userSpaceStrokeClip.height));
userSpaceStrokeClip.Width(),
userSpaceStrokeClip.Height()));
Double dashPeriodLength = DashPeriodLength(aStrokeOptions);
if (intersection.IsEmpty() || dashPeriodLength == 0.0f) {
return Rect(
intersection.x, intersection.y, intersection.width, intersection.height);
intersection.x, intersection.y, intersection.Width(), intersection.Height());
}
// Reduce the rectangle side lengths in multiples of the dash period length
@ -871,8 +871,8 @@ ShrinkClippedStrokedRect(const Rect &aStrokedRect, const IntRect &aDeviceClip,
strokedRectDouble.Deflate(insetBy);
return Rect(strokedRectDouble.x,
strokedRectDouble.y,
strokedRectDouble.width,
strokedRectDouble.height);
strokedRectDouble.Width(),
strokedRectDouble.Height());
}
void
@ -1569,7 +1569,7 @@ DrawTarget::Draw3DTransformedSurface(SourceSurface* aSurface, const Matrix4x4& a
}
std::unique_ptr<SkCanvas> dstCanvas(
SkCanvas::MakeRasterDirect(
SkImageInfo::Make(xformBounds.width, xformBounds.height,
SkImageInfo::Make(xformBounds.Width(), xformBounds.Height(),
GfxFormatToSkiaColorType(dstSurf->GetFormat()),
kPremul_SkAlphaType),
dstSurf->GetData(), dstSurf->Stride()));
@ -1819,7 +1819,7 @@ DrawTargetSkia::CopySurface(SourceSurface *aSurface,
mCanvas->save();
mCanvas->setMatrix(SkMatrix::MakeTrans(SkIntToScalar(aDestination.x), SkIntToScalar(aDestination.y)));
mCanvas->clipRect(SkRect::MakeIWH(aSourceRect.width, aSourceRect.height), SkClipOp::kReplace_deprecated);
mCanvas->clipRect(SkRect::MakeIWH(aSourceRect.Width(), aSourceRect.Height()), SkClipOp::kReplace_deprecated);
SkPaint paint;
if (!image->isOpaque()) {

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

@ -812,7 +812,7 @@ FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntRect &aValue)
MOZ_ASSERT(aIndex == ATT_TURBULENCE_RECT);
mEffect->SetValue(D2D1_TURBULENCE_PROP_OFFSET, D2D1::Vector2F(Float(aValue.x), Float(aValue.y)));
mEffect->SetValue(D2D1_TURBULENCE_PROP_SIZE, D2D1::Vector2F(Float(aValue.width), Float(aValue.height)));
mEffect->SetValue(D2D1_TURBULENCE_PROP_SIZE, D2D1::Vector2F(Float(aValue.Width()), Float(aValue.Height())));
return;
}

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

@ -218,17 +218,17 @@ FillRectWithPixel(DataSourceSurface *aSurface, const IntRect &aFillRect, IntPoin
// Fill the first row by hand.
if (bpp == 4) {
uint32_t sourcePixel = *(uint32_t*)sourcePixelData;
for (int32_t x = 0; x < aFillRect.width; x++) {
for (int32_t x = 0; x < aFillRect.Width(); x++) {
*((uint32_t*)data + x) = sourcePixel;
}
} else if (BytesPerPixel(aSurface->GetFormat()) == 1) {
uint8_t sourcePixel = *sourcePixelData;
memset(data, sourcePixel, aFillRect.width);
memset(data, sourcePixel, aFillRect.Width());
}
// Copy the first row into the other rows.
for (int32_t y = 1; y < aFillRect.height; y++) {
PodCopy(data + y * surfMap.GetStride(), data, aFillRect.width * bpp);
for (int32_t y = 1; y < aFillRect.Height(); y++) {
PodCopy(data + y * surfMap.GetStride(), data, aFillRect.Width() * bpp);
}
}
@ -252,13 +252,13 @@ FillRectWithVerticallyRepeatingHorizontalStrip(DataSourceSurface *aSurface,
uint8_t* sampleData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aSampleRect.TopLeft());
uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft());
if (BytesPerPixel(aSurface->GetFormat()) == 4) {
for (int32_t y = 0; y < aFillRect.height; y++) {
PodCopy((uint32_t*)data, (uint32_t*)sampleData, aFillRect.width);
for (int32_t y = 0; y < aFillRect.Height(); y++) {
PodCopy((uint32_t*)data, (uint32_t*)sampleData, aFillRect.Width());
data += surfMap.GetStride();
}
} else if (BytesPerPixel(aSurface->GetFormat()) == 1) {
for (int32_t y = 0; y < aFillRect.height; y++) {
PodCopy(data, sampleData, aFillRect.width);
for (int32_t y = 0; y < aFillRect.Height(); y++) {
PodCopy(data, sampleData, aFillRect.Width());
data += surfMap.GetStride();
}
}
@ -284,18 +284,18 @@ FillRectWithHorizontallyRepeatingVerticalStrip(DataSourceSurface *aSurface,
uint8_t* sampleData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aSampleRect.TopLeft());
uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft());
if (BytesPerPixel(aSurface->GetFormat()) == 4) {
for (int32_t y = 0; y < aFillRect.height; y++) {
for (int32_t y = 0; y < aFillRect.Height(); y++) {
int32_t sampleColor = *((uint32_t*)sampleData);
for (int32_t x = 0; x < aFillRect.width; x++) {
for (int32_t x = 0; x < aFillRect.Width(); x++) {
*((uint32_t*)data + x) = sampleColor;
}
data += surfMap.GetStride();
sampleData += surfMap.GetStride();
}
} else if (BytesPerPixel(aSurface->GetFormat()) == 1) {
for (int32_t y = 0; y < aFillRect.height; y++) {
for (int32_t y = 0; y < aFillRect.Height(); y++) {
uint8_t sampleColor = *sampleData;
memset(data, sampleColor, aFillRect.width);
memset(data, sampleColor, aFillRect.Width());
data += surfMap.GetStride();
sampleData += surfMap.GetStride();
}
@ -316,24 +316,24 @@ DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
switch (ix) {
case 0:
fill.x = 0;
fill.width = aFromRect.x;
fill.SetWidth(aFromRect.x);
sampleRect.x = fill.XMost();
sampleRect.width = 1;
sampleRect.SetWidth(1);
break;
case 1:
fill.x = aFromRect.x;
fill.width = aFromRect.width;
fill.SetWidth(aFromRect.Width());
sampleRect.x = fill.x;
sampleRect.width = fill.width;
sampleRect.SetWidth(fill.Width());
break;
case 2:
fill.x = aFromRect.XMost();
fill.width = size.width - fill.x;
fill.SetWidth(size.width - fill.x);
sampleRect.x = fill.x - 1;
sampleRect.width = 1;
sampleRect.SetWidth(1);
break;
}
if (fill.width <= 0) {
if (fill.Width() <= 0) {
continue;
}
bool xIsMiddle = (ix == 1);
@ -341,24 +341,24 @@ DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
switch (iy) {
case 0:
fill.y = 0;
fill.height = aFromRect.y;
fill.SetHeight(aFromRect.y);
sampleRect.y = fill.YMost();
sampleRect.height = 1;
sampleRect.SetHeight(1);
break;
case 1:
fill.y = aFromRect.y;
fill.height = aFromRect.height;
fill.SetHeight(aFromRect.Height());
sampleRect.y = fill.y;
sampleRect.height = fill.height;
sampleRect.SetHeight(fill.Height());
break;
case 2:
fill.y = aFromRect.YMost();
fill.height = size.height - fill.y;
fill.SetHeight(size.height - fill.y);
sampleRect.y = fill.y - 1;
sampleRect.height = 1;
sampleRect.SetHeight(1);
break;
}
if (fill.height <= 0) {
if (fill.Height() <= 0) {
continue;
}
bool yIsMiddle = (iy == 1);
@ -381,8 +381,8 @@ DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
static IntPoint
TileIndex(const IntRect &aFirstTileRect, const IntPoint &aPoint)
{
return IntPoint(int32_t(floor(double(aPoint.x - aFirstTileRect.x) / aFirstTileRect.width)),
int32_t(floor(double(aPoint.y - aFirstTileRect.y) / aFirstTileRect.height)));
return IntPoint(int32_t(floor(double(aPoint.x - aFirstTileRect.x) / aFirstTileRect.Width())),
int32_t(floor(double(aPoint.y - aFirstTileRect.y) / aFirstTileRect.Height())));
}
static void
@ -395,8 +395,8 @@ TileSurface(DataSourceSurface* aSource, DataSourceSurface* aTarget, const IntPoi
for (int32_t ix = startIndex.x; ix <= endIndex.x; ix++) {
for (int32_t iy = startIndex.y; iy <= endIndex.y; iy++) {
IntPoint destPoint(sourceRect.x + ix * sourceRect.width,
sourceRect.y + iy * sourceRect.height);
IntPoint destPoint(sourceRect.x + ix * sourceRect.Width(),
sourceRect.y + iy * sourceRect.Height());
IntRect destRect(destPoint, sourceRect.Size());
destRect = destRect.Intersect(targetRect);
IntRect srcRect = destRect - destPoint;
@ -694,7 +694,7 @@ FilterNodeSoftware::GetInputDataSourceSurface(uint32_t aInputEnumIndex,
#ifdef DEBUG_DUMP_SURFACES
printf("<section><h1>GetInputDataSourceSurface with aRect: %d, %d, %d, %d</h1>\n",
aRect.x, aRect.y, aRect.width, aRect.height);
aRect.x, aRect.y, aRect.Width(), aRect.Height());
#endif
int32_t inputIndex = InputIndex(aInputEnumIndex);
if (inputIndex < 0 || (uint32_t)inputIndex >= NumberOfSetInputs()) {
@ -1147,7 +1147,7 @@ FilterNodeTransformSoftware::Render(const IntRect& aRect)
return nullptr;
}
Rect r(0, 0, srcRect.width, srcRect.height);
Rect r(0, 0, srcRect.Width(), srcRect.Height());
dt->SetTransform(transform);
dt->DrawSurface(input, r, r, DrawSurfaceOptions(mSamplingFilter));
@ -1218,7 +1218,7 @@ ApplyMorphology(const IntRect& aSourceRect, DataSourceSurface* aInput,
{
IntRect srcRect = aSourceRect - aDestRect.TopLeft();
IntRect destRect = aDestRect - aDestRect.TopLeft();
IntRect tmpRect(destRect.x, srcRect.y, destRect.width, srcRect.height);
IntRect tmpRect(destRect.x, srcRect.y, destRect.Width(), srcRect.Height());
#ifdef DEBUG
IntMargin margin = srcRect - destRect;
MOZ_ASSERT(margin.top >= ry && margin.right >= rx &&
@ -1499,20 +1499,20 @@ FilterNodeFloodSoftware::Render(const IntRect& aRect)
if (format == SurfaceFormat::B8G8R8A8) {
uint32_t color = ColorToBGRA(mColor);
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
*((uint32_t*)targetData + x) = color;
}
PodZero(&targetData[aRect.width * 4], stride - aRect.width * 4);
PodZero(&targetData[aRect.Width() * 4], stride - aRect.Width() * 4);
targetData += stride;
}
} else if (format == SurfaceFormat::A8) {
uint8_t alpha = NS_lround(mColor.a * 255.0f);
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
targetData[x] = alpha;
}
PodZero(&targetData[aRect.width], stride - aRect.width);
PodZero(&targetData[aRect.Width()], stride - aRect.Width());
targetData += stride;
}
} else {
@ -1555,7 +1555,7 @@ FilterNodeTileSoftware::SetAttribute(uint32_t aIndex,
{
MOZ_ASSERT(aIndex == ATT_TILE_SOURCE_RECT);
mSourceRect = IntRect(int32_t(aSourceRect.x), int32_t(aSourceRect.y),
int32_t(aSourceRect.width), int32_t(aSourceRect.height));
int32_t(aSourceRect.Width()), int32_t(aSourceRect.Height()));
Invalidate();
}
@ -1570,10 +1570,10 @@ struct CompareIntRects
if (a.y != b.y) {
return a.y < b.y;
}
if (a.width != b.width) {
return a.width < b.width;
if (a.Width() != b.Width()) {
return a.Width() < b.Width();
}
return a.height < b.height;
return a.Height() < b.Height();
}
};
@ -1599,8 +1599,8 @@ FilterNodeTileSoftware::Render(const IntRect& aRect)
IntPoint endIndex = TileIndex(mSourceRect, aRect.BottomRight());
for (int32_t ix = startIndex.x; ix <= endIndex.x; ix++) {
for (int32_t iy = startIndex.y; iy <= endIndex.y; iy++) {
IntPoint sourceToDestOffset(ix * mSourceRect.width,
iy * mSourceRect.height);
IntPoint sourceToDestOffset(ix * mSourceRect.Width(),
iy * mSourceRect.Height());
IntRect destRect = aRect.Intersect(mSourceRect + sourceToDestOffset);
IntRect srcRect = destRect - sourceToDestOffset;
if (srcRect.IsEmpty()) {
@ -2504,10 +2504,10 @@ FilterNodeConvolveMatrixSoftware::DoRender(const IntRect& aRect,
}
int32_t bias = NS_lround(mBias * 255 * factorFromShifts);
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
ConvolvePixel(sourceData, targetData,
aRect.width, aRect.height, sourceStride, targetStride,
aRect.Width(), aRect.Height(), sourceStride, targetStride,
x, y, intKernel, bias, shiftL, shiftR, mPreserveAlpha,
mKernelSize.width, mKernelSize.height, mTarget.x, mTarget.y,
aKernelUnitLengthX, aKernelUnitLengthY);
@ -2650,8 +2650,8 @@ FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect)
float scaleOver255 = mScale / 255.0f;
float scaleAdjustment = -0.5f * mScale;
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
uint32_t mapIndex = y * mapStride + 4 * x;
uint32_t targIndex = y * targetStride + 4 * x;
int32_t sourceX = x +
@ -2663,7 +2663,7 @@ FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect)
}
// Keep valgrind happy.
PodZero(&targetData[y * targetStride + 4 * aRect.width], targetStride - 4 * aRect.width);
PodZero(&targetData[y * targetStride + 4 * aRect.Width()], targetStride - 4 * aRect.Width());
}
return target.forget();
@ -2974,7 +2974,7 @@ FilterNodeBlurXYSoftware::Render(const IntRect& aRect)
}
RefPtr<DataSourceSurface> target;
Rect r(0, 0, srcRect.width, srcRect.height);
Rect r(0, 0, srcRect.Width(), srcRect.Height());
if (input->GetFormat() == SurfaceFormat::A8) {
target = Factory::CreateDataSourceSurface(srcRect.Size(), SurfaceFormat::A8);

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

@ -110,8 +110,8 @@ DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
NS_ASSERTION(!xwrap || xlen > 0.0f, "xlen isn't > 0, what's going on?");
NS_ASSERTION(!ywrap || ylen > 0.0f, "ylen isn't > 0, what's going on?");
NS_ASSERTION(aTexCoordRect.width <= aTexSize.width &&
aTexCoordRect.height <= aTexSize.height, "tex coord rect would cause tiling!");
NS_ASSERTION(aTexCoordRect.Width() <= aTexSize.width &&
aTexCoordRect.Height() <= aTexSize.height, "tex coord rect would cause tiling!");
if (!xwrap && !ywrap) {
aRects.addRect(0.0f, 0.0f,

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

@ -359,9 +359,9 @@ gfx::IntRect TiledTextureImage::GetSrcTileRect()
{
gfx::IntRect rect = GetTileRect();
const bool needsYFlip = mFlags & OriginBottomLeft;
unsigned int srcY = needsYFlip ? mSize.height - rect.height - rect.y
unsigned int srcY = needsYFlip ? mSize.height - rect.Height() - rect.y
: rect.y;
return gfx::IntRect(rect.x, srcY, rect.width, rect.height);
return gfx::IntRect(rect.x, srcY, rect.Width(), rect.Height());
}
void

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

@ -506,8 +506,8 @@ UploadImageDataToTexture(GLContext* gl,
0,
rect.x,
rect.y,
rect.width,
rect.height,
rect.Width(),
rect.Height(),
aStride,
pixelSize,
format,

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

@ -186,16 +186,16 @@ UpdateTextureCoordinates(gfx::TexturedTriangle& aTriangle,
const gfx::Rect& aTextureCoords)
{
// Calculate the relative offset of the intersection within the layer.
float dx = (aIntersection.x - aRect.x) / aRect.width;
float dy = (aIntersection.y - aRect.y) / aRect.height;
float dx = (aIntersection.x - aRect.x) / aRect.Width();
float dy = (aIntersection.y - aRect.y) / aRect.Height();
// Update the texture offset.
float x = aTextureCoords.x + dx * aTextureCoords.width;
float y = aTextureCoords.y + dy * aTextureCoords.height;
float x = aTextureCoords.x + dx * aTextureCoords.Width();
float y = aTextureCoords.y + dy * aTextureCoords.Height();
// Scale the texture width and height.
float w = aTextureCoords.width * aIntersection.width / aRect.width;
float h = aTextureCoords.height * aIntersection.height / aRect.height;
float w = aTextureCoords.Width() * aIntersection.Width() / aRect.Width();
float h = aTextureCoords.Height() * aIntersection.Height() / aRect.Height();
static const auto Clamp = [](float& f)
{
@ -205,8 +205,8 @@ UpdateTextureCoordinates(gfx::TexturedTriangle& aTriangle,
auto UpdatePoint = [&](const gfx::Point& p, gfx::Point& t)
{
t.x = x + (p.x - aIntersection.x) / aIntersection.width * w;
t.y = y + (p.y - aIntersection.y) / aIntersection.height * h;
t.x = x + (p.x - aIntersection.x) / aIntersection.Width() * w;
t.y = y + (p.y - aIntersection.y) / aIntersection.Height() * h;
Clamp(t.x);
Clamp(t.y);
@ -295,8 +295,8 @@ GenerateTexturedTriangles(const gfx::Polygon& aPolygon,
continue;
}
MOZ_ASSERT(rect.width > 0.0f && rect.height > 0.0f);
MOZ_ASSERT(intersection.width > 0.0f && intersection.height > 0.0f);
MOZ_ASSERT(rect.Width() > 0.0f && rect.Height() > 0.0f);
MOZ_ASSERT(intersection.Width() > 0.0f && intersection.Height() > 0.0f);
// Since the texture was created for non-split geometry, we need to
// update the texture coordinates to account for the split.
@ -372,22 +372,22 @@ Compositor::SlowDrawRect(const gfx::Rect& aRect, const gfx::Color& aColor,
effects.mPrimaryEffect = new EffectSolidColor(aColor);
// left
this->DrawQuad(gfx::Rect(aRect.x, aRect.y,
aStrokeWidth, aRect.height),
aStrokeWidth, aRect.Height()),
aClipRect, effects, opacity,
aTransform);
// top
this->DrawQuad(gfx::Rect(aRect.x + aStrokeWidth, aRect.y,
aRect.width - 2 * aStrokeWidth, aStrokeWidth),
aRect.Width() - 2 * aStrokeWidth, aStrokeWidth),
aClipRect, effects, opacity,
aTransform);
// right
this->DrawQuad(gfx::Rect(aRect.x + aRect.width - aStrokeWidth, aRect.y,
aStrokeWidth, aRect.height),
this->DrawQuad(gfx::Rect(aRect.x + aRect.Width() - aStrokeWidth, aRect.y,
aStrokeWidth, aRect.Height()),
aClipRect, effects, opacity,
aTransform);
// bottom
this->DrawQuad(gfx::Rect(aRect.x + aStrokeWidth, aRect.y + aRect.height - aStrokeWidth,
aRect.width - 2 * aStrokeWidth, aStrokeWidth),
this->DrawQuad(gfx::Rect(aRect.x + aStrokeWidth, aRect.y + aRect.Height() - aStrokeWidth,
aRect.Width() - 2 * aStrokeWidth, aStrokeWidth),
aClipRect, effects, opacity,
aTransform);
}
@ -453,23 +453,23 @@ DecomposeIntoNoRepeatRects(const gfx::Rect& aRect,
// If the texture should be flipped, it will have negative height. Detect that
// here and compensate for it. We will flip each rect as we emit it.
bool flipped = false;
if (texCoordRect.height < 0) {
if (texCoordRect.Height() < 0) {
flipped = true;
texCoordRect.y += texCoordRect.height;
texCoordRect.height = -texCoordRect.height;
texCoordRect.y += texCoordRect.Height();
texCoordRect.SetHeight(-texCoordRect.Height());
}
// Wrap the texture coordinates so they are within [0,1] and cap width/height
// at 1. We rely on this below.
texCoordRect = gfx::Rect(gfx::Point(WrapTexCoord(texCoordRect.x),
WrapTexCoord(texCoordRect.y)),
gfx::Size(std::min(texCoordRect.width, 1.0f),
std::min(texCoordRect.height, 1.0f)));
gfx::Size(std::min(texCoordRect.Width(), 1.0f),
std::min(texCoordRect.Height(), 1.0f)));
NS_ASSERTION(texCoordRect.x >= 0.0f && texCoordRect.x <= 1.0f &&
texCoordRect.y >= 0.0f && texCoordRect.y <= 1.0f &&
texCoordRect.width >= 0.0f && texCoordRect.width <= 1.0f &&
texCoordRect.height >= 0.0f && texCoordRect.height <= 1.0f &&
texCoordRect.Width() >= 0.0f && texCoordRect.Width() <= 1.0f &&
texCoordRect.Height() >= 0.0f && texCoordRect.Height() <= 1.0f &&
texCoordRect.XMost() >= 0.0f && texCoordRect.XMost() <= 2.0f &&
texCoordRect.YMost() >= 0.0f && texCoordRect.YMost() <= 2.0f,
"We just wrapped the texture coordinates, didn't we?");
@ -513,8 +513,8 @@ DecomposeIntoNoRepeatRects(const gfx::Rect& aRect,
// tl.x .. 1.0 and then from 0.0 .. br.x (which we just wrapped above).
// The same applies for the Y axis. The midpoints we calculate here are
// only valid if we actually wrap around.
GLfloat xmid = aRect.x + (1.0f - tl.x) / texCoordRect.width * aRect.width;
GLfloat ymid = aRect.y + (1.0f - tl.y) / texCoordRect.height * aRect.height;
GLfloat xmid = aRect.x + (1.0f - tl.x) / texCoordRect.Width() * aRect.Width();
GLfloat ymid = aRect.y + (1.0f - tl.y) / texCoordRect.Height() * aRect.Height();
// Due to floating-point inaccuracy, we have to use XMost()-x and YMost()-y
// to calculate width and height, respectively, to ensure that size will

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

@ -173,7 +173,7 @@ D3D9SurfaceImage::AllocateAndCopy(D3D9RecycleAllocator* aAllocator,
return E_FAIL;
}
RECT src = { aRegion.x, aRegion.y, aRegion.x+aRegion.width, aRegion.y+aRegion.height };
RECT src = { aRegion.x, aRegion.y, aRegion.x+aRegion.Width(), aRegion.y+aRegion.Height() };
hr = device->StretchRect(surface, &src, textureSurface, nullptr, D3DTEXF_NONE);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

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

@ -44,11 +44,11 @@ void ImageLayer::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSu
SnapTransformTranslation(aTransformToSurface, nullptr);
if (mScaleMode != ScaleMode::SCALE_NONE &&
sourceRect.width != 0.0 && sourceRect.height != 0.0) {
sourceRect.Width() != 0.0 && sourceRect.Height() != 0.0) {
NS_ASSERTION(mScaleMode == ScaleMode::STRETCH,
"No other scalemodes than stretch and none supported yet.");
local.PreScale(mScaleToSize.width / sourceRect.width,
mScaleToSize.height / sourceRect.height, 1.0);
local.PreScale(mScaleToSize.width / sourceRect.Width(),
mScaleToSize.height / sourceRect.Height(), 1.0);
mEffectiveTransformForBuffer =
SnapTransform(local, sourceRect, nullptr) *

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

@ -376,8 +376,8 @@ static void DumpRect(T* aPacketRect, const Rect& aRect)
{
aPacketRect->set_x(aRect.x);
aPacketRect->set_y(aRect.y);
aPacketRect->set_w(aRect.width);
aPacketRect->set_h(aRect.height);
aPacketRect->set_w(aRect.Width());
aPacketRect->set_h(aRect.Height());
}
static void DumpFilter(TexturePacket* aTexturePacket,

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

@ -83,7 +83,7 @@ TransformRect(const IntRect& aRect, const Matrix4x4& aTransform)
return IntRect();
}
Rect rect(aRect.x, aRect.y, aRect.width, aRect.height);
Rect rect(aRect.x, aRect.y, aRect.Width(), aRect.Height());
rect = aTransform.TransformAndClipBounds(rect, Rect::MaxIntRect());
rect.RoundOut();

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

@ -525,7 +525,7 @@ Layer::CalculateScissorRect(const RenderTargetIntRect& aCurrentScissorRect)
// See DefaultComputeEffectiveTransforms below
NS_ASSERTION(is2D && matrix.PreservesAxisAlignedRectangles(),
"Non preserves axis aligned transform with clipped child should have forced intermediate surface");
gfx::Rect r(scissor.x, scissor.y, scissor.width, scissor.height);
gfx::Rect r(scissor.x, scissor.y, scissor.Width(), scissor.Height());
gfxRect trScissor = gfx::ThebesRect(matrix.TransformBounds(r));
trScissor.Round();
IntRect tmp;
@ -1883,8 +1883,8 @@ DumpRect(layerscope::LayersPacket::Layer::Rect* aLayerRect,
{
aLayerRect->set_x(aRect.x);
aLayerRect->set_y(aRect.y);
aLayerRect->set_w(aRect.width);
aLayerRect->set_h(aRect.height);
aLayerRect->set_w(aRect.Width());
aLayerRect->set_h(aRect.Height());
}
// The static helper function sets the nsIntRegion into the packet
@ -2461,7 +2461,7 @@ SetAntialiasingFlags(Layer* aLayer, DrawTarget* aTarget)
const IntRect& bounds = aLayer->GetVisibleRegion().ToUnknownRegion().GetBounds();
gfx::Rect transformedBounds = aTarget->GetTransform().TransformBounds(gfx::Rect(Float(bounds.x), Float(bounds.y),
Float(bounds.width), Float(bounds.height)));
Float(bounds.Width()), Float(bounds.Height())));
transformedBounds.RoundOut();
IntRect intTransformedBounds;
transformedBounds.ToIntRect(&intTransformedBounds);
@ -2473,7 +2473,7 @@ SetAntialiasingFlags(Layer* aLayer, DrawTarget* aTarget)
IntRect
ToOutsideIntRect(const gfxRect &aRect)
{
return IntRect::RoundOut(aRect.x, aRect.y, aRect.width, aRect.height);
return IntRect::RoundOut(aRect.x, aRect.y, aRect.Width(), aRect.Height());
}
TextLayer::TextLayer(LayerManager* aManager, void* aImplData)

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

@ -28,15 +28,15 @@ ComputeBackdropCopyRect(const gfx::Rect& aRect,
// Apply the layer transform.
RectDouble dest = aTransform.TransformAndClipBounds(
RectDouble(aRect.x, aRect.y, aRect.width, aRect.height),
RectDouble(renderBounds.x, renderBounds.y, renderBounds.width, renderBounds.height));
RectDouble(aRect.x, aRect.y, aRect.Width(), aRect.Height()),
RectDouble(renderBounds.x, renderBounds.y, renderBounds.Width(), renderBounds.Height()));
dest -= rtOffset;
// Ensure we don't round out to -1, which trips up Direct3D.
dest.IntersectRect(dest, RectDouble(0, 0, rtSize.width, rtSize.height));
if (aOutLayerQuad) {
*aOutLayerQuad = Rect(dest.x, dest.y, dest.width, dest.height);
*aOutLayerQuad = Rect(dest.x, dest.y, dest.Width(), dest.Height());
}
// Round out to integer.
@ -50,7 +50,7 @@ ComputeBackdropCopyRect(const gfx::Rect& aRect,
Matrix4x4 transform;
transform.PostScale(rtSize.width, rtSize.height, 1.0);
transform.PostTranslate(-result.x, -result.y, 0.0);
transform.PostScale(1 / float(result.width), 1 / float(result.height), 1.0);
transform.PostScale(1 / float(result.Width()), 1 / float(result.Height()), 1.0);
*aOutTransform = transform;
return result;
}

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

@ -65,7 +65,7 @@ AppendToString(std::stringstream& aStream, const nsRect& r,
aStream << pfx;
aStream << nsPrintfCString(
"(x=%d, y=%d, w=%d, h=%d)",
r.x, r.y, r.width, r.height).get();
r.x, r.y, r.Width(), r.Height()).get();
aStream << sfx;
}

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

@ -41,8 +41,8 @@ RotatedBuffer::GetQuadrantRectangle(XSide aXSide, YSide aYSide) const
// quadrantTranslation is the amount we translate the top-left
// of the quadrant by to get coordinates relative to the layer
IntPoint quadrantTranslation = -mBufferRotation;
quadrantTranslation.x += aXSide == LEFT ? mBufferRect.width : 0;
quadrantTranslation.y += aYSide == TOP ? mBufferRect.height : 0;
quadrantTranslation.x += aXSide == LEFT ? mBufferRect.Width() : 0;
quadrantTranslation.y += aYSide == TOP ? mBufferRect.Height() : 0;
return mBufferRect + quadrantTranslation;
}
@ -52,17 +52,17 @@ RotatedBuffer::GetSourceRectangle(XSide aXSide, YSide aYSide) const
Rect result;
if (aXSide == LEFT) {
result.x = 0;
result.width = mBufferRotation.x;
result.SetWidth(mBufferRotation.x);
} else {
result.x = mBufferRotation.x;
result.width = mBufferRect.width - mBufferRotation.x;
result.SetWidth(mBufferRect.Width() - mBufferRotation.x);
}
if (aYSide == TOP) {
result.y = 0;
result.height = mBufferRotation.y;
result.SetHeight(mBufferRotation.y);
} else {
result.y = mBufferRotation.y;
result.height = mBufferRect.height - mBufferRotation.y;
result.SetHeight(mBufferRect.Height() - mBufferRotation.y);
}
return result;
}
@ -415,7 +415,7 @@ ComputeBufferRect(const IntRect& aRequestedRect)
// dimensions). 64 used to be the magic number needed to work around
// a rendering glitch on b2g (see bug 788411). Now that we don't support
// this device anymore we should be fine with 8 pixels as the minimum.
rect.width = std::max(aRequestedRect.width, 8);
rect.SetWidth(std::max(aRequestedRect.Width(), 8));
return rect;
}
@ -587,8 +587,8 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
// changes to destBufferRect.
IntPoint newRotation = mBufferRotation +
(destBufferRect.TopLeft() - mBufferRect.TopLeft());
WrapRotationAxis(&newRotation.x, mBufferRect.width);
WrapRotationAxis(&newRotation.y, mBufferRect.height);
WrapRotationAxis(&newRotation.x, mBufferRect.Width());
WrapRotationAxis(&newRotation.y, mBufferRect.Height());
NS_ASSERTION(gfx::IntRect(gfx::IntPoint(0,0), mBufferRect.Size()).Contains(newRotation),
"newRotation out of bounds");
int32_t xBoundary = destBufferRect.XMost() - newRotation.x;
@ -662,8 +662,8 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
&destDTBuffer, &destDTBufferOnWhite);
if (!destDTBuffer ||
(!destDTBufferOnWhite && (bufferFlags & BUFFER_COMPONENT_ALPHA))) {
if (Factory::ReasonableSurfaceSize(IntSize(destBufferRect.width, destBufferRect.height))) {
gfxCriticalNote << "Failed 1 buffer db=" << hexa(destDTBuffer.get()) << " dw=" << hexa(destDTBufferOnWhite.get()) << " for " << destBufferRect.x << ", " << destBufferRect.y << ", " << destBufferRect.width << ", " << destBufferRect.height;
if (Factory::ReasonableSurfaceSize(IntSize(destBufferRect.Width(), destBufferRect.Height()))) {
gfxCriticalNote << "Failed 1 buffer db=" << hexa(destDTBuffer.get()) << " dw=" << hexa(destDTBufferOnWhite.get()) << " for " << destBufferRect.x << ", " << destBufferRect.y << ", " << destBufferRect.Width() << ", " << destBufferRect.Height();
}
return result;
}
@ -686,8 +686,8 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
&destDTBuffer, &destDTBufferOnWhite);
if (!destDTBuffer ||
(!destDTBufferOnWhite && (bufferFlags & BUFFER_COMPONENT_ALPHA))) {
if (Factory::ReasonableSurfaceSize(IntSize(destBufferRect.width, destBufferRect.height))) {
gfxCriticalNote << "Failed 2 buffer db=" << hexa(destDTBuffer.get()) << " dw=" << hexa(destDTBufferOnWhite.get()) << " for " << destBufferRect.x << ", " << destBufferRect.y << ", " << destBufferRect.width << ", " << destBufferRect.height;
if (Factory::ReasonableSurfaceSize(IntSize(destBufferRect.Width(), destBufferRect.Height()))) {
gfxCriticalNote << "Failed 2 buffer db=" << hexa(destDTBuffer.get()) << " dw=" << hexa(destDTBufferOnWhite.get()) << " for " << destBufferRect.x << ", " << destBufferRect.y << ", " << destBufferRect.Width() << ", " << destBufferRect.Height();
}
return result;
}
@ -788,9 +788,9 @@ RotatedContentBuffer::PrepareDrawTargetForPainting(CapturedPaintState* aState)
}
for (auto iter = aState->mRegionToDraw.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& rect = iter.Get();
target->FillRect(Rect(rect.x, rect.y, rect.width, rect.height),
target->FillRect(Rect(rect.x, rect.y, rect.Width(), rect.Height()),
ColorPattern(Color(0.0, 0.0, 0.0, 1.0)));
whiteTarget->FillRect(Rect(rect.x, rect.y, rect.width, rect.height),
whiteTarget->FillRect(Rect(rect.x, rect.y, rect.Width(), rect.Height()),
ColorPattern(Color(1.0, 1.0, 1.0, 1.0)));
}
} else if (aState->mContentType == gfxContentType::COLOR_ALPHA &&
@ -798,7 +798,7 @@ RotatedContentBuffer::PrepareDrawTargetForPainting(CapturedPaintState* aState)
// HaveBuffer() => we have an existing buffer that we must clear
for (auto iter = aState->mRegionToDraw.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& rect = iter.Get();
target->ClearRect(Rect(rect.x, rect.y, rect.width, rect.height));
target->ClearRect(Rect(rect.x, rect.y, rect.Width(), rect.Height()));
}
}

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

@ -1403,9 +1403,9 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
CSSToParentLayerScale realMinZoom = mZoomConstraints.mMinZoom;
CSSToParentLayerScale realMaxZoom = mZoomConstraints.mMaxZoom;
realMinZoom.scale = std::max(realMinZoom.scale,
mFrameMetrics.GetCompositionBounds().width / mFrameMetrics.GetScrollableRect().width);
mFrameMetrics.GetCompositionBounds().Width() / mFrameMetrics.GetScrollableRect().Width());
realMinZoom.scale = std::max(realMinZoom.scale,
mFrameMetrics.GetCompositionBounds().height / mFrameMetrics.GetScrollableRect().height);
mFrameMetrics.GetCompositionBounds().Height() / mFrameMetrics.GetScrollableRect().Height());
if (realMaxZoom < realMinZoom) {
realMaxZoom = realMinZoom;
}
@ -3064,12 +3064,12 @@ RedistributeDisplayPortExcess(CSSSize& aDisplayPortSize,
{
// As aDisplayPortSize.height * aDisplayPortSize.width does not change,
// we are just scaling by the ratio and its inverse.
if (aDisplayPortSize.height > aScrollableRect.height) {
aDisplayPortSize.width *= (aDisplayPortSize.height / aScrollableRect.height);
aDisplayPortSize.height = aScrollableRect.height;
} else if (aDisplayPortSize.width > aScrollableRect.width) {
aDisplayPortSize.height *= (aDisplayPortSize.width / aScrollableRect.width);
aDisplayPortSize.width = aScrollableRect.width;
if (aDisplayPortSize.height > aScrollableRect.Height()) {
aDisplayPortSize.width *= (aDisplayPortSize.height / aScrollableRect.Height());
aDisplayPortSize.height = aScrollableRect.Height();
} else if (aDisplayPortSize.width > aScrollableRect.Width()) {
aDisplayPortSize.height *= (aDisplayPortSize.width / aScrollableRect.Width());
aDisplayPortSize.width = aScrollableRect.Width();
}
}
@ -3119,14 +3119,14 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
APZC_LOG_FM(aFrameMetrics,
"Calculated displayport as (%f %f %f %f) from velocity %s paint time %f metrics",
displayPort.x, displayPort.y, displayPort.width, displayPort.height,
displayPort.x, displayPort.y, displayPort.Width(), displayPort.Height(),
ToString(aVelocity).c_str(), paintFactor);
CSSMargin cssMargins;
cssMargins.left = -displayPort.x;
cssMargins.top = -displayPort.y;
cssMargins.right = displayPort.width - compositionSize.width - cssMargins.left;
cssMargins.bottom = displayPort.height - compositionSize.height - cssMargins.top;
cssMargins.right = displayPort.Width() - compositionSize.width - cssMargins.left;
cssMargins.bottom = displayPort.Height() - compositionSize.height - cssMargins.top;
return cssMargins * aFrameMetrics.DisplayportPixelsPerCSSPixel();
}
@ -3266,10 +3266,10 @@ AsyncPanZoomController::RequestContentRepaint(const FrameMetrics& aFrameMetrics,
aFrameMetrics.GetScrollOffset().y) < EPSILON &&
aFrameMetrics.GetPresShellResolution() == mLastPaintRequestMetrics.GetPresShellResolution() &&
aFrameMetrics.GetZoom() == mLastPaintRequestMetrics.GetZoom() &&
fabsf(aFrameMetrics.GetViewport().width -
mLastPaintRequestMetrics.GetViewport().width) < EPSILON &&
fabsf(aFrameMetrics.GetViewport().height -
mLastPaintRequestMetrics.GetViewport().height) < EPSILON &&
fabsf(aFrameMetrics.GetViewport().Width() -
mLastPaintRequestMetrics.GetViewport().Width()) < EPSILON &&
fabsf(aFrameMetrics.GetViewport().Height() -
mLastPaintRequestMetrics.GetViewport().Height()) < EPSILON &&
aFrameMetrics.GetScrollGeneration() ==
mLastPaintRequestMetrics.GetScrollGeneration() &&
aFrameMetrics.GetScrollUpdateType() ==
@ -3710,12 +3710,12 @@ void AsyncPanZoomController::NotifyLayersUpdated(const ScrollMetadata& aScrollMe
bool needContentRepaint = false;
bool viewportUpdated = false;
if (FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().width, mFrameMetrics.GetCompositionBounds().width) &&
FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().height, mFrameMetrics.GetCompositionBounds().height)) {
if (FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().Width(), mFrameMetrics.GetCompositionBounds().Width()) &&
FuzzyEqualsAdditive(aLayerMetrics.GetCompositionBounds().Height(), mFrameMetrics.GetCompositionBounds().Height())) {
// Remote content has sync'd up to the composition geometry
// change, so we can accept the viewport it's calculated.
if (mFrameMetrics.GetViewport().width != aLayerMetrics.GetViewport().width ||
mFrameMetrics.GetViewport().height != aLayerMetrics.GetViewport().height) {
if (mFrameMetrics.GetViewport().Width() != aLayerMetrics.GetViewport().Width() ||
mFrameMetrics.GetViewport().Height() != aLayerMetrics.GetViewport().Height()) {
needContentRepaint = true;
viewportUpdated = true;
}
@ -3776,7 +3776,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const ScrollMetadata& aScrollMe
// in some things into our local mFrameMetrics because these things are
// determined by Gecko and our copy in mFrameMetrics may be stale.
if (FuzzyEqualsAdditive(mFrameMetrics.GetCompositionBounds().width, aLayerMetrics.GetCompositionBounds().width) &&
if (FuzzyEqualsAdditive(mFrameMetrics.GetCompositionBounds().Width(), aLayerMetrics.GetCompositionBounds().Width()) &&
mFrameMetrics.GetDevPixelsPerCSSPixel() == aLayerMetrics.GetDevPixelsPerCSSPixel() &&
!viewportUpdated) {
// Any change to the pres shell resolution was requested by APZ and is
@ -3937,15 +3937,15 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect, const uint32_t aFlags) {
// composition bounds. If this happens, we can't fill the target composited
// area with this frame.
CSSToParentLayerScale localMinZoom(std::max(mZoomConstraints.mMinZoom.scale,
std::max(compositionBounds.width / cssPageRect.width,
compositionBounds.height / cssPageRect.height)));
std::max(compositionBounds.Width() / cssPageRect.Width(),
compositionBounds.Height() / cssPageRect.Height())));
CSSToParentLayerScale localMaxZoom = mZoomConstraints.mMaxZoom;
if (!aRect.IsEmpty()) {
// Intersect the zoom-to-rect to the CSS rect to make sure it fits.
aRect = aRect.Intersect(cssPageRect);
targetZoom = CSSToParentLayerScale(std::min(compositionBounds.width / aRect.width,
compositionBounds.height / aRect.height));
targetZoom = CSSToParentLayerScale(std::min(compositionBounds.Width() / aRect.Width(),
compositionBounds.Height() / aRect.Height()));
}
// 1. If the rect is empty, the content-side logic for handling a double-tap
@ -3966,16 +3966,16 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect, const uint32_t aFlags) {
CSSSize compositedSize = mFrameMetrics.CalculateCompositedSizeInCssPixels();
float y = scrollOffset.y;
float newHeight =
cssPageRect.width * (compositedSize.height / compositedSize.width);
cssPageRect.Width() * (compositedSize.height / compositedSize.width);
float dh = compositedSize.height - newHeight;
aRect = CSSRect(0.0f,
y + dh/2,
cssPageRect.width,
cssPageRect.Width(),
newHeight);
aRect = aRect.Intersect(cssPageRect);
targetZoom = CSSToParentLayerScale(std::min(compositionBounds.width / aRect.width,
compositionBounds.height / aRect.height));
targetZoom = CSSToParentLayerScale(std::min(compositionBounds.Width() / aRect.Width(),
compositionBounds.Height() / aRect.Height()));
}
targetZoom.scale = clamped(targetZoom.scale, localMinZoom.scale, localMaxZoom.scale);
@ -4000,8 +4000,8 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect, const uint32_t aFlags) {
CSSSize sizeAfterZoom = endZoomToMetrics.CalculateCompositedSizeInCssPixels();
// Vertically center the zoomed element in the screen.
if (!zoomOut && (sizeAfterZoom.height > aRect.height)) {
aRect.y -= (sizeAfterZoom.height - aRect.height) * 0.5f;
if (!zoomOut && (sizeAfterZoom.height > aRect.Height())) {
aRect.y -= (sizeAfterZoom.height - aRect.Height()) * 0.5f;
if (aRect.y < 0.0f) {
aRect.y = 0.0f;
}
@ -4009,12 +4009,12 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect, const uint32_t aFlags) {
// If either of these conditions are met, the page will be
// overscrolled after zoomed
if (aRect.y + sizeAfterZoom.height > cssPageRect.height) {
aRect.y = cssPageRect.height - sizeAfterZoom.height;
if (aRect.y + sizeAfterZoom.height > cssPageRect.Height()) {
aRect.y = cssPageRect.Height() - sizeAfterZoom.height;
aRect.y = aRect.y > 0 ? aRect.y : 0;
}
if (aRect.x + sizeAfterZoom.width > cssPageRect.width) {
aRect.x = cssPageRect.width - sizeAfterZoom.width;
if (aRect.x + sizeAfterZoom.width > cssPageRect.Width()) {
aRect.x = cssPageRect.Width() - sizeAfterZoom.width;
aRect.x = aRect.x > 0 ? aRect.x : 0;
}

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

@ -505,7 +505,7 @@ ParentLayerCoord AxisX::GetPointOffset(const ParentLayerPoint& aPoint) const
ParentLayerCoord AxisX::GetRectLength(const ParentLayerRect& aRect) const
{
return aRect.width;
return aRect.Width();
}
ParentLayerCoord AxisX::GetRectOffset(const ParentLayerRect& aRect) const
@ -541,7 +541,7 @@ ParentLayerCoord AxisY::GetPointOffset(const ParentLayerPoint& aPoint) const
ParentLayerCoord AxisY::GetRectLength(const ParentLayerRect& aRect) const
{
return aRect.height;
return aRect.Height();
}
ParentLayerCoord AxisY::GetRectOffset(const ParentLayerRect& aRect) const

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

@ -114,8 +114,8 @@ CheckerboardEvent::LogInfo(RendertraceProperty aProperty,
<< sColors[aProperty] << " "
<< aRect.x << " "
<< aRect.y << " "
<< aRect.width << " "
<< aRect.height << " "
<< aRect.Width() << " "
<< aRect.Height() << " "
<< "// " << sDescriptions[aProperty]
<< aExtraInfo << std::endl;
}

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

@ -210,8 +210,8 @@ SetDisplayPortMargins(nsIPresShell* aPresShell,
CSSRect baseCSS = aMetrics.CalculateCompositedRectInCssPixels();
nsRect base(0, 0,
baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(),
baseCSS.height * nsPresContext::AppUnitsPerCSSPixel());
baseCSS.Width() * nsPresContext::AppUnitsPerCSSPixel(),
baseCSS.Height() * nsPresContext::AppUnitsPerCSSPixel());
nsLayoutUtils::SetDisplayPortBaseIfNotSet(aContent, base);
}

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

@ -77,12 +77,12 @@ IsRectZoomedIn(const CSSRect& aRect, const CSSRect& aCompositedArea)
// composition bounds (i.e. the overlapArea variable below) is approximately
// the max area of the rect we can show.
CSSRect overlap = aCompositedArea.Intersect(aRect);
float overlapArea = overlap.width * overlap.height;
float availHeight = std::min(aRect.width * aCompositedArea.height / aCompositedArea.width,
aRect.height);
float showing = overlapArea / (aRect.width * availHeight);
float ratioW = aRect.width / aCompositedArea.width;
float ratioH = aRect.height / aCompositedArea.height;
float overlapArea = overlap.Width() * overlap.Height();
float availHeight = std::min(aRect.Width() * aCompositedArea.Height() / aCompositedArea.Width(),
aRect.Height());
float showing = overlapArea / (aRect.Width() * availHeight);
float ratioW = aRect.Width() / aCompositedArea.Width();
float ratioH = aRect.Height() / aCompositedArea.Height();
return showing > 0.9 && (ratioW > 0.9 || ratioH > 0.9);
}
@ -129,27 +129,27 @@ CalculateRectToZoomTo(const nsCOMPtr<nsIDocument>& aRootContentDocument,
// the height of the |rect| so that it has the same aspect ratio as
// the root frame. The clipped |rect| is centered on the y value of
// the touch point. This allows tall narrow elements to be zoomed.
if (!rect.IsEmpty() && compositedArea.width > 0.0f) {
const float widthRatio = rect.width / compositedArea.width;
float targetHeight = compositedArea.height * widthRatio;
if (widthRatio < 0.9 && targetHeight < rect.height) {
if (!rect.IsEmpty() && compositedArea.Width() > 0.0f) {
const float widthRatio = rect.Width() / compositedArea.Width();
float targetHeight = compositedArea.Height() * widthRatio;
if (widthRatio < 0.9 && targetHeight < rect.Height()) {
const CSSPoint scrollPoint = CSSPoint::FromAppUnits(rootScrollFrame->GetScrollPosition());
float newY = aPoint.y + scrollPoint.y - (targetHeight * 0.5f);
if ((newY + targetHeight) > (rect.y + rect.height)) {
rect.y += rect.height - targetHeight;
if ((newY + targetHeight) > (rect.y + rect.Height())) {
rect.y += rect.Height() - targetHeight;
} else if (newY > rect.y) {
rect.y = newY;
}
rect.height = targetHeight;
rect.SetHeight(targetHeight);
}
}
rect = CSSRect(std::max(metrics.GetScrollableRect().x, rect.x - margin),
rect.y,
rect.width + 2 * margin,
rect.height);
rect.Width() + 2 * margin,
rect.Height());
// Constrict the rect to the screen's right edge
rect.width = std::min(rect.width, metrics.GetScrollableRect().XMost() - rect.x);
rect.SetWidth(std::min(rect.Width(), metrics.GetScrollableRect().XMost() - rect.x));
// If the rect is already taking up most of the visible area and is
// stretching the width of the page, then we want to zoom out instead.
@ -167,8 +167,8 @@ CalculateRectToZoomTo(const nsCOMPtr<nsIDocument>& aRootContentDocument,
// to zoom in (bug 761721). The 1.2 multiplier is just a little fuzz to
// compensate for 'rect' including horizontal margins but not vertical ones.
CSSCoord cssTapY = metrics.GetScrollOffset().y + aPoint.y;
if ((rect.height > rounded.height) && (cssTapY > rounded.y + (rounded.height * 1.2))) {
rounded.y = cssTapY - (rounded.height / 2);
if ((rect.Height() > rounded.Height()) && (cssTapY > rounded.y + (rounded.Height() * 1.2))) {
rounded.y = cssTapY - (rounded.Height() / 2);
}
return rounded;

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

@ -58,12 +58,12 @@ BasicCanvasLayer::Paint(DrawTarget* aDT,
if (canvasRenderer->NeedsYFlip()) {
oldTM = aDT->GetTransform();
aDT->SetTransform(Matrix(oldTM).
PreTranslate(0.0f, mBounds.height).
PreTranslate(0.0f, mBounds.Height()).
PreScale(1.0f, -1.0f));
}
FillRectWithMask(aDT, aDeviceOffset,
Rect(0, 0, mBounds.width, mBounds.height),
Rect(0, 0, mBounds.Width(), mBounds.Height()),
surface, mSamplingFilter,
DrawOptions(GetEffectiveOpacity(), GetEffectiveOperator(this)),
aMaskLayer);

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

@ -53,7 +53,7 @@ public:
return;
}
Rect snapped(mBounds.x, mBounds.y, mBounds.width, mBounds.height);
Rect snapped(mBounds.x, mBounds.y, mBounds.Width(), mBounds.Height());
MaybeSnapToDevicePixels(snapped, *aDT, true);
// Clip drawing in case we're using (unbounded) operator source.

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

@ -258,9 +258,9 @@ BasicCompositor::GetTextureFactoryIdentifier()
already_AddRefed<CompositingRenderTarget>
BasicCompositor::CreateRenderTarget(const IntRect& aRect, SurfaceInitMode aInit)
{
MOZ_ASSERT(aRect.width != 0 && aRect.height != 0, "Trying to create a render target of invalid size");
MOZ_ASSERT(aRect.Width() != 0 && aRect.Height() != 0, "Trying to create a render target of invalid size");
if (aRect.width * aRect.height == 0) {
if (aRect.Width() * aRect.Height() == 0) {
return nullptr;
}
@ -288,9 +288,9 @@ already_AddRefed<CompositingRenderTarget>
BasicCompositor::CreateRenderTargetForWindow(const LayoutDeviceIntRect& aRect, const LayoutDeviceIntRect& aClearRect, BufferMode aBufferMode)
{
MOZ_ASSERT(mDrawTarget);
MOZ_ASSERT(aRect.width != 0 && aRect.height != 0, "Trying to create a render target of invalid size");
MOZ_ASSERT(aRect.Width() != 0 && aRect.Height() != 0, "Trying to create a render target of invalid size");
if (aRect.width * aRect.height == 0) {
if (aRect.Width() * aRect.Height() == 0) {
return nullptr;
}
@ -461,8 +461,8 @@ DrawSurfaceWithTextureCoords(gfx::DrawTarget* aDest,
// Convert aTextureCoords into aSource's coordinate space
gfxRect sourceRect(aTextureCoords.x * aSource->GetSize().width,
aTextureCoords.y * aSource->GetSize().height,
aTextureCoords.width * aSource->GetSize().width,
aTextureCoords.height * aSource->GetSize().height);
aTextureCoords.Width() * aSource->GetSize().width,
aTextureCoords.Height() * aSource->GetSize().height);
// Floating point error can accumulate above and we know our visible region
// is integer-aligned, so round it out.
@ -558,10 +558,10 @@ AttemptVideoScale(TextureSourceBasic* aSource, const SourceSurface* aSourceMask,
ssse3_scale_data((uint32_t*)mapSrc.GetData(), srcSource->GetSize().width, srcSource->GetSize().height,
mapSrc.GetStride()/4,
((uint32_t*)dstData) + fillRect.x + (dstStride / 4) * fillRect.y, dstRect.width, dstRect.height,
((uint32_t*)dstData) + fillRect.x + (dstStride / 4) * fillRect.y, dstRect.Width(), dstRect.Height(),
dstStride / 4,
offset.x, offset.y,
fillRect.width, fillRect.height);
fillRect.Width(), fillRect.Height());
aDest->ReleaseBits(dstData);
return true;
@ -842,7 +842,7 @@ BasicCompositor::DrawGeometry(const Geometry& aGeometry,
if (sourceMask) {
RefPtr<DrawTarget> transformDT =
dest->CreateSimilarDrawTarget(IntSize::Truncate(transformBounds.width, transformBounds.height),
dest->CreateSimilarDrawTarget(IntSize::Truncate(transformBounds.Width(), transformBounds.Height()),
SurfaceFormat::B8G8R8A8);
new3DTransform.PostTranslate(-transformBounds.x, -transformBounds.y, 0);
if (transformDT &&
@ -901,7 +901,7 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
}
LayoutDeviceIntRect intRect(LayoutDeviceIntPoint(), mWidget->GetClientSize());
IntRect rect = IntRect(0, 0, intRect.width, intRect.height);
IntRect rect = IntRect(0, 0, intRect.Width(), intRect.Height());
LayoutDeviceIntRegion invalidRegionSafe;
// Sometimes the invalid region is larger than we want to draw.
@ -1053,7 +1053,7 @@ BasicCompositor::TryToEndRemoteDrawing(bool aForceToEnd)
for (auto iter = mInvalidRegion.RectIter(); !iter.Done(); iter.Next()) {
const LayoutDeviceIntRect& r = iter.Get();
dest->CopySurface(source,
IntRect(r.x, r.y, r.width, r.height) - mRenderTarget->GetOrigin(),
IntRect(r.x, r.y, r.Width(), r.Height()) - mRenderTarget->GetOrigin(),
IntPoint(r.x, r.y) - offset);
}
}

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

@ -62,7 +62,7 @@ using namespace mozilla::gfx;
static bool
ClipToContain(gfxContext* aContext, const IntRect& aRect)
{
gfxRect userRect(aRect.x, aRect.y, aRect.width, aRect.height);
gfxRect userRect(aRect.x, aRect.y, aRect.Width(), aRect.Height());
gfxRect deviceRect = aContext->UserToDevice(userRect);
deviceRect.RoundOut();
@ -270,7 +270,7 @@ public:
!mTransform.HasNonAxisAlignedTransform()) {
gfx::Rect opaqueRect = dt->GetTransform().TransformBounds(
gfx::Rect(bounds.x, bounds.y, bounds.width, bounds.height));
gfx::Rect(bounds.x, bounds.y, bounds.Width(), bounds.Height()));
opaqueRect.RoundIn();
IntRect intOpaqueRect;
if (opaqueRect.ToIntRect(&intOpaqueRect)) {
@ -374,7 +374,7 @@ static void
TransformIntRect(IntRect& aRect, const Matrix& aMatrix,
IntRect (*aRoundMethod)(const gfxRect&))
{
Rect gr = Rect(aRect.x, aRect.y, aRect.width, aRect.height);
Rect gr = Rect(aRect.x, aRect.y, aRect.Width(), aRect.Height());
gr = aMatrix.TransformBounds(gr);
aRect = (*aRoundMethod)(ThebesRect(gr));
}
@ -624,7 +624,7 @@ BasicLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
if (!mRegionToClear.IsEmpty()) {
for (auto iter = mRegionToClear.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& r = iter.Get();
mTarget->GetDrawTarget()->ClearRect(Rect(r.x, r.y, r.width, r.height));
mTarget->GetDrawTarget()->ClearRect(Rect(r.x, r.y, r.Width(), r.Height()));
}
}
if (mWidget) {
@ -801,7 +801,7 @@ InstallLayerClipPreserves3D(gfxContext* aTarget, Layer* aLayer)
aTarget->NewPath();
aTarget->SnappedRectangle(gfxRect(clipRect->x, clipRect->y,
clipRect->width, clipRect->height));
clipRect->Width(), clipRect->Height()));
aTarget->Clip();
aTarget->SetMatrix(oldTransform);
@ -906,7 +906,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
IntRect bounds = visibleRegion.GetBounds();
// DrawTarget without the 3D transform applied:
RefPtr<DrawTarget> untransformedDT =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(IntSize(bounds.width, bounds.height),
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(IntSize(bounds.Width(), bounds.Height()),
SurfaceFormat::B8G8R8A8);
if (!untransformedDT || !untransformedDT->IsValid()) {
return;
@ -939,7 +939,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
RefPtr<SourceSurface> untransformedSurf = untransformedDT->Snapshot();
RefPtr<DrawTarget> xformDT =
untransformedDT->CreateSimilarDrawTarget(IntSize::Truncate(xformBounds.width, xformBounds.height),
untransformedDT->CreateSimilarDrawTarget(IntSize::Truncate(xformBounds.Width(), xformBounds.Height()),
SurfaceFormat::B8G8R8A8);
RefPtr<SourceSurface> xformSurf;
if(xformDT && untransformedSurf &&

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

@ -54,7 +54,7 @@ public:
return;
}
Rect snapped(mBounds.x, mBounds.y, mBounds.width, mBounds.height);
Rect snapped(mBounds.x, mBounds.y, mBounds.Width(), mBounds.Height());
MaybeSnapToDevicePixels(snapped, *aDT, true);
// We don't currently support subpixel-AA in TextLayers since we

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

@ -632,8 +632,8 @@ ClientLayerManager::MakeSnapshotIfRequired()
RefPtr<DataSourceSurface> surf = GetSurfaceForDescriptor(outSnapshot);
DrawTarget* dt = mShadowTarget->GetDrawTarget();
Rect dstRect(bounds.x, bounds.y, bounds.width, bounds.height);
Rect srcRect(0, 0, bounds.width, bounds.height);
Rect dstRect(bounds.x, bounds.y, bounds.Width(), bounds.Height());
Rect srcRect(0, 0, bounds.Width(), bounds.Height());
gfx::Matrix rotate =
ComputeTransformForUnRotation(outerBounds.ToUnknownRect(),

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

@ -137,7 +137,7 @@ ContentClientBasic::CreateBuffer(ContentType aType,
gfxDevCrash(LogReason::AlphaWithBasicClient) << "Asking basic content client for component alpha";
}
IntSize size(aRect.width, aRect.height);
IntSize size(aRect.Width(), aRect.Height());
#ifdef XP_WIN
if (mBackend == BackendType::CAIRO &&
(aType == gfxContentType::COLOR || aType == gfxContentType::COLOR_ALPHA)) {
@ -327,7 +327,7 @@ ContentClientRemoteBuffer::BuildTextureClients(SurfaceFormat aFormat,
DestroyBuffers();
mSurfaceFormat = aFormat;
mSize = IntSize(aRect.width, aRect.height);
mSize = IntSize(aRect.Width(), aRect.Height());
mTextureFlags = TextureFlagsForRotatedContentBufferFlags(aFlags);
if (aFlags & BUFFER_COMPONENT_ALPHA) {
@ -625,8 +625,8 @@ ContentClientDoubleBuffered::FinalizeFrame(const nsIntRegion& aRegionToDraw)
this,
mFrontUpdatedRegion.GetBounds().x,
mFrontUpdatedRegion.GetBounds().y,
mFrontUpdatedRegion.GetBounds().width,
mFrontUpdatedRegion.GetBounds().height));
mFrontUpdatedRegion.GetBounds().Width(),
mFrontUpdatedRegion.GetBounds().Height()));
mFrontAndBackBufferDiffer = false;

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

@ -206,8 +206,8 @@ SharedFrameMetricsHelper::UpdateFromCompositorFrameMetrics(
fabsf(contentMetrics.GetScrollOffset().y - compositorMetrics.GetScrollOffset().y) <= 2 &&
fabsf(contentMetrics.GetDisplayPort().x - compositorMetrics.GetDisplayPort().x) <= 2 &&
fabsf(contentMetrics.GetDisplayPort().y - compositorMetrics.GetDisplayPort().y) <= 2 &&
fabsf(contentMetrics.GetDisplayPort().width - compositorMetrics.GetDisplayPort().width) <= 2 &&
fabsf(contentMetrics.GetDisplayPort().height - compositorMetrics.GetDisplayPort().height) <= 2) {
fabsf(contentMetrics.GetDisplayPort().Width() - compositorMetrics.GetDisplayPort().Width()) <= 2 &&
fabsf(contentMetrics.GetDisplayPort().Height() - compositorMetrics.GetDisplayPort().Height()) <= 2) {
return false;
}
@ -522,7 +522,7 @@ TileClient::ValidateBackBufferFromFront(const nsIntRegion& aDirtyRegion,
// is unlikely that we'd save much by copying each individual rect of the
// region, but we can reevaluate this if it becomes an issue.
const IntRect rectToCopy = regionToCopy.GetBounds();
gfx::IntRect gfxRectToCopy(rectToCopy.x, rectToCopy.y, rectToCopy.width, rectToCopy.height);
gfx::IntRect gfxRectToCopy(rectToCopy.x, rectToCopy.y, rectToCopy.Width(), rectToCopy.Height());
CopyFrontToBack(mFrontBuffer, mBackBuffer, gfxRectToCopy);
if (mBackBufferOnWhite) {
@ -923,9 +923,9 @@ void ClientMultiTiledLayerBuffer::Update(const nsIntRegion& newValidRegion,
const TilesPlacement newTiles(floor_div(newBounds.x, scaledTileSize.width),
floor_div(newBounds.y, scaledTileSize.height),
floor_div(GetTileStart(newBounds.x, scaledTileSize.width)
+ newBounds.width, scaledTileSize.width) + 1,
+ newBounds.Width(), scaledTileSize.width) + 1,
floor_div(GetTileStart(newBounds.y, scaledTileSize.height)
+ newBounds.height, scaledTileSize.height) + 1);
+ newBounds.Height(), scaledTileSize.height) + 1);
const size_t oldTileCount = mRetainedTiles.Length();
const size_t newTileCount = newTiles.mSize.width * newTiles.mSize.height;
@ -1106,8 +1106,8 @@ ClientMultiTiledLayerBuffer::ValidateTile(TileClient& aTile,
const IntRect& dirtyRect = iter.Get();
gfx::Rect drawRect(dirtyRect.x - aTileOrigin.x,
dirtyRect.y - aTileOrigin.y,
dirtyRect.width,
dirtyRect.height);
dirtyRect.Width(),
dirtyRect.Height());
drawRect.Scale(mResolution);
// Mark the newly updated area as invalid in the front buffer

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

@ -65,7 +65,7 @@ IsSameDimension(dom::ScreenOrientationInternal o1, dom::ScreenOrientationInterna
static bool
ContentMightReflowOnOrientationChange(const IntRect& rect)
{
return rect.width != rect.height;
return rect.Width() != rect.Height();
}
AsyncCompositionManager::AsyncCompositionManager(CompositorBridgeParent* aParent,

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

@ -41,9 +41,9 @@
// #define CULLING_LOG(...) printf_stderr("CULLING: " __VA_ARGS__)
#define DUMP(...) do { if (gfxEnv::DumpDebug()) { printf_stderr(__VA_ARGS__); } } while(0)
#define XYWH(k) (k).x, (k).y, (k).width, (k).height
#define XYWH(k) (k).x, (k).y, (k).Width(), (k).Height()
#define XY(k) (k).x, (k).y
#define WH(k) (k).width, (k).height
#define WH(k) (k).Width(), (k).Height()
namespace mozilla {
namespace layers {
@ -67,7 +67,7 @@ DrawLayerInfo(const RenderTargetIntRect& aClipRect,
LayerIntRegion visibleRegion = aLayer->GetVisibleRegion();
uint32_t maxWidth = std::min<uint32_t>(visibleRegion.GetBounds().width, 500);
uint32_t maxWidth = std::min<uint32_t>(visibleRegion.GetBounds().Width(), 500);
IntPoint topLeft = visibleRegion.ToUnknownRegion().GetBounds().TopLeft();
aManager->GetTextRenderer()->RenderText(
@ -86,8 +86,8 @@ PrintUniformityInfo(Layer* aLayer)
}
// Don't want to print a log for smaller layers
if (aLayer->GetLocalVisibleRegion().GetBounds().width < 300 ||
aLayer->GetLocalVisibleRegion().GetBounds().height < 300) {
if (aLayer->GetLocalVisibleRegion().GetBounds().Width() < 300 ||
aLayer->GetLocalVisibleRegion().GetBounds().Height() < 300) {
return;
}
@ -433,7 +433,7 @@ RenderLayers(ContainerT* aContainer, LayerManagerComposite* aManager,
gfx::IntRect clearRect = layerToRender->GetClearRect();
if (!clearRect.IsEmpty()) {
// Clear layer's visible rect on FrameBuffer with transparent pixels
gfx::Rect fbRect(clearRect.x, clearRect.y, clearRect.width, clearRect.height);
gfx::Rect fbRect(clearRect.x, clearRect.y, clearRect.Width(), clearRect.Height());
compositor->ClearRect(fbRect);
layerToRender->SetClearRect(gfx::IntRect(0, 0, 0, 0));
}
@ -533,7 +533,7 @@ CreateTemporaryTargetAndCopyFromBackground(ContainerT* aContainer,
gfx::IntRect visibleRect = aContainer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds();
RefPtr<CompositingRenderTarget> previousTarget = compositor->GetCurrentRenderTarget();
gfx::IntRect surfaceRect = gfx::IntRect(visibleRect.x, visibleRect.y,
visibleRect.width, visibleRect.height);
visibleRect.Width(), visibleRect.Height());
gfx::IntPoint sourcePoint = gfx::IntPoint(visibleRect.x, visibleRect.y);

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

@ -175,12 +175,12 @@ ContentHostTexture::Composite(Compositor* aCompositor,
tileRegionRect.MoveBy(-currentTileRect.TopLeft());
}
gfx::Rect rect(tileScreenRect.x, tileScreenRect.y,
tileScreenRect.width, tileScreenRect.height);
tileScreenRect.Width(), tileScreenRect.Height());
effect->mTextureCoords = Rect(Float(tileRegionRect.x) / texRect.width,
Float(tileRegionRect.y) / texRect.height,
Float(tileRegionRect.width) / texRect.width,
Float(tileRegionRect.height) / texRect.height);
effect->mTextureCoords = Rect(Float(tileRegionRect.x) / texRect.Width(),
Float(tileRegionRect.y) / texRect.Height(),
Float(tileRegionRect.Width()) / texRect.Width(),
Float(tileRegionRect.Height()) / texRect.Height());
aCompositor->DrawGeometry(rect, aClipRect, aEffectChain,
aOpacity, aTransform, aGeometry);
@ -359,8 +359,8 @@ ContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
destRegion.MoveBy(-aData.rect().TopLeft());
if (!aData.rect().Contains(aUpdated.GetBounds()) ||
aData.rotation().x > aData.rect().width ||
aData.rotation().y > aData.rect().height) {
aData.rotation().x > aData.rect().Width() ||
aData.rotation().y > aData.rect().Height()) {
NS_ERROR("Invalid update data");
return false;
}
@ -381,11 +381,11 @@ ContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
// For each of the overlap areas (right, bottom-right, bottom), select those
// pixels and wrap them around to the opposite edge of the buffer rect.
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(aData.rect().width, 0));
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(aData.rect().width, aData.rect().height));
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(0, aData.rect().height));
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(aData.rect().Width(), 0));
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(aData.rect().Width(), aData.rect().Height()));
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(0, aData.rect().Height()));
MOZ_ASSERT(IntRect(0, 0, aData.rect().width, aData.rect().height).Contains(finalRegion.GetBounds()));
MOZ_ASSERT(IntRect(0, 0, aData.rect().Width(), aData.rect().Height()).Contains(finalRegion.GetBounds()));
mTextureHost->Updated(&finalRegion);
if (mTextureHostOnWhite) {

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

@ -240,7 +240,7 @@ ImageHost::Composite(Compositor* aCompositor,
}
aEffectChain.mPrimaryEffect = effect;
gfx::Rect pictureRect(0, 0, img->mPictureRect.width, img->mPictureRect.height);
gfx::Rect pictureRect(0, 0, img->mPictureRect.Width(), img->mPictureRect.Height());
BigImageIterator* it = mCurrentTextureSource->AsBigImageIterator();
if (it) {
@ -263,15 +263,15 @@ ImageHost::Composite(Compositor* aCompositor,
it->BeginBigImageIteration();
do {
IntRect tileRect = it->GetTileRect();
gfx::Rect rect(tileRect.x, tileRect.y, tileRect.width, tileRect.height);
gfx::Rect rect(tileRect.x, tileRect.y, tileRect.Width(), tileRect.Height());
rect = rect.Intersect(pictureRect);
effect->mTextureCoords = Rect(Float(rect.x - tileRect.x) / tileRect.width,
Float(rect.y - tileRect.y) / tileRect.height,
Float(rect.width) / tileRect.width,
Float(rect.height) / tileRect.height);
effect->mTextureCoords = Rect(Float(rect.x - tileRect.x) / tileRect.Width(),
Float(rect.y - tileRect.y) / tileRect.Height(),
Float(rect.Width()) / tileRect.Width(),
Float(rect.Height()) / tileRect.Height());
if (img->mTextureHost->GetFlags() & TextureFlags::ORIGIN_BOTTOM_LEFT) {
effect->mTextureCoords.y = effect->mTextureCoords.YMost();
effect->mTextureCoords.height = -effect->mTextureCoords.height;
effect->mTextureCoords.SetHeight(-effect->mTextureCoords.Height());
}
aCompositor->DrawGeometry(rect, aClipRect, aEffectChain,
aOpacity, aTransform, aGeometry);
@ -286,12 +286,12 @@ ImageHost::Composite(Compositor* aCompositor,
IntSize textureSize = mCurrentTextureSource->GetSize();
effect->mTextureCoords = Rect(Float(img->mPictureRect.x) / textureSize.width,
Float(img->mPictureRect.y) / textureSize.height,
Float(img->mPictureRect.width) / textureSize.width,
Float(img->mPictureRect.height) / textureSize.height);
Float(img->mPictureRect.Width()) / textureSize.width,
Float(img->mPictureRect.Height()) / textureSize.height);
if (img->mTextureHost->GetFlags() & TextureFlags::ORIGIN_BOTTOM_LEFT) {
effect->mTextureCoords.y = effect->mTextureCoords.YMost();
effect->mTextureCoords.height = -effect->mTextureCoords.height;
effect->mTextureCoords.SetHeight(-effect->mTextureCoords.Height());
}
aCompositor->DrawGeometry(pictureRect, aClipRect, aEffectChain,
@ -459,7 +459,7 @@ ImageHost::GetImageSize() const
{
const TimedImage* img = ChooseImage();
if (img) {
return IntSize(img->mPictureRect.width, img->mPictureRect.height);
return IntSize(img->mPictureRect.Width(), img->mPictureRect.Height());
}
return IntSize();
}
@ -472,8 +472,8 @@ ImageHost::IsOpaque()
return false;
}
if (img->mPictureRect.width == 0 ||
img->mPictureRect.height == 0 ||
if (img->mPictureRect.Width() == 0 ||
img->mPictureRect.Height() == 0 ||
!img->mTextureHost) {
return false;
}

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

@ -575,7 +575,7 @@ LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion, const
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 650, 400));
}
if (drawFrameColorBars) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 10, aBounds.height));
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 10, aBounds.Height()));
}
#ifdef USE_SKIA
@ -626,33 +626,33 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
border = 4;
width = 6;
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(0, 0, 0, 1));
mCompositor->DrawQuad(gfx::Rect(border, border, aBounds.width - 2 * border, width),
mCompositor->DrawQuad(gfx::Rect(border, border, aBounds.Width() - 2 * border, width),
aBounds, effects, alpha, gfx::Matrix4x4());
mCompositor->DrawQuad(gfx::Rect(border, aBounds.height - border - width, aBounds.width - 2 * border, width),
mCompositor->DrawQuad(gfx::Rect(border, aBounds.Height() - border - width, aBounds.Width() - 2 * border, width),
aBounds, effects, alpha, gfx::Matrix4x4());
mCompositor->DrawQuad(gfx::Rect(border, border + width, width, aBounds.height - 2 * border - width * 2),
mCompositor->DrawQuad(gfx::Rect(border, border + width, width, aBounds.Height() - 2 * border - width * 2),
aBounds, effects, alpha, gfx::Matrix4x4());
mCompositor->DrawQuad(gfx::Rect(aBounds.width - border - width, border + width, width, aBounds.height - 2 * border - 2 * width),
mCompositor->DrawQuad(gfx::Rect(aBounds.Width() - border - width, border + width, width, aBounds.Height() - 2 * border - 2 * width),
aBounds, effects, alpha, gfx::Matrix4x4());
// Content
border = 5;
width = 4;
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(1, 1.f - mWarningLevel, 0, 1));
mCompositor->DrawQuad(gfx::Rect(border, border, aBounds.width - 2 * border, width),
mCompositor->DrawQuad(gfx::Rect(border, border, aBounds.Width() - 2 * border, width),
aBounds, effects, alpha, gfx::Matrix4x4());
mCompositor->DrawQuad(gfx::Rect(border, aBounds.height - border - width, aBounds.width - 2 * border, width),
mCompositor->DrawQuad(gfx::Rect(border, aBounds.height - border - width, aBounds.Width() - 2 * border, width),
aBounds, effects, alpha, gfx::Matrix4x4());
mCompositor->DrawQuad(gfx::Rect(border, border + width, width, aBounds.height - 2 * border - width * 2),
mCompositor->DrawQuad(gfx::Rect(border, border + width, width, aBounds.Height() - 2 * border - width * 2),
aBounds, effects, alpha, gfx::Matrix4x4());
mCompositor->DrawQuad(gfx::Rect(aBounds.width - border - width, border + width, width, aBounds.height - 2 * border - 2 * width),
mCompositor->DrawQuad(gfx::Rect(aBounds.Width() - border - width, border + width, width, aBounds.Height() - 2 * border - 2 * width),
aBounds, effects, alpha, gfx::Matrix4x4());
SetDebugOverlayWantsNextFrame(true);
}
#endif
GPUStats stats;
stats.mScreenPixels = mRenderBounds.width * mRenderBounds.height;
stats.mScreenPixels = mRenderBounds.Width() * mRenderBounds.Height();
mCompositor->GetFrameStats(&stats);
std::string text = mDiagnostics->GetFrameOverlayString(stats);
@ -670,7 +670,7 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
// in the top-right corner
EffectChain effects;
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(1, 0, 0, 1));
mCompositor->DrawQuad(gfx::Rect(aBounds.width - 20, 0, 20, 20),
mCompositor->DrawQuad(gfx::Rect(aBounds.Width() - 20, 0, 20, 20),
aBounds, effects, alpha, gfx::Matrix4x4());
mUnusedApzTransformWarning = false;
@ -682,7 +682,7 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
// warning box
EffectChain effects;
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(1, 1, 0, 1));
mCompositor->DrawQuad(gfx::Rect(aBounds.width - 40, 0, 20, 20),
mCompositor->DrawQuad(gfx::Rect(aBounds.Width() - 40, 0, 20, 20),
aBounds, effects, alpha, gfx::Matrix4x4());
mDisabledApzWarning = false;
@ -691,7 +691,7 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
}
if (drawFrameColorBars) {
gfx::IntRect sideRect(0, 0, 10, aBounds.height);
gfx::IntRect sideRect(0, 0, 10, aBounds.Height());
EffectChain effects;
effects.mPrimaryEffect = new EffectSolidColor(gfxUtils::GetColorForFrameNumber(sFrameCount));
@ -905,7 +905,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
}
ParentLayerIntRect clipRect;
IntRect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height);
IntRect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.Width(), mRenderBounds.Height());
IntRect actualBounds;
CompositorBench(mCompositor, bounds);
@ -921,12 +921,12 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
#endif
if (mRoot->GetClipRect()) {
clipRect = *mRoot->GetClipRect();
IntRect rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
IntRect rect(clipRect.x, clipRect.y, clipRect.Width(), clipRect.Height());
mCompositor->BeginFrame(aInvalidRegion, &rect, bounds, aOpaqueRegion, nullptr, &actualBounds);
} else {
gfx::IntRect rect;
mCompositor->BeginFrame(aInvalidRegion, nullptr, bounds, aOpaqueRegion, &rect, &actualBounds);
clipRect = ParentLayerIntRect(rect.x, rect.y, rect.width, rect.height);
clipRect = ParentLayerIntRect(rect.x, rect.y, rect.Width(), rect.Height());
}
#if defined(MOZ_WIDGET_ANDROID)
ScreenCoord offset = GetContentShiftForToolbar();
@ -970,7 +970,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
if (!mRegionToClear.IsEmpty()) {
for (auto iter = mRegionToClear.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& r = iter.Get();
mCompositor->ClearRect(Rect(r.x, r.y, r.width, r.height));
mCompositor->ClearRect(Rect(r.x, r.y, r.Width(), r.Height()));
}
}

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

@ -71,7 +71,7 @@ PaintCounter::Draw(Compositor* aCompositor, TimeDuration aPaintTime, TimeDuratio
effectChain.mPrimaryEffect = mTexturedEffect;
gfx::Matrix4x4 identity;
Rect rect(mRect.x, mRect.y, mRect.width, mRect.height);
Rect rect(mRect.x, mRect.y, mRect.Width(), mRect.Height());
aCompositor->DrawQuad(rect, mRect, effectChain, 1.0, identity);
}

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

@ -494,14 +494,14 @@ TiledContentHost::RenderTile(TileHost& aTile,
for (auto iter = aScreenRegion.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& rect = iter.Get();
Rect graphicsRect(rect.x, rect.y, rect.width, rect.height);
Rect graphicsRect(rect.x, rect.y, rect.Width(), rect.Height());
Rect textureRect(rect.x - aTextureOffset.x, rect.y - aTextureOffset.y,
rect.width, rect.height);
rect.Width(), rect.Height());
effect->mTextureCoords = Rect(textureRect.x / aTextureBounds.width,
textureRect.y / aTextureBounds.height,
textureRect.width / aTextureBounds.width,
textureRect.height / aTextureBounds.height);
textureRect.Width() / aTextureBounds.width,
textureRect.Height() / aTextureBounds.height);
aCompositor->DrawGeometry(graphicsRect, aClipRect, aEffectChain, opacity,
aTransform, aVisibleRect, aGeometry);
@ -576,7 +576,7 @@ TiledContentHost::RenderLayerBuffer(TiledLayerBufferComposite& aLayerBuffer,
effect.mPrimaryEffect = new EffectSolidColor(*aBackgroundColor);
for (auto iter = backgroundRegion.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& rect = iter.Get();
Rect graphicsRect(rect.x, rect.y, rect.width, rect.height);
Rect graphicsRect(rect.x, rect.y, rect.Width(), rect.Height());
aCompositor->DrawGeometry(graphicsRect, aClipRect, effect,
1.0, aTransform, aGeometry);
}
@ -605,7 +605,7 @@ TiledContentHost::RenderLayerBuffer(TiledLayerBufferComposite& aLayerBuffer,
aTransform, aSamplingFilter, aClipRect, tileDrawRegion,
tileOffset * resolution, aLayerBuffer.GetTileSize(),
gfx::Rect(visibleRect.x, visibleRect.y,
visibleRect.width, visibleRect.height),
visibleRect.Width(), visibleRect.Height()),
aGeometry);
if (tile.mTextureHostOnWhite) {
@ -614,7 +614,7 @@ TiledContentHost::RenderLayerBuffer(TiledLayerBufferComposite& aLayerBuffer,
}
gfx::Rect rect(visibleRect.x, visibleRect.y,
visibleRect.width, visibleRect.height);
visibleRect.Width(), visibleRect.Height());
aCompositor->DrawDiagnostics(DiagnosticFlags::CONTENT | componentAlphaDiagnostic,
rect, aClipRect, aTransform, mFlashCounter);
}

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

@ -326,13 +326,13 @@ already_AddRefed<CompositingRenderTarget>
CompositorD3D11::CreateRenderTarget(const gfx::IntRect& aRect,
SurfaceInitMode aInit)
{
MOZ_ASSERT(aRect.width != 0 && aRect.height != 0);
MOZ_ASSERT(aRect.Width() != 0 && aRect.Height() != 0);
if (aRect.width * aRect.height == 0) {
if (aRect.Width() * aRect.Height() == 0) {
return nullptr;
}
CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, aRect.width, aRect.height, 1, 1,
CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, aRect.Width(), aRect.Height(), 1, 1,
D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);
RefPtr<ID3D11Texture2D> texture;
@ -343,7 +343,7 @@ CompositorD3D11::CreateRenderTarget(const gfx::IntRect& aRect,
}
RefPtr<CompositingRenderTargetD3D11> rt = new CompositingRenderTargetD3D11(texture, aRect.TopLeft());
rt->SetSize(IntSize(aRect.width, aRect.height));
rt->SetSize(IntSize(aRect.Width(), aRect.Height()));
if (aInit == INIT_MODE_CLEAR) {
FLOAT clear[] = { 0, 0, 0, 0 };
@ -358,14 +358,14 @@ CompositorD3D11::CreateTexture(const gfx::IntRect& aRect,
const CompositingRenderTarget* aSource,
const gfx::IntPoint& aSourcePoint)
{
MOZ_ASSERT(aRect.width != 0 && aRect.height != 0);
MOZ_ASSERT(aRect.Width() != 0 && aRect.Height() != 0);
if (aRect.width * aRect.height == 0) {
if (aRect.Width() * aRect.Height() == 0) {
return nullptr;
}
CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM,
aRect.width, aRect.height, 1, 1,
aRect.Width(), aRect.Height(), 1, 1,
D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);
RefPtr<ID3D11Texture2D> texture;
@ -738,16 +738,16 @@ CompositorD3D11::DrawGeometry(const Geometry& aGeometry,
bounds = maskTransform.As2D().TransformBounds(bounds);
Matrix4x4 transform;
transform._11 = 1.0f / bounds.width;
transform._22 = 1.0f / bounds.height;
transform._41 = float(-bounds.x) / bounds.width;
transform._42 = float(-bounds.y) / bounds.height;
transform._11 = 1.0f / bounds.Width();
transform._22 = 1.0f / bounds.Height();
transform._41 = float(-bounds.x) / bounds.Width();
transform._42 = float(-bounds.y) / bounds.Height();
memcpy(mVSConstants.maskTransform, &transform._11, 64);
}
D3D11_RECT scissor;
IntRect clipRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height);
IntRect clipRect(aClipRect.x, aClipRect.y, aClipRect.Width(), aClipRect.Height());
if (mCurrentRT == mDefaultRT) {
clipRect = clipRect.Intersect(mCurrentClip);
}
@ -1014,7 +1014,7 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
IntRect clipRect = invalidRect;
if (aClipRectIn) {
clipRect.IntersectRect(clipRect, IntRect(aClipRectIn->x, aClipRectIn->y, aClipRectIn->width, aClipRectIn->height));
clipRect.IntersectRect(clipRect, IntRect(aClipRectIn->x, aClipRectIn->y, aClipRectIn->Width(), aClipRectIn->Height()));
}
if (clipRect.IsEmpty()) {
@ -1071,7 +1071,7 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
if (gfxPrefs::LayersDrawFPS()) {
uint32_t pixelsPerFrame = 0;
for (auto iter = mBackBufferInvalid.RectIter(); !iter.Done(); iter.Next()) {
pixelsPerFrame += iter.Get().width * iter.Get().height;
pixelsPerFrame += iter.Get().Width() * iter.Get().Height();
}
mDiagnostics->Start(pixelsPerFrame);

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

@ -1407,8 +1407,8 @@ MLGDeviceD3D11::SetViewport(const gfx::IntRect& aViewport)
vp.MinDepth = 0.0f;
vp.TopLeftX = aViewport.x;
vp.TopLeftY = aViewport.y;
vp.Width = aViewport.width;
vp.Height = aViewport.height;
vp.Width = aViewport.Width();
vp.Height = aViewport.Height();
mCtx->RSSetViewports(1, &vp);
}

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

@ -1382,7 +1382,7 @@ DataTextureSourceD3D11::Update(DataSourceSurface* aSurface,
void* data = map.mData + map.mStride * rect.y + BytesPerPixel(aSurface->GetFormat()) * rect.x;
context->UpdateSubresource(mTexture, 0, &box, data, map.mStride, map.mStride * rect.height);
context->UpdateSubresource(mTexture, 0, &box, data, map.mStride, map.mStride * rect.Height());
}
} else {
context->UpdateSubresource(mTexture, 0, nullptr, aSurface->GetData(),
@ -1402,8 +1402,8 @@ DataTextureSourceD3D11::Update(DataSourceSurface* aSurface,
for (uint32_t i = 0; i < tileCount; i++) {
IntRect tileRect = GetTileRect(i);
desc.Width = tileRect.width;
desc.Height = tileRect.height;
desc.Width = tileRect.Width();
desc.Height = tileRect.Height();
desc.Usage = D3D11_USAGE_IMMUTABLE;
D3D11_SUBRESOURCE_DATA initData;
@ -1480,7 +1480,7 @@ IntRect
DataTextureSourceD3D11::GetTileRect()
{
IntRect rect = GetTileRect(mCurrentTile);
return IntRect(rect.x, rect.y, rect.width, rect.height);
return IntRect(rect.x, rect.y, rect.Width(), rect.Height());
}
CompositingRenderTargetD3D11::CompositingRenderTargetD3D11(ID3D11Texture2D* aTexture,

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

@ -430,7 +430,7 @@ CompositorBridgeChild::RecvUpdatePluginConfigurations(const LayoutDeviceIntPoint
// our OnPaint handler and forwarded over to the plugin process async.
widget->Resize(aContentOffset.x + bounds.x,
aContentOffset.y + bounds.y,
bounds.width, bounds.height, true);
bounds.Width(), bounds.Height(), true);
}
widget->Enable(isVisible);

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

@ -48,9 +48,8 @@ ImageLayerMLGPU::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSu
mScaleToSize.width != 0.0 &&
mScaleToSize.height != 0.0)
{
Size scale(
sourceRect.width / mScaleToSize.width,
sourceRect.height / mScaleToSize.height);
Size scale(sourceRect.Width() / mScaleToSize.width,
sourceRect.Height() / mScaleToSize.height);
mScale = Some(scale);
}
@ -66,7 +65,7 @@ ImageLayerMLGPU::GetSamplingFilter()
bool
ImageLayerMLGPU::IsContentOpaque()
{
if (mPictureRect.width == 0 || mPictureRect.height == 0) {
if (mPictureRect.Width() == 0 || mPictureRect.Height() == 0) {
return false;
}
if (mScaleMode == ScaleMode::STRETCH) {

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

@ -61,10 +61,10 @@ MaskTexture::operator <(const MaskTexture& aOther) const
return mRect.y < aOther.mRect.y;
}
if (mRect.width != aOther.mRect.width) {
return mRect.width < aOther.mRect.width;
return mRect.Width() < aOther.mRect.Width();
}
if (mRect.height != aOther.mRect.height) {
return mRect.height < aOther.mRect.height;
return mRect.Height() < aOther.mRect.Height();
}
return mSource < aOther.mSource;
}

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

@ -506,13 +506,13 @@ TexturedRenderPass::AddClippedItem(Txn& aTxn,
Rect textureRect(
offset.x * xScale,
offset.y * yScale,
aDrawRect.width * xScale,
aDrawRect.height * yScale);
aDrawRect.Width() * xScale,
aDrawRect.Height() * yScale);
Rect textureCoords = TextureRectToCoords(textureRect, aTextureSize);
if (mTextureFlags & TextureFlags::ORIGIN_BOTTOM_LEFT) {
textureCoords.y = 1.0 - textureCoords.y;
textureCoords.height = -textureCoords.height;
textureCoords.SetHeight(-textureCoords.Height());
}
Rect layerRects[4];

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

@ -102,7 +102,7 @@ TexturedLayerMLGPU::OnPrepareToRender(FrameBuilder* aBuilder)
mTexture = source;
}
mPictureRect = IntRect(0, 0, info.img->mPictureRect.width, info.img->mPictureRect.height);
mPictureRect = IntRect(0, 0, info.img->mPictureRect.Width(), info.img->mPictureRect.Height());
mHost->FinishRendering(info);
return true;

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

@ -521,9 +521,9 @@ CompositorOGL::PrepareViewport(CompositingRenderTargetOGL* aRenderTarget)
already_AddRefed<CompositingRenderTarget>
CompositorOGL::CreateRenderTarget(const IntRect &aRect, SurfaceInitMode aInit)
{
MOZ_ASSERT(aRect.width != 0 && aRect.height != 0, "Trying to create a render target of invalid size");
MOZ_ASSERT(aRect.Width() != 0 && aRect.Height() != 0, "Trying to create a render target of invalid size");
if (aRect.width * aRect.height == 0) {
if (aRect.Width() * aRect.Height() == 0) {
return nullptr;
}
@ -548,9 +548,9 @@ CompositorOGL::CreateRenderTargetFromSource(const IntRect &aRect,
const CompositingRenderTarget *aSource,
const IntPoint &aSourcePoint)
{
MOZ_ASSERT(aRect.width != 0 && aRect.height != 0, "Trying to create a render target of invalid size");
MOZ_ASSERT(aRect.Width() != 0 && aRect.Height() != 0, "Trying to create a render target of invalid size");
if (aRect.width * aRect.height == 0) {
if (aRect.Width() * aRect.Height() == 0) {
return nullptr;
}
@ -619,10 +619,10 @@ void
CompositorOGL::ClearRect(const gfx::Rect& aRect)
{
// Map aRect to OGL coordinates, origin:bottom-left
GLint y = mViewportSize.height - (aRect.y + aRect.height);
GLint y = mViewportSize.height - (aRect.y + aRect.Height());
ScopedGLState scopedScissorTestState(mGLContext, LOCAL_GL_SCISSOR_TEST, true);
ScopedScissorRect autoScissorRect(mGLContext, aRect.x, y, aRect.width, aRect.height);
ScopedScissorRect autoScissorRect(mGLContext, aRect.x, y, aRect.Width(), aRect.Height());
mGLContext->fClearColor(0.0, 0.0, 0.0, 0.0);
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
}
@ -643,15 +643,15 @@ CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
if (mUseExternalSurfaceSize) {
rect = gfx::IntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
} else {
rect = gfx::IntRect(aRenderBounds.x, aRenderBounds.y, aRenderBounds.width, aRenderBounds.height);
rect = gfx::IntRect(aRenderBounds.x, aRenderBounds.y, aRenderBounds.Width(), aRenderBounds.Height());
}
if (aRenderBoundsOut) {
*aRenderBoundsOut = rect;
}
GLint width = rect.width;
GLint height = rect.height;
GLint width = rect.Width();
GLint height = rect.Height();
// We can't draw anything to something with no area
// so just return
@ -727,8 +727,8 @@ CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource,
// See bug 827170 for a discussion.
IntRect clampedRect = aRect;
int32_t maxTexSize = GetMaxTextureSize();
clampedRect.width = std::min(clampedRect.width, maxTexSize);
clampedRect.height = std::min(clampedRect.height, maxTexSize);
clampedRect.SetWidth(std::min(clampedRect.Width(), maxTexSize));
clampedRect.SetHeight(std::min(clampedRect.Height(), maxTexSize));
GLuint tex;
@ -758,25 +758,25 @@ CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource,
mGLContext->fCopyTexImage2D(mFBOTextureTarget,
0,
LOCAL_GL_RGBA,
clampedRect.x, FlipY(clampedRect.y + clampedRect.height),
clampedRect.width, clampedRect.height,
clampedRect.x, FlipY(clampedRect.y + clampedRect.Height()),
clampedRect.Width(), clampedRect.Height(),
0);
} else {
// Curses, incompatible formats. Take a slow path.
// RGBA
size_t bufferSize = clampedRect.width * clampedRect.height * 4;
size_t bufferSize = clampedRect.Width() * clampedRect.Height() * 4;
auto buf = MakeUnique<uint8_t[]>(bufferSize);
mGLContext->fReadPixels(clampedRect.x, clampedRect.y,
clampedRect.width, clampedRect.height,
clampedRect.Width(), clampedRect.Height(),
LOCAL_GL_RGBA,
LOCAL_GL_UNSIGNED_BYTE,
buf.get());
mGLContext->fTexImage2D(mFBOTextureTarget,
0,
LOCAL_GL_RGBA,
clampedRect.width, clampedRect.height,
clampedRect.Width(), clampedRect.Height(),
0,
LOCAL_GL_RGBA,
LOCAL_GL_UNSIGNED_BYTE,
@ -794,7 +794,7 @@ CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource,
mGLContext->fTexImage2D(mFBOTextureTarget,
0,
LOCAL_GL_RGBA,
clampedRect.width, clampedRect.height,
clampedRect.Width(), clampedRect.Height(),
0,
LOCAL_GL_RGBA,
LOCAL_GL_UNSIGNED_BYTE,
@ -811,8 +811,8 @@ CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource,
mGLContext->fBindTexture(mFBOTextureTarget, 0);
if (aAllocSize) {
aAllocSize->width = clampedRect.width;
aAllocSize->height = clampedRect.height;
aAllocSize->width = clampedRect.Width();
aAllocSize->height = clampedRect.Height();
}
return tex;
@ -1647,8 +1647,8 @@ CompositorOGL::CopyToTarget(DrawTarget* aTarget, const nsIntPoint& aTopLeft, con
} else {
rect = IntRect(0, 0, mWidgetSize.width, mWidgetSize.height);
}
GLint width = rect.width;
GLint height = rect.height;
GLint width = rect.Width();
GLint height = rect.Height();
if ((int64_t(width) * int64_t(height) * int64_t(4)) > INT32_MAX) {
NS_ERROR("Widget size too big - integer overflow!");
@ -1681,7 +1681,7 @@ CompositorOGL::CopyToTarget(DrawTarget* aTarget, const nsIntPoint& aTopLeft, con
Matrix oldMatrix = aTarget->GetTransform();
aTarget->SetTransform(glToCairoTransform);
Rect floatRect = Rect(rect.x, rect.y, rect.width, rect.height);
Rect floatRect = Rect(rect.x, rect.y, rect.Width(), rect.Height());
aTarget->DrawSurface(source, floatRect, floatRect, DrawSurfaceOptions(), DrawOptions(1.0f, CompositionOp::OP_SOURCE));
aTarget->SetTransform(oldMatrix);
aTarget->Flush();

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

@ -53,8 +53,8 @@ GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc, const gfx::IntRec
ScopedGLState scopedBlendState(gl, LOCAL_GL_BLEND, false);
// 2.0 means scale up by two
float blitScaleX = float(aDstRect.width) / float(aSrcRect.width);
float blitScaleY = float(aDstRect.height) / float(aSrcRect.height);
float blitScaleX = float(aDstRect.Width()) / float(aSrcRect.Width());
float blitScaleY = float(aDstRect.Height()) / float(aSrcRect.Height());
// We start iterating over all destination tiles
aDst->BeginBigImageIteration();
@ -116,8 +116,8 @@ GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc, const gfx::IntRec
float dx0 = 2.0f * float(srcSubInDstRect.x) / float(dstSize.width) - 1.0f;
float dy0 = 2.0f * float(srcSubInDstRect.y) / float(dstSize.height) - 1.0f;
float dx1 = 2.0f * float(srcSubInDstRect.x + srcSubInDstRect.width) / float(dstSize.width) - 1.0f;
float dy1 = 2.0f * float(srcSubInDstRect.y + srcSubInDstRect.height) / float(dstSize.height) - 1.0f;
float dx1 = 2.0f * float(srcSubInDstRect.x + srcSubInDstRect.Width()) / float(dstSize.width) - 1.0f;
float dy1 = 2.0f * float(srcSubInDstRect.y + srcSubInDstRect.Height()) / float(dstSize.height) - 1.0f;
ScopedViewportRect autoViewportRect(gl, 0, 0, dstSize.width, dstSize.height);
RectTriangles rects;

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

@ -266,7 +266,7 @@ AsyncImagePipelineManager::ApplyAsyncImages()
continue;
}
wr::LayoutSize contentSize { pipeline->mScBounds.width, pipeline->mScBounds.height };
wr::LayoutSize contentSize { pipeline->mScBounds.Width(), pipeline->mScBounds.Height() };
wr::DisplayListBuilder builder(pipelineId, contentSize);
if (!keys.IsEmpty()) {
@ -308,7 +308,7 @@ AsyncImagePipelineManager::ApplyAsyncImages()
wr::BuiltDisplayList dl;
wr::LayoutSize builderContentSize;
builder.Finalize(builderContentSize, dl);
mApi->SetRootDisplayList(gfx::Color(0.f, 0.f, 0.f, 0.f), epoch, LayerSize(pipeline->mScBounds.width, pipeline->mScBounds.height),
mApi->SetRootDisplayList(gfx::Color(0.f, 0.f, 0.f, 0.f), epoch, LayerSize(pipeline->mScBounds.Width(), pipeline->mScBounds.Height()),
pipelineId, builderContentSize,
dl.dl_desc, dl.dl.inner.data, dl.dl.inner.length);
}

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

@ -46,13 +46,13 @@ WebRenderCanvasLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
Maybe<gfx::Matrix4x4> transform;
if (canvasRenderer->NeedsYFlip()) {
transform = Some(GetTransform().PreTranslate(0, mBounds.height, 0).PreScale(1, -1, 1));
transform = Some(GetTransform().PreTranslate(0, mBounds.Height(), 0).PreScale(1, -1, 1));
}
ScrollingLayersHelper scroller(this, aBuilder, aSc);
StackingContextHelper sc(aSc, aBuilder, this, transform);
LayerRect rect(0, 0, mBounds.width, mBounds.height);
LayerRect rect(0, 0, mBounds.Width(), mBounds.Height());
DumpLayerInfo("CanvasLayer", rect);
wr::ImageRendering filter = wr::ToImageRendering(mSamplingFilter);

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

@ -291,7 +291,7 @@ WebRenderImageHost::GetImageSize() const
{
const TimedImage* img = ChooseImage();
if (img) {
return IntSize(img->mPictureRect.width, img->mPictureRect.height);
return IntSize(img->mPictureRect.Width(), img->mPictureRect.Height());
}
return IntSize();
}

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

@ -323,7 +323,7 @@ WebRenderLayerManager::CreateImageKey(nsDisplayItem* aItem,
LayerRect rect = ViewAs<LayerPixel>(
LayoutDeviceRect::FromAppUnits(bounds, appUnitsPerDevPixel),
PixelCastJustification::WebRenderHasUnitResolution);
LayerRect scBounds(0, 0, rect.width, rect.height);
LayerRect scBounds(0, 0, rect.width, rect.Height());
MaybeIntSize scaleToSize;
if (!aContainer->GetScaleHint().IsEmpty()) {
scaleToSize = Some(aContainer->GetScaleHint());
@ -397,14 +397,14 @@ PaintItemByDrawTarget(nsDisplayItem* aItem,
if (gfxPrefs::WebRenderHighlightPaintedLayers()) {
aDT->SetTransform(Matrix());
aDT->FillRect(Rect(0, 0, aImageRect.width, aImageRect.height), ColorPattern(Color(1.0, 0.0, 0.0, 0.5)));
aDT->FillRect(Rect(0, 0, aImageRect.Width(), aImageRect.Height()), ColorPattern(Color(1.0, 0.0, 0.0, 0.5)));
}
if (aItem->Frame()->PresContext()->GetPaintFlashing()) {
aDT->SetTransform(Matrix());
float r = float(rand()) / RAND_MAX;
float g = float(rand()) / RAND_MAX;
float b = float(rand()) / RAND_MAX;
aDT->FillRect(Rect(0, 0, aImageRect.width, aImageRect.height), ColorPattern(Color(r, g, b, 0.5)));
aDT->FillRect(Rect(0, 0, aImageRect.Width(), aImageRect.Height()), ColorPattern(Color(r, g, b, 0.5)));
}
}
@ -767,8 +767,8 @@ WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize)
gfxUtils::WriteAsPNG(snapshot, filename);
*/
Rect dst(bounds.x, bounds.y, bounds.width, bounds.height);
Rect src(0, 0, bounds.width, bounds.height);
Rect dst(bounds.x, bounds.y, bounds.Width(), bounds.Height());
Rect src(0, 0, bounds.Width(), bounds.Height());
// The data we get from webrender is upside down. So flip and translate up so the image is rightside up.
// Webrender always does a full screen readback.

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

@ -454,8 +454,8 @@ nsDeviceContext::GetDeviceSurfaceDimensions(nscoord &aWidth, nscoord &aHeight)
} else {
nsRect area;
ComputeFullAreaUsingScreen(&area);
aWidth = area.width;
aHeight = area.height;
aWidth = area.Width();
aHeight = area.Height();
}
return NS_OK;
@ -467,8 +467,8 @@ nsDeviceContext::GetRect(nsRect &aRect)
if (IsPrinterContext()) {
aRect.x = 0;
aRect.y = 0;
aRect.width = mWidth;
aRect.height = mHeight;
aRect.SetWidth(mWidth);
aRect.SetHeight(mHeight);
} else
ComputeFullAreaUsingScreen ( &aRect );
@ -481,8 +481,8 @@ nsDeviceContext::GetClientRect(nsRect &aRect)
if (IsPrinterContext()) {
aRect.x = 0;
aRect.y = 0;
aRect.width = mWidth;
aRect.height = mHeight;
aRect.SetWidth(mWidth);
aRect.SetHeight(mHeight);
}
else
ComputeClientRectUsingScreen(&aRect);
@ -623,8 +623,8 @@ nsDeviceContext::ComputeClientRectUsingScreen(nsRect* outRect)
// convert to device units
outRect->y = NSIntPixelsToAppUnits(y, AppUnitsPerDevPixel());
outRect->x = NSIntPixelsToAppUnits(x, AppUnitsPerDevPixel());
outRect->width = NSIntPixelsToAppUnits(width, AppUnitsPerDevPixel());
outRect->height = NSIntPixelsToAppUnits(height, AppUnitsPerDevPixel());
outRect->SetWidth(NSIntPixelsToAppUnits(width, AppUnitsPerDevPixel()));
outRect->SetHeight(NSIntPixelsToAppUnits(height, AppUnitsPerDevPixel()));
}
}
@ -644,11 +644,11 @@ nsDeviceContext::ComputeFullAreaUsingScreen(nsRect* outRect)
// convert to device units
outRect->y = NSIntPixelsToAppUnits(y, AppUnitsPerDevPixel());
outRect->x = NSIntPixelsToAppUnits(x, AppUnitsPerDevPixel());
outRect->width = NSIntPixelsToAppUnits(width, AppUnitsPerDevPixel());
outRect->height = NSIntPixelsToAppUnits(height, AppUnitsPerDevPixel());
outRect->SetWidth(NSIntPixelsToAppUnits(width, AppUnitsPerDevPixel()));
outRect->SetHeight(NSIntPixelsToAppUnits(height, AppUnitsPerDevPixel()));
mWidth = outRect->width;
mHeight = outRect->height;
mWidth = outRect->Width();
mHeight = outRect->Height();
}
}

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

@ -49,10 +49,10 @@ FILE* operator<<(FILE* out, const nsRect& rect)
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.y,
nsDeviceContext::AppUnitsPerCSSPixel()));
tmp.AppendLiteral(", ");
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.width,
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.Width(),
nsDeviceContext::AppUnitsPerCSSPixel()));
tmp.AppendLiteral(", ");
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.height,
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.Height(),
nsDeviceContext::AppUnitsPerCSSPixel()));
tmp.Append('}');
fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out);

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

@ -555,7 +555,7 @@ uint64_t nsRegion::Area () const
uint64_t area = 0;
for (auto iter = RectIter(); !iter.Done(); iter.Next()) {
const nsRect& rect = iter.Get();
area += uint64_t(rect.width) * rect.height;
area += uint64_t(rect.Width()) * rect.Height();
}
return area;
}
@ -610,7 +610,7 @@ TransformRect(const mozilla::gfx::IntRect& aRect, const mozilla::gfx::Matrix4x4&
return mozilla::gfx::IntRect();
}
mozilla::gfx::RectDouble rect(aRect.x, aRect.y, aRect.width, aRect.height);
mozilla::gfx::RectDouble rect(aRect.x, aRect.y, aRect.Width(), aRect.Height());
rect = aTransform.TransformAndClipBounds(rect, mozilla::gfx::RectDouble::MaxIntRect());
rect.RoundOut();

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

@ -103,8 +103,8 @@ NS_IMETHODIMP nsScriptableRegion::GetBoundingBox(int32_t *aX, int32_t *aY, int32
mozilla::gfx::IntRect boundRect = mRegion.GetBounds();
*aX = boundRect.x;
*aY = boundRect.y;
*aWidth = boundRect.width;
*aHeight = boundRect.height;
*aWidth = boundRect.Width();
*aHeight = boundRect.Height();
return NS_OK;
}
@ -148,8 +148,8 @@ NS_IMETHODIMP nsScriptableRegion::GetRects(JSContext* aCx, JS::MutableHandle<JS:
const mozilla::gfx::IntRect& rect = iter.Get();
if (!JS_DefineElement(aCx, destArray, n, rect.x, JSPROP_ENUMERATE) ||
!JS_DefineElement(aCx, destArray, n + 1, rect.y, JSPROP_ENUMERATE) ||
!JS_DefineElement(aCx, destArray, n + 2, rect.width, JSPROP_ENUMERATE) ||
!JS_DefineElement(aCx, destArray, n + 3, rect.height, JSPROP_ENUMERATE)) {
!JS_DefineElement(aCx, destArray, n + 2, rect.Width(), JSPROP_ENUMERATE) ||
!JS_DefineElement(aCx, destArray, n + 3, rect.Height(), JSPROP_ENUMERATE)) {
return NS_ERROR_FAILURE;
}
n += 4;

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

@ -65,7 +65,7 @@ public:
EXPECT_TRUE(r2.IsComplex()) << "nsRegion code got unexpectedly smarter!";
nsRect largest = r2.GetLargestRectangle();
EXPECT_TRUE(largest.width * largest.height == tests[i].expectedArea) <<
EXPECT_TRUE(largest.Width() * largest.Height() == tests[i].expectedArea) <<
"Did not successfully find largest rectangle in non-rectangular region on iteration " << i;
}
@ -91,7 +91,7 @@ public:
EXPECT_TRUE(r2.IsComplex()) << "nsRegion code got unexpectedly smarter!";
nsRect largest = r2.GetLargestRectangle();
EXPECT_TRUE(largest.width * largest.height == tests[i].expectedArea) <<
EXPECT_TRUE(largest.Width() * largest.Height() == tests[i].expectedArea) <<
"Did not successfully find largest rectangle in two-rect-subtract region on iteration " << i;
}
}

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

@ -47,8 +47,8 @@ VRDisplayPresentation::CreateLayers()
if (layer.mLeftBounds.Length() == 4) {
leftBounds.x = layer.mLeftBounds[0];
leftBounds.y = layer.mLeftBounds[1];
leftBounds.width = layer.mLeftBounds[2];
leftBounds.height = layer.mLeftBounds[3];
leftBounds.SetWidth(layer.mLeftBounds[2]);
leftBounds.SetHeight(layer.mLeftBounds[3]);
} else if (layer.mLeftBounds.Length() != 0) {
/**
* We ignore layers with an incorrect number of values.
@ -62,8 +62,8 @@ VRDisplayPresentation::CreateLayers()
if (layer.mRightBounds.Length() == 4) {
rightBounds.x = layer.mRightBounds[0];
rightBounds.y = layer.mRightBounds[1];
rightBounds.width = layer.mRightBounds[2];
rightBounds.height = layer.mRightBounds[3];
rightBounds.SetWidth(layer.mRightBounds[2]);
rightBounds.SetHeight(layer.mRightBounds[3]);
} else if (layer.mRightBounds.Length() != 0) {
/**
* We ignore layers with an incorrect number of values.

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

@ -1120,12 +1120,12 @@ VRDisplayOculus::SubmitFrame(TextureSourceD3D11* aSource,
layer.Fov[1] = mFOVPort[1];
layer.Viewport[0].Pos.x = aSize.width * aLeftEyeRect.x;
layer.Viewport[0].Pos.y = aSize.height * aLeftEyeRect.y;
layer.Viewport[0].Size.w = aSize.width * aLeftEyeRect.width;
layer.Viewport[0].Size.h = aSize.height * aLeftEyeRect.height;
layer.Viewport[0].Size.w = aSize.width * aLeftEyeRect.Width();
layer.Viewport[0].Size.h = aSize.height * aLeftEyeRect.Height();
layer.Viewport[1].Pos.x = aSize.width * aRightEyeRect.x;
layer.Viewport[1].Pos.y = aSize.height * aRightEyeRect.y;
layer.Viewport[1].Size.w = aSize.width * aRightEyeRect.width;
layer.Viewport[1].Size.h = aSize.height * aRightEyeRect.height;
layer.Viewport[1].Size.w = aSize.width * aRightEyeRect.Width();
layer.Viewport[1].Size.h = aSize.height * aRightEyeRect.Height();
const Point3D& l = mDisplayInfo.mEyeTranslation[0];
const Point3D& r = mDisplayInfo.mEyeTranslation[1];

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

@ -305,8 +305,8 @@ VRDisplayOpenVR::SubmitFrame(void* aTextureHandle,
::vr::VRTextureBounds_t bounds;
bounds.uMin = aLeftEyeRect.x;
bounds.vMin = 1.0 - aLeftEyeRect.y;
bounds.uMax = aLeftEyeRect.x + aLeftEyeRect.width;
bounds.vMax = 1.0 - aLeftEyeRect.y - aLeftEyeRect.height;
bounds.uMax = aLeftEyeRect.x + aLeftEyeRect.Width();
bounds.vMax = 1.0 - aLeftEyeRect.y - aLeftEyeRect.Height();
::vr::EVRCompositorError err;
err = mVRCompositor->Submit(::vr::EVREye::Eye_Left, &tex, &bounds);
@ -316,8 +316,8 @@ VRDisplayOpenVR::SubmitFrame(void* aTextureHandle,
bounds.uMin = aRightEyeRect.x;
bounds.vMin = 1.0 - aRightEyeRect.y;
bounds.uMax = aRightEyeRect.x + aRightEyeRect.width;
bounds.vMax = 1.0 - aRightEyeRect.y - aRightEyeRect.height;
bounds.uMax = aRightEyeRect.x + aRightEyeRect.Width();
bounds.vMax = 1.0 - aRightEyeRect.y - aRightEyeRect.Height();
err = mVRCompositor->Submit(::vr::EVREye::Eye_Right, &tex, &bounds);
if (err != ::vr::EVRCompositorError::VRCompositorError_None) {

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

@ -403,10 +403,10 @@ VRManagerChild::CreateVRLayer(uint32_t aDisplayID,
uint32_t aGroup)
{
PVRLayerChild* vrLayerChild = AllocPVRLayerChild(aDisplayID, aLeftEyeRect.x,
aLeftEyeRect.y, aLeftEyeRect.width,
aLeftEyeRect.height, aRightEyeRect.x,
aRightEyeRect.y, aRightEyeRect.width,
aRightEyeRect.height,
aLeftEyeRect.y, aLeftEyeRect.Width(),
aLeftEyeRect.Height(), aRightEyeRect.x,
aRightEyeRect.y, aRightEyeRect.Width(),
aRightEyeRect.Height(),
aGroup);
// Do the DOM labeling.
if (aTarget) {
@ -414,10 +414,10 @@ VRManagerChild::CreateVRLayer(uint32_t aDisplayID,
MOZ_ASSERT(vrLayerChild->GetActorEventTarget());
}
return SendPVRLayerConstructor(vrLayerChild, aDisplayID, aLeftEyeRect.x,
aLeftEyeRect.y, aLeftEyeRect.width,
aLeftEyeRect.height, aRightEyeRect.x,
aRightEyeRect.y, aRightEyeRect.width,
aRightEyeRect.height,
aLeftEyeRect.y, aLeftEyeRect.Width(),
aLeftEyeRect.Height(), aRightEyeRect.x,
aRightEyeRect.y, aRightEyeRect.Width(),
aRightEyeRect.Height(),
aGroup);
}