gfx/layers/MacIOSurfaceImage.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/. */
     6 #ifndef GFX_MACIOSURFACEIMAGE_H
     7 #define GFX_MACIOSURFACEIMAGE_H
     9 #include "ImageContainer.h"
    10 #include "mozilla/gfx/MacIOSurface.h"
    11 #include "mozilla/gfx/Point.h"
    12 #include "mozilla/layers/TextureClient.h"
    14 namespace mozilla {
    16 namespace layers {
    18 class MacIOSurfaceImage : public Image,
    19                           public ISharedImage {
    20 public:
    21   void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; }
    22   MacIOSurface* GetSurface() { return mSurface; }
    24   gfx::IntSize GetSize() {
    25     return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
    26   }
    28   virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
    30   virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
    32   virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
    33   virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
    35   MacIOSurfaceImage() : Image(nullptr, ImageFormat::MAC_IOSURFACE) {}
    37 private:
    38   RefPtr<MacIOSurface> mSurface;
    39   RefPtr<TextureClient> mTextureClient;
    40 };
    42 } // layers
    43 } // mozilla
    45 #endif // GFX_SHAREDTEXTUREIMAGE_H

mercurial