mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1239864 (part 5) - Use the new rect iterators in gfx/. r=nical.
This commit is contained in:
parent
110c0b0c35
commit
ea62acb917
@ -95,10 +95,9 @@ AppendToString(std::stringstream& aStream, const nsRegion& r,
|
||||
{
|
||||
aStream << pfx;
|
||||
|
||||
nsRegionRectIterator it(r);
|
||||
aStream << "< ";
|
||||
while (const nsRect* sr = it.Next()) {
|
||||
AppendToString(aStream, *sr);
|
||||
for (auto iter = r.RectIter(); !iter.Done(); iter.Next()) {
|
||||
AppendToString(aStream, iter.Get());
|
||||
aStream << "; ";
|
||||
}
|
||||
aStream << ">";
|
||||
@ -112,10 +111,9 @@ AppendToString(std::stringstream& aStream, const nsIntRegion& r,
|
||||
{
|
||||
aStream << pfx;
|
||||
|
||||
nsIntRegionRectIterator it(r);
|
||||
aStream << "< ";
|
||||
while (const IntRect* sr = it.Next()) {
|
||||
AppendToString(aStream, *sr);
|
||||
for (auto iter = r.RectIter(); !iter.Done(); iter.Next()) {
|
||||
AppendToString(aStream, iter.Get());
|
||||
aStream << "; ";
|
||||
}
|
||||
aStream << ">";
|
||||
|
@ -98,14 +98,11 @@ void
|
||||
AppendToString(std::stringstream& aStream, const mozilla::gfx::IntRegionTyped<units>& r,
|
||||
const char* pfx="", const char* sfx="")
|
||||
{
|
||||
typedef mozilla::gfx::IntRegionTyped<units> RegionType;
|
||||
|
||||
aStream << pfx;
|
||||
|
||||
typename RegionType::OldRectIterator it(r);
|
||||
aStream << "< ";
|
||||
while (const typename RegionType::RectType* sr = it.Next()) {
|
||||
AppendToString(aStream, *sr);
|
||||
for (auto iter = r.RectIter(); !iter.Done(); iter.Next()) {
|
||||
AppendToString(aStream, iter.Get());
|
||||
aStream << "; ";
|
||||
}
|
||||
aStream << ">";
|
||||
|
@ -759,20 +759,18 @@ RotatedContentBuffer::BorrowDrawTargetForPainting(PaintState& aPaintState,
|
||||
// requested.
|
||||
return nullptr;
|
||||
}
|
||||
nsIntRegionRectIterator iter(*drawPtr);
|
||||
const IntRect *iterRect;
|
||||
while ((iterRect = iter.Next())) {
|
||||
mDTBuffer->FillRect(Rect(iterRect->x, iterRect->y, iterRect->width, iterRect->height),
|
||||
for (auto iter = drawPtr->RectIter(); !iter.Done(); iter.Next()) {
|
||||
const IntRect& rect = iter.Get();
|
||||
mDTBuffer->FillRect(Rect(rect.x, rect.y, rect.width, rect.height),
|
||||
ColorPattern(Color(0.0, 0.0, 0.0, 1.0)));
|
||||
mDTBufferOnWhite->FillRect(Rect(iterRect->x, iterRect->y, iterRect->width, iterRect->height),
|
||||
mDTBufferOnWhite->FillRect(Rect(rect.x, rect.y, rect.width, rect.height),
|
||||
ColorPattern(Color(1.0, 1.0, 1.0, 1.0)));
|
||||
}
|
||||
} else if (aPaintState.mContentType == gfxContentType::COLOR_ALPHA && HaveBuffer()) {
|
||||
// HaveBuffer() => we have an existing buffer that we must clear
|
||||
nsIntRegionRectIterator iter(*drawPtr);
|
||||
const IntRect *iterRect;
|
||||
while ((iterRect = iter.Next())) {
|
||||
result->ClearRect(Rect(iterRect->x, iterRect->y, iterRect->width, iterRect->height));
|
||||
for (auto iter = drawPtr->RectIter(); !iter.Done(); iter.Next()) {
|
||||
const IntRect& rect = iter.Get();
|
||||
result->ClearRect(Rect(rect.x, rect.y, rect.width, rect.height));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -626,11 +626,11 @@ BasicCompositor::EndFrame()
|
||||
// The source DrawTarget is clipped to the invalidation region, so we have
|
||||
// to copy the individual rectangles in the region or else we'll draw blank
|
||||
// pixels.
|
||||
LayoutDeviceIntRegion::OldRectIterator iter(mInvalidRegion);
|
||||
for (const LayoutDeviceIntRect *r = iter.Next(); r; r = iter.Next()) {
|
||||
for (auto iter = mInvalidRegion.RectIter(); !iter.Done(); iter.Next()) {
|
||||
const LayoutDeviceIntRect& r = iter.Get();
|
||||
dest->CopySurface(source,
|
||||
IntRect(r->x - mInvalidRect.x, r->y - mInvalidRect.y, r->width, r->height),
|
||||
IntPoint(r->x - offset.x, r->y - offset.y));
|
||||
IntRect(r.x - mInvalidRect.x, r.y - mInvalidRect.y, r.width, r.height),
|
||||
IntPoint(r.x - offset.x, r.y - offset.y));
|
||||
}
|
||||
if (!mTarget) {
|
||||
mWidget->EndRemoteDrawingInRegion(mDrawTarget, mInvalidRegion);
|
||||
|
@ -456,9 +456,8 @@ MarkLayersHidden(Layer* aLayer, const IntRect& aClipRect,
|
||||
// content is opaque
|
||||
if ((aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE) &&
|
||||
(newFlags & ALLOW_OPAQUE)) {
|
||||
nsIntRegionRectIterator it(region);
|
||||
while (const IntRect* sr = it.Next()) {
|
||||
r = *sr;
|
||||
for (auto iter = region.RectIter(); !iter.Done(); iter.Next()) {
|
||||
r = iter.Get();
|
||||
TransformIntRect(r, transform, ToInsideIntRect);
|
||||
|
||||
r.IntersectRect(r, newClipRect);
|
||||
@ -623,10 +622,9 @@ BasicLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
|
||||
PaintLayer(mTarget, mRoot, aCallback, aCallbackData);
|
||||
if (!mRegionToClear.IsEmpty()) {
|
||||
nsIntRegionRectIterator iter(mRegionToClear);
|
||||
const IntRect *r;
|
||||
while ((r = iter.Next())) {
|
||||
mTarget->GetDrawTarget()->ClearRect(Rect(r->x, r->y, r->width, r->height));
|
||||
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));
|
||||
}
|
||||
}
|
||||
if (mWidget) {
|
||||
|
@ -53,10 +53,10 @@ X11DataTextureSourceBasic::Update(gfx::DataSourceSurface* aSurface,
|
||||
NS_ASSERTION(!aSrcOffset, "SrcOffset should not be used with linux OMTC basic");
|
||||
|
||||
if (aDestRegion) {
|
||||
nsIntRegionRectIterator iter(*aDestRegion);
|
||||
while (const IntRect* iterRect = iter.Next()) {
|
||||
IntRect srcRect(iterRect->x, iterRect->y, iterRect->width, iterRect->height);
|
||||
IntPoint dstPoint(iterRect->x, iterRect->y);
|
||||
for (auto iter = aDestRegion->RectIter(); !iter.Done(); iter.Next()) {
|
||||
const IntRect& rect = iter.Get();
|
||||
IntRect srcRect(rect.x, rect.y, rect.width, rect.height);
|
||||
IntPoint dstPoint(rect.x, rect.y);
|
||||
|
||||
// We're uploading regions to our buffer, so let's just copy contents over
|
||||
mBufferDrawTarget->CopySurface(aSurface, srcRect, dstPoint);
|
||||
|
Loading…
Reference in New Issue
Block a user