Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Backed out changeset 00ff83d23238 (bug 1480608) for build bustages on…
Browse files Browse the repository at this point in the history
… Moz2DImageRenderer.cpp. CLOSED TREE
  • Loading branch information
nbeleuzu committed Aug 7, 2018
1 parent a13d0c1 commit 7219793
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
4 changes: 0 additions & 4 deletions gfx/2d/RectAbsolute.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ struct BaseRectAbsolute {
return result;
}

bool IsEmpty() const {
return right <= left || bottom <= top;
}

bool IsEqualEdges(const Sub& aOther) const
{
return left == aOther.left && top == aOther.top &&
Expand Down
26 changes: 4 additions & 22 deletions gfx/webrender_bindings/Moz2DImageRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "mozilla/Mutex.h"
#include "mozilla/Range.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/RectAbsolute.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/gfx/RecordedEvent.h"
#include "mozilla/layers/WebRenderDrawEventRecorder.h"
Expand Down Expand Up @@ -268,15 +267,9 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
dt = gfx::Factory::CreateTiledDrawTarget(tileset);
}

auto bounds = gfx::IntRect(origin, aSize);

if (aDirtyRect) {
Rect dirty(aDirtyRect->origin.x, aDirtyRect->origin.y, aDirtyRect->size.width, aDirtyRect->size.height);
dt->PushClipRect(dirty);
bounds = bounds.Intersect(IntRect(aDirtyRect->origin.x,
aDirtyRect->origin.y,
aDirtyRect->size.width,
aDirtyRect->size.height));
}

struct Reader {
Expand All @@ -301,15 +294,9 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
return ret;
}

IntRectAbsolute ReadBounds() {
MOZ_RELEASE_ASSERT(pos + sizeof(int32_t) * 4 <= len);
int32_t x1, y1, x2, y2;
memcpy(&x1, buf + pos + 0 * sizeof(int32_t), sizeof(x1));
memcpy(&y1, buf + pos + 1 * sizeof(int32_t), sizeof(y1));
memcpy(&x2, buf + pos + 2 * sizeof(int32_t), sizeof(x2));
memcpy(&y2, buf + pos + 3 * sizeof(int32_t), sizeof(y2));
pos += sizeof(int32_t) * 4;
return IntRectAbsolute(x1, y1, x2, y2);
void SkipBounds() {
MOZ_RELEASE_ASSERT(pos + sizeof(int) * 4 <= len);
pos += sizeof(int) * 4;
}

};
Expand All @@ -319,15 +306,10 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,

bool ret;
size_t offset = 0;
auto absBounds = IntRectAbsolute::FromRect(bounds);
while (reader.pos < reader.len) {
size_t end = reader.ReadSize();
size_t extra_end = reader.ReadSize();
auto combinedBounds = absBounds.Intersect(reader.ReadBounds());
if (combinedBounds.IsEmpty()) {
offset = extra_end;
continue;
}
reader.SkipBounds();

layers::WebRenderTranslator translator(dt);

Expand Down

0 comments on commit 7219793

Please sign in to comment.