michael@0: /* -*- Mode: C++; tab-width: 2; 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: #ifndef MOZILLA_SVGCONTEXT_H_ michael@0: #define MOZILLA_SVGCONTEXT_H_ michael@0: michael@0: #include "SVGPreserveAspectRatio.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: // SVG image-specific rendering context. For imgIContainer::Draw. michael@0: // Used to pass information about overridden attributes from an SVG michael@0: // element to the image's internal SVG document when it's drawn. michael@0: class SVGImageContext michael@0: { michael@0: public: michael@0: SVGImageContext() { } michael@0: michael@0: SVGImageContext(SVGPreserveAspectRatio aPreserveAspectRatio) michael@0: : mPreserveAspectRatio(aPreserveAspectRatio) michael@0: { } michael@0: michael@0: const SVGPreserveAspectRatio& GetPreserveAspectRatio() const { michael@0: return mPreserveAspectRatio; michael@0: } michael@0: michael@0: bool operator==(const SVGImageContext& aOther) const { michael@0: return mPreserveAspectRatio == aOther.mPreserveAspectRatio; michael@0: } michael@0: michael@0: bool operator!=(const SVGImageContext& aOther) const { michael@0: return !(*this == aOther); michael@0: } michael@0: michael@0: uint32_t Hash() const { michael@0: return mPreserveAspectRatio.Hash(); michael@0: } michael@0: michael@0: private: michael@0: SVGPreserveAspectRatio mPreserveAspectRatio; michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // MOZILLA_SVGCONTEXT_H_