author | Kartikaya Gupta <kgupta@mozilla.com> |
Mon, 22 Sep 2014 11:52:21 -0400 | |
changeset 206537 | a1823a5faa109029063772aedb6e592786a97771 |
parent 206536 | b1d627e9bf5ed5cbff8a63becfb2b0b75eb7d38a |
child 206538 | a02351de6e5b954301183771b3b5e419ed891767 |
push id | 27529 |
push user | ryanvm@gmail.com |
push date | Mon, 22 Sep 2014 19:49:52 +0000 |
treeherder | mozilla-central@f4037194394e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | me |
bugs | 1023473 |
milestone | 35.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -997,56 +997,56 @@ void PadDrawTargetOutFromRegion(RefPtr<D struct LockedBits { uint8_t *data; IntSize size; int32_t stride; SurfaceFormat format; static int clamp(int x, int min, int max) { if (x < min) - x = min; + x = min; if (x > max) - x = max; + x = max; return x; } static void visitor(void *closure, VisitSide side, int x1, int y1, int x2, int y2) { LockedBits *lb = static_cast<LockedBits*>(closure); uint8_t *bitmap = lb->data; const int bpp = gfx::BytesPerPixel(lb->format); const int stride = lb->stride; const int width = lb->size.width; const int height = lb->size.height; if (side == VisitSide::TOP) { - if (y1 > 0) { - x1 = clamp(x1, 0, width - 1); - x2 = clamp(x2, 0, width - 1); - memcpy(&bitmap[x1*bpp + (y1-1) * stride], &bitmap[x1*bpp + y1 * stride], (x2 - x1) * bpp); - } + if (y1 > 0) { + x1 = clamp(x1, 0, width - 1); + x2 = clamp(x2, 0, width - 1); + memcpy(&bitmap[x1*bpp + (y1-1) * stride], &bitmap[x1*bpp + y1 * stride], (x2 - x1) * bpp); + } } else if (side == VisitSide::BOTTOM) { - if (y1 < height) { - x1 = clamp(x1, 0, width - 1); - x2 = clamp(x2, 0, width - 1); - memcpy(&bitmap[x1*bpp + y1 * stride], &bitmap[x1*bpp + (y1-1) * stride], (x2 - x1) * bpp); - } + if (y1 < height) { + x1 = clamp(x1, 0, width - 1); + x2 = clamp(x2, 0, width - 1); + memcpy(&bitmap[x1*bpp + y1 * stride], &bitmap[x1*bpp + (y1-1) * stride], (x2 - x1) * bpp); + } } else if (side == VisitSide::LEFT) { - if (x1 > 0) { - while (y1 != y2) { - memcpy(&bitmap[(x1-1)*bpp + y1 * stride], &bitmap[x1*bpp + y1*stride], bpp); - y1++; - } - } + if (x1 > 0) { + while (y1 != y2) { + memcpy(&bitmap[(x1-1)*bpp + y1 * stride], &bitmap[x1*bpp + y1*stride], bpp); + y1++; + } + } } else if (side == VisitSide::RIGHT) { - if (x1 < width) { - while (y1 != y2) { - memcpy(&bitmap[x1*bpp + y1 * stride], &bitmap[(x1-1)*bpp + y1*stride], bpp); - y1++; - } - } + if (x1 < width) { + while (y1 != y2) { + memcpy(&bitmap[x1*bpp + y1 * stride], &bitmap[(x1-1)*bpp + y1*stride], bpp); + y1++; + } + } } } } lb; if (drawTarget->LockBits(&lb.data, &lb.size, &lb.stride, &lb.format)) { // we can only pad software targets so if we can't lock the bits don't pad region.VisitEdges(lb.visitor, &lb); @@ -1261,28 +1261,28 @@ ClientTiledLayerBuffer::ValidateTile(Til aTile.mInvalidFront.Or(aTile.mInvalidFront, nsIntRect(copyTarget.x, copyTarget.y, copyRect.width, copyRect.height)); } // only worry about padding when not doing low-res // because it simplifies the math and the artifacts // won't be noticable if (mResolution == 1) { nsIntRect unscaledTile = nsIntRect(aTileOrigin.x, - aTileOrigin.y, - GetTileSize().width, - GetTileSize().height); + aTileOrigin.y, + GetTileSize().width, + GetTileSize().height); nsIntRegion tileValidRegion = GetValidRegion(); tileValidRegion.Or(tileValidRegion, aDirtyRegion); // We only need to pad out if the tile has area that's not valid if (!tileValidRegion.Contains(unscaledTile)) { - tileValidRegion = tileValidRegion.Intersect(unscaledTile); - // translate the region into tile space and pad - tileValidRegion.MoveBy(-nsIntPoint(unscaledTile.x, unscaledTile.y)); - PadDrawTargetOutFromRegion(drawTarget, tileValidRegion); + tileValidRegion = tileValidRegion.Intersect(unscaledTile); + // translate the region into tile space and pad + tileValidRegion.MoveBy(-nsIntPoint(unscaledTile.x, unscaledTile.y)); + PadDrawTargetOutFromRegion(drawTarget, tileValidRegion); } } // The new buffer is now validated, remove the dirty region from it. aTile.mInvalidBack.Sub(nsIntRect(0, 0, GetTileSize().width, GetTileSize().height), offsetScaledDirtyRegion); } else { // Area of the full tile...