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"
18 class MacIOSurfaceImage
: public Image
{
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
) {}
34 RefPtr
<MacIOSurface
> mSurface
;
35 RefPtr
<TextureClient
> mTextureClient
;
41 #endif // GFX_SHAREDTEXTUREIMAGE_H