From f56c8518c46bc68b314b6f77e37d294be1d228b4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 20 Jun 2017 01:17:16 -0700 Subject: [PATCH] Expose ContentTextureHost buffer properties. (bug 1365879 part 4, r=mattwoodrow) --- gfx/layers/composite/ContentHost.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gfx/layers/composite/ContentHost.h b/gfx/layers/composite/ContentHost.h index e3cce6356582..d94346827c20 100644 --- a/gfx/layers/composite/ContentHost.h +++ b/gfx/layers/composite/ContentHost.h @@ -63,6 +63,11 @@ public: // tiles are fading in. virtual void AddAnimationInvalidation(nsIntRegion& aRegion) { } + virtual gfx::IntRect GetBufferRect() { + MOZ_ASSERT_UNREACHABLE("Must be implemented in derived class"); + return gfx::IntRect(); + } + protected: explicit ContentHost(const TextureInfo& aTextureInfo) : CompositableHost(aTextureInfo) @@ -92,13 +97,19 @@ public: explicit ContentHostBase(const TextureInfo& aTextureInfo); virtual ~ContentHostBase(); -protected: + virtual gfx::IntRect GetBufferRect() override { return mBufferRect; } + virtual nsIntPoint GetOriginOffset() { return mBufferRect.TopLeft() - mBufferRotation; } + gfx::IntPoint GetBufferRotation() + { + return mBufferRotation.ToUnknownPoint(); + } +protected: gfx::IntRect mBufferRect; nsIntPoint mBufferRotation; bool mInitialised;