diff options
author | Oliver Wolff <oliver.wolff@theqtcompany.com> | 2016-03-24 12:38:18 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2016-04-25 05:57:38 +0000 |
commit | e12ba07322cd61c5cf50c25ed8d1f08f6b1ff879 (patch) | |
tree | d31a44c9f123ed764a00eff7b4fff656a07d54ab /src/3rdparty/angle/src/libANGLE/Image.h | |
parent | d3dcc6f610b97be7cbfbb0a65988e5940568c825 (diff) | |
download | qtbase-e12ba07322cd61c5cf50c25ed8d1f08f6b1ff879.tar.gz |
Update ANGLE to chromium/2651
Change-Id: I1cd32b780b1a0b913fab870e155ae1f4f9ac40d7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/Image.h')
-rw-r--r-- | src/3rdparty/angle/src/libANGLE/Image.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/Image.h b/src/3rdparty/angle/src/libANGLE/Image.h new file mode 100644 index 0000000000..26c9df914c --- /dev/null +++ b/src/3rdparty/angle/src/libANGLE/Image.h @@ -0,0 +1,91 @@ +// +// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +// Image.h: Defines the egl::Image class representing the EGLimage object. + +#ifndef LIBANGLE_IMAGE_H_ +#define LIBANGLE_IMAGE_H_ + +#include "common/angleutils.h" +#include "libANGLE/AttributeMap.h" +#include "libANGLE/Error.h" +#include "libANGLE/RefCountObject.h" + +#include <set> + +namespace rx +{ +class ImageImpl; +} + +namespace egl +{ +class Image; + +class ImageSibling : public RefCountObject +{ + public: + ImageSibling(GLuint id); + virtual ~ImageSibling(); + + protected: + // Set the image target of this sibling + void setTargetImage(egl::Image *imageTarget); + + // Orphan all EGL image sources and targets + gl::Error orphanImages(); + + private: + friend class Image; + + // Called from Image only to add a new source image + void addImageSource(egl::Image *imageSource); + + // Called from Image only to remove a source image when the Image is being deleted + void removeImageSource(egl::Image *imageSource); + + std::set<Image *> mSourcesOf; + BindingPointer<Image> mTargetOf; +}; + +class Image final : public RefCountObject +{ + public: + Image(rx::ImageImpl *impl, EGLenum target, ImageSibling *buffer, const AttributeMap &attribs); + ~Image(); + + GLenum getInternalFormat() const; + size_t getWidth() const; + size_t getHeight() const; + size_t getSamples() const; + + rx::ImageImpl *getImplementation(); + const rx::ImageImpl *getImplementation() const; + + private: + friend class ImageSibling; + + // Called from ImageSibling only notify the image that a new target sibling exists for state + // tracking. + void addTargetSibling(ImageSibling *sibling); + + // Called from ImageSibling only to notify the image that a sibling (source or target) has + // been respecified and state tracking should be updated. + gl::Error orphanSibling(ImageSibling *sibling); + + rx::ImageImpl *mImplementation; + + GLenum mInternalFormat; + size_t mWidth; + size_t mHeight; + size_t mSamples; + + BindingPointer<ImageSibling> mSource; + std::set<ImageSibling *> mTargets; +}; +} + +#endif // LIBANGLE_IMAGE_H_ |