Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include <stdint.h> // for uint8_t, uint32_t |
michael@0 | 7 | #include "ImageContainer.h" // for PlanarYCbCrImage, etc |
michael@0 | 8 | #include "mozilla/Attributes.h" // for MOZ_OVERRIDE |
michael@0 | 9 | #include "mozilla/RefPtr.h" // for RefPtr |
michael@0 | 10 | #include "mozilla/ipc/Shmem.h" // for Shmem |
michael@0 | 11 | #include "nsCOMPtr.h" // for already_AddRefed |
michael@0 | 12 | #include "nsDebug.h" // for NS_WARNING |
michael@0 | 13 | #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR |
michael@0 | 14 | |
michael@0 | 15 | #ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H |
michael@0 | 16 | #define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H |
michael@0 | 17 | |
michael@0 | 18 | namespace mozilla { |
michael@0 | 19 | namespace layers { |
michael@0 | 20 | |
michael@0 | 21 | class BufferTextureClient; |
michael@0 | 22 | class ImageClient; |
michael@0 | 23 | class ISurfaceAllocator; |
michael@0 | 24 | class SurfaceDescriptor; |
michael@0 | 25 | class TextureClient; |
michael@0 | 26 | |
michael@0 | 27 | class SharedPlanarYCbCrImage : public PlanarYCbCrImage |
michael@0 | 28 | , public ISharedImage |
michael@0 | 29 | { |
michael@0 | 30 | public: |
michael@0 | 31 | SharedPlanarYCbCrImage(ImageClient* aCompositable); |
michael@0 | 32 | ~SharedPlanarYCbCrImage(); |
michael@0 | 33 | |
michael@0 | 34 | virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; } |
michael@0 | 35 | virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE; |
michael@0 | 36 | virtual uint8_t* GetBuffer() MOZ_OVERRIDE; |
michael@0 | 37 | |
michael@0 | 38 | virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE; |
michael@0 | 39 | virtual void SetData(const PlanarYCbCrData& aData) MOZ_OVERRIDE; |
michael@0 | 40 | virtual void SetDataNoCopy(const Data &aData) MOZ_OVERRIDE; |
michael@0 | 41 | |
michael@0 | 42 | virtual bool Allocate(PlanarYCbCrData& aData); |
michael@0 | 43 | virtual uint8_t* AllocateBuffer(uint32_t aSize) MOZ_OVERRIDE; |
michael@0 | 44 | // needs to be overriden because the parent class sets mBuffer which we |
michael@0 | 45 | // do not want to happen. |
michael@0 | 46 | virtual uint8_t* AllocateAndGetNewBuffer(uint32_t aSize) MOZ_OVERRIDE; |
michael@0 | 47 | |
michael@0 | 48 | virtual bool IsValid() MOZ_OVERRIDE; |
michael@0 | 49 | |
michael@0 | 50 | virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE |
michael@0 | 51 | { |
michael@0 | 52 | return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE; |
michael@0 | 56 | |
michael@0 | 57 | private: |
michael@0 | 58 | RefPtr<BufferTextureClient> mTextureClient; |
michael@0 | 59 | RefPtr<ImageClient> mCompositable; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | } // namespace |
michael@0 | 63 | } // namespace |
michael@0 | 64 | |
michael@0 | 65 | #endif |