michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #pragma once michael@0: michael@0: #include "2D.h" michael@0: #include "TestBase.h" michael@0: michael@0: #define DT_WIDTH 500 michael@0: #define DT_HEIGHT 500 michael@0: michael@0: /* This general DrawTarget test class can be reimplemented by a child class michael@0: * with optional additional drawtarget-specific tests. And is intended to run michael@0: * on a 500x500 32 BPP drawtarget. michael@0: */ michael@0: class TestDrawTargetBase : public TestBase michael@0: { michael@0: public: michael@0: void Initialized(); michael@0: void FillCompletely(); michael@0: void FillRect(); michael@0: michael@0: protected: michael@0: TestDrawTargetBase(); michael@0: michael@0: void RefreshSnapshot(); michael@0: michael@0: void VerifyAllPixels(const mozilla::gfx::Color &aColor); michael@0: void VerifyPixel(const mozilla::gfx::IntPoint &aPoint, michael@0: mozilla::gfx::Color &aColor); michael@0: michael@0: uint32_t RGBAPixelFromColor(const mozilla::gfx::Color &aColor); michael@0: michael@0: mozilla::RefPtr mDT; michael@0: mozilla::RefPtr mDataSnapshot; michael@0: };