Bumping manifests a=b2g-bump
[gecko.git] / gfx / layers / MacIOSurfaceImage.h
blobb00e5e1fdeef3529d805955ab49627dbd0c3ccc0
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_MACIOSURFACEIMAGE_H
7 #define GFX_MACIOSURFACEIMAGE_H
9 #include "ImageContainer.h"
10 #include "mozilla/gfx/MacIOSurface.h"
11 #include "mozilla/gfx/Point.h"
12 #include "mozilla/layers/TextureClient.h"
14 namespace mozilla {
16 namespace layers {
18 class MacIOSurfaceImage : public Image {
19 public:
20 void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; }
21 MacIOSurface* GetSurface() { return mSurface; }
23 gfx::IntSize GetSize() MOZ_OVERRIDE {
24 return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
27 virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
29 virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
31 MacIOSurfaceImage() : Image(nullptr, ImageFormat::MAC_IOSURFACE) {}
33 private:
34 RefPtr<MacIOSurface> mSurface;
35 RefPtr<TextureClient> mTextureClient;
38 } // layers
39 } // mozilla
41 #endif // GFX_SHAREDTEXTUREIMAGE_H