|
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 MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H |
|
7 #define MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H |
|
8 |
|
9 #include "mozilla/layers/TextureClientOGL.h" |
|
10 |
|
11 class MacIOSurface; |
|
12 |
|
13 namespace mozilla { |
|
14 namespace layers { |
|
15 |
|
16 class MacIOSurfaceTextureClientOGL : public TextureClient |
|
17 { |
|
18 public: |
|
19 MacIOSurfaceTextureClientOGL(TextureFlags aFlags); |
|
20 |
|
21 virtual ~MacIOSurfaceTextureClientOGL(); |
|
22 |
|
23 void InitWith(MacIOSurface* aSurface); |
|
24 |
|
25 virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE; |
|
26 |
|
27 virtual void Unlock() MOZ_OVERRIDE; |
|
28 |
|
29 virtual bool IsLocked() const MOZ_OVERRIDE; |
|
30 |
|
31 virtual bool IsAllocated() const MOZ_OVERRIDE { return !!mSurface; } |
|
32 |
|
33 virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE; |
|
34 |
|
35 virtual gfx::IntSize GetSize() const; |
|
36 |
|
37 virtual TextureClientData* DropTextureData() MOZ_OVERRIDE; |
|
38 |
|
39 virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; } |
|
40 |
|
41 protected: |
|
42 RefPtr<MacIOSurface> mSurface; |
|
43 bool mIsLocked; |
|
44 }; |
|
45 |
|
46 } |
|
47 } |
|
48 |
|
49 #endif // MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H |