Edit

kc3-lang/angle/src/libANGLE/Image.h

Branch :

  • Show log

    Commit

  • Author : Corentin Wallez
    Date : 2015-08-07 14:39:22
    Hash : 51706eae
    Message : Make FramebufferAttachmentObject not refcountable Re-land with a fix for an unitialized variable Instead the refcount is done via callbacks. This allows Surface to ignore this refcounting which will be useful in a follow-up CL. BUG=angleproject:891 Change-Id: I1925ccaa4ce7b502b33088660d31c404b8313cb5 Reviewed-on: https://chromium-review.googlesource.com/293712 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>

  • src/libANGLE/Image.h
  • //
    // 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_