From c0ea2166b946daaad3b2b85b68c5570f9f7822d7 Mon Sep 17 00:00:00 2001 From: Andrew Osmond Date: Thu, 22 Feb 2018 12:11:00 -0500 Subject: Bug 1388020. r=nical, a=RyanVM --- gfx/tests/gtest/TestLayers.h | 16 ++++++++++++++++ gfx/tests/gtest/TestTextures.cpp | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'gfx/tests/gtest') diff --git a/gfx/tests/gtest/TestLayers.h b/gfx/tests/gtest/TestLayers.h index 18e351f77..fc6b750f1 100644 --- a/gfx/tests/gtest/TestLayers.h +++ b/gfx/tests/gtest/TestLayers.h @@ -8,6 +8,22 @@ #include "Layers.h" #include "nsTArray.h" +#include "mozilla/layers/ISurfaceAllocator.h" + +namespace mozilla { +namespace layers { + +class TestSurfaceAllocator final : public ISurfaceAllocator +{ +public: + TestSurfaceAllocator() {} + ~TestSurfaceAllocator() override {} + + bool IsSameProcess() const override { return true; } +}; + +} // layers +} // mozilla /* Create layer tree from a simple layer tree description syntax. * Each index is either the first letter of the layer type or diff --git a/gfx/tests/gtest/TestTextures.cpp b/gfx/tests/gtest/TestTextures.cpp index b4856ae6b..8f413cb3b 100644 --- a/gfx/tests/gtest/TestTextures.cpp +++ b/gfx/tests/gtest/TestTextures.cpp @@ -5,6 +5,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" +#include "TestLayers.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/Tools.h" @@ -147,7 +148,8 @@ void TestTextureClientSurface(TextureClient* texture, gfxImageSurface* surface) ASSERT_NE(descriptor.type(), SurfaceDescriptor::Tnull_t); // host deserialization - RefPtr host = CreateBackendIndependentTextureHost(descriptor, nullptr, + RefPtr deallocator = new TestSurfaceAllocator(); + RefPtr host = CreateBackendIndependentTextureHost(descriptor, deallocator, texture->GetFlags()); ASSERT_TRUE(host.get() != nullptr); @@ -191,7 +193,8 @@ void TestTextureClientYCbCr(TextureClient* client, PlanarYCbCrData& ycbcrData) { ASSERT_EQ(ycbcrDesc.stereoMode(), ycbcrData.mStereoMode); // host deserialization - RefPtr textureHost = CreateBackendIndependentTextureHost(descriptor, nullptr, + RefPtr deallocator = new TestSurfaceAllocator(); + RefPtr textureHost = CreateBackendIndependentTextureHost(descriptor, deallocator, client->GetFlags()); RefPtr host = static_cast(textureHost.get()); -- cgit v1.2.3