gfx/layers/ipc/SharedPlanarYCbCrImage.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include <stdint.h>                     // for uint8_t, uint32_t
    1.10 +#include "ImageContainer.h"             // for PlanarYCbCrImage, etc
    1.11 +#include "mozilla/Attributes.h"         // for MOZ_OVERRIDE
    1.12 +#include "mozilla/RefPtr.h"             // for RefPtr
    1.13 +#include "mozilla/ipc/Shmem.h"          // for Shmem
    1.14 +#include "nsCOMPtr.h"                   // for already_AddRefed
    1.15 +#include "nsDebug.h"                    // for NS_WARNING
    1.16 +#include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR
    1.17 +
    1.18 +#ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
    1.19 +#define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
    1.20 +
    1.21 +namespace mozilla {
    1.22 +namespace layers {
    1.23 +
    1.24 +class BufferTextureClient;
    1.25 +class ImageClient;
    1.26 +class ISurfaceAllocator;
    1.27 +class SurfaceDescriptor;
    1.28 +class TextureClient;
    1.29 +
    1.30 +class SharedPlanarYCbCrImage : public PlanarYCbCrImage
    1.31 +                             , public ISharedImage
    1.32 +{
    1.33 +public:
    1.34 +  SharedPlanarYCbCrImage(ImageClient* aCompositable);
    1.35 +  ~SharedPlanarYCbCrImage();
    1.36 +
    1.37 +  virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
    1.38 +  virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
    1.39 +  virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
    1.40 +
    1.41 +  virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
    1.42 +  virtual void SetData(const PlanarYCbCrData& aData) MOZ_OVERRIDE;
    1.43 +  virtual void SetDataNoCopy(const Data &aData) MOZ_OVERRIDE;
    1.44 +
    1.45 +  virtual bool Allocate(PlanarYCbCrData& aData);
    1.46 +  virtual uint8_t* AllocateBuffer(uint32_t aSize) MOZ_OVERRIDE;
    1.47 +  // needs to be overriden because the parent class sets mBuffer which we
    1.48 +  // do not want to happen.
    1.49 +  virtual uint8_t* AllocateAndGetNewBuffer(uint32_t aSize) MOZ_OVERRIDE;
    1.50 +
    1.51 +  virtual bool IsValid() MOZ_OVERRIDE;
    1.52 +
    1.53 +  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
    1.54 +  {
    1.55 +    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
    1.56 +  }
    1.57 +
    1.58 +  virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
    1.59 +
    1.60 +private:
    1.61 +  RefPtr<BufferTextureClient> mTextureClient;
    1.62 +  RefPtr<ImageClient> mCompositable;
    1.63 +};
    1.64 +
    1.65 +} // namespace
    1.66 +} // namespace
    1.67 +
    1.68 +#endif

mercurial