gfx/layers/MacIOSurfaceImage.h

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:3629ef85cdf3
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/. */
5
6 #ifndef GFX_MACIOSURFACEIMAGE_H
7 #define GFX_MACIOSURFACEIMAGE_H
8
9 #include "ImageContainer.h"
10 #include "mozilla/gfx/MacIOSurface.h"
11 #include "mozilla/gfx/Point.h"
12 #include "mozilla/layers/TextureClient.h"
13
14 namespace mozilla {
15
16 namespace layers {
17
18 class MacIOSurfaceImage : public Image,
19 public ISharedImage {
20 public:
21 void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; }
22 MacIOSurface* GetSurface() { return mSurface; }
23
24 gfx::IntSize GetSize() {
25 return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
26 }
27
28 virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
29
30 virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
31
32 virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
33 virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
34
35 MacIOSurfaceImage() : Image(nullptr, ImageFormat::MAC_IOSURFACE) {}
36
37 private:
38 RefPtr<MacIOSurface> mSurface;
39 RefPtr<TextureClient> mTextureClient;
40 };
41
42 } // layers
43 } // mozilla
44
45 #endif // GFX_SHAREDTEXTUREIMAGE_H

mercurial