mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bde06b3dca
http://hg.mozilla.org/users/bschouten_mozilla.com/tiling/summary This work is mainly porting tiled layers to new textures, implementing double-buffered tiles and implementing a texture client pool, to be used by tiled content clients. Any questions regarding this patch should go to: Bas Schouten <bschouten@mozilla.com> Chris Lord <clord@mozilla.com> Nicolas Silva <nsilva@mozilla.com> In their absence questions can be directed to: Jeff Muizelaar <jmuizelaar@mozilla.com> Benoit Girard <bgirard@mozilla.com>
70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
// * This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef MOZILLA_GFX_TEXTURECLIENT_X11_H
|
|
#define MOZILLA_GFX_TEXTURECLIENT_X11_H
|
|
|
|
#include "mozilla/layers/TextureClient.h"
|
|
#include "ISurfaceAllocator.h" // For IsSurfaceDescriptorValid
|
|
#include "mozilla/layers/ShadowLayerUtilsX11.h"
|
|
|
|
namespace mozilla {
|
|
namespace layers {
|
|
|
|
/**
|
|
* A TextureClient implementation based on Xlib.
|
|
*/
|
|
class TextureClientX11
|
|
: public TextureClient,
|
|
public TextureClientSurface,
|
|
public TextureClientDrawTarget
|
|
{
|
|
public:
|
|
TextureClientX11(gfx::SurfaceFormat format, TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
|
|
~TextureClientX11();
|
|
|
|
// TextureClient
|
|
|
|
TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
|
|
TextureClientDrawTarget* AsTextureClientDrawTarget() MOZ_OVERRIDE { return this; }
|
|
|
|
bool IsAllocated() const MOZ_OVERRIDE;
|
|
bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
|
TextureClientData* DropTextureData() MOZ_OVERRIDE;
|
|
gfx::IntSize GetSize() const {
|
|
return mSize;
|
|
}
|
|
|
|
bool Lock(OpenMode aMode) MOZ_OVERRIDE;
|
|
void Unlock() MOZ_OVERRIDE;
|
|
bool IsLocked() const MOZ_OVERRIDE { return mLocked; }
|
|
|
|
// TextureClientSurface
|
|
|
|
bool UpdateSurface(gfxASurface* aSurface) MOZ_OVERRIDE;
|
|
already_AddRefed<gfxASurface> GetAsSurface() MOZ_OVERRIDE;
|
|
bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags flags) MOZ_OVERRIDE;
|
|
|
|
// TextureClientDrawTarget
|
|
|
|
TemporaryRef<gfx::DrawTarget> GetAsDrawTarget() MOZ_OVERRIDE;
|
|
gfx::SurfaceFormat GetFormat() const {
|
|
return mFormat;
|
|
}
|
|
|
|
virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; }
|
|
|
|
private:
|
|
gfx::SurfaceFormat mFormat;
|
|
gfx::IntSize mSize;
|
|
RefPtr<gfxXlibSurface> mSurface;
|
|
bool mLocked;
|
|
};
|
|
|
|
} // namespace layers
|
|
} // namespace mozilla
|
|
|
|
#endif
|