Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / gfx / layers / TextureWrapperImage.h
blob8da62626d055e47aef306bb12818bfb3bfa78c8d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_LAYERS_TEXTUREWRAPPINGIMAGE_H_
8 #define GFX_LAYERS_TEXTUREWRAPPINGIMAGE_H_
10 #include "mozilla/RefPtr.h"
11 #include "ImageContainer.h"
12 #include "mozilla/layers/TextureClient.h"
14 namespace mozilla {
15 namespace layers {
17 // Wraps a TextureClient into an Image. This may only be used on the main
18 // thread, and only with TextureClients that support BorrowDrawTarget().
19 class TextureWrapperImage final : public Image {
20 public:
21 TextureWrapperImage(TextureClient* aClient, const gfx::IntRect& aPictureRect);
22 virtual ~TextureWrapperImage();
24 gfx::IntSize GetSize() const override;
25 gfx::IntRect GetPictureRect() const override;
26 already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
27 TextureClient* GetTextureClient(KnowsCompositor* aKnowsCompositor) override;
29 private:
30 gfx::IntRect mPictureRect;
31 RefPtr<TextureClient> mTextureClient;
34 } // namespace layers
35 } // namespace mozilla
37 #endif // GFX_LAYERS_TEXTUREWRAPPINGIMAGE_H_