summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libANGLE/Image.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /gfx/angle/src/libANGLE/Image.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/angle/src/libANGLE/Image.h')
-rwxr-xr-xgfx/angle/src/libANGLE/Image.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/gfx/angle/src/libANGLE/Image.h b/gfx/angle/src/libANGLE/Image.h
new file mode 100755
index 000000000..a579beab2
--- /dev/null
+++ b/gfx/angle/src/libANGLE/Image.h
@@ -0,0 +1,92 @@
+//
+// 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 "libANGLE/formatutils.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();
+
+ const gl::Format &getFormat() 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;
+
+ gl::Format mFormat;
+ size_t mWidth;
+ size_t mHeight;
+ size_t mSamples;
+
+ BindingPointer<ImageSibling> mSource;
+ std::set<ImageSibling *> mTargets;
+};
+}
+
+#endif // LIBANGLE_IMAGE_H_