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: #ifndef GFX_TextRenderer_H michael@0: #define GFX_TextRenderer_H michael@0: michael@0: #include "mozilla/gfx/2D.h" michael@0: #include "nsISupportsImpl.h" michael@0: #include michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: class Compositor; michael@0: michael@0: class TextRenderer michael@0: { michael@0: public: michael@0: NS_INLINE_DECL_REFCOUNTING(TextRenderer) michael@0: michael@0: TextRenderer(Compositor *aCompositor) michael@0: : mCompositor(aCompositor) michael@0: { michael@0: } michael@0: michael@0: ~TextRenderer(); michael@0: michael@0: void RenderText(const std::string& aText, const gfx::IntPoint& aOrigin, michael@0: const gfx::Matrix4x4& aTransform, uint32_t aTextSize, michael@0: uint32_t aTargetPixelWidth); michael@0: michael@0: gfx::DataSourceSurface::MappedSurface& GetSurfaceMap() { return mMap; } michael@0: michael@0: private: michael@0: michael@0: void EnsureInitialized(); michael@0: michael@0: RefPtr mCompositor; michael@0: RefPtr mGlyphBitmaps; michael@0: gfx::DataSourceSurface::MappedSurface mMap; michael@0: }; michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif