From 72197932145338764479f4755d18acbec72a94a7 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Wed, 8 Aug 2018 01:48:46 +0300 Subject: [PATCH] Backed out changeset 00ff83d23238 (bug 1480608) for build bustages on Moz2DImageRenderer.cpp. CLOSED TREE --- gfx/2d/RectAbsolute.h | 4 --- gfx/webrender_bindings/Moz2DImageRenderer.cpp | 26 +++---------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/gfx/2d/RectAbsolute.h b/gfx/2d/RectAbsolute.h index 90c9be7a97a7..ba0166b73ffc 100644 --- a/gfx/2d/RectAbsolute.h +++ b/gfx/2d/RectAbsolute.h @@ -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 && diff --git a/gfx/webrender_bindings/Moz2DImageRenderer.cpp b/gfx/webrender_bindings/Moz2DImageRenderer.cpp index 65a09b46445d..05f81e968fbd 100644 --- a/gfx/webrender_bindings/Moz2DImageRenderer.cpp +++ b/gfx/webrender_bindings/Moz2DImageRenderer.cpp @@ -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" @@ -268,15 +267,9 @@ static bool Moz2DRenderCallback(const Range 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 { @@ -301,15 +294,9 @@ static bool Moz2DRenderCallback(const Range 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; } }; @@ -319,15 +306,10 @@ static bool Moz2DRenderCallback(const Range 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);