Hash :
03d132eb
        
        Author :
  
        
        Date :
2018-07-14T13:31:35
        
      
Support EGL_(WIDTH|HEIGHT) in eglSurfaceAttrib(), fixed resize Setting EGL_WIDTH or EGL_HEIGHT results in mFixedWidth and mFixedHeight changing their values. Whenever the swap chain is tested for needing a resize, surfaces with mFixedSize are treated as if they should be resized to mFixedWidth and mFixedHeight from their current size. This way fixed-size surfaces can be resized - it's enough to do a couple of eglSurfaceAttrib() calls and then either let ANGLE check surface for needing a resize in due course, or force that by calling eglWaitNative(). BUG=angleproject:2725 Change-Id: I2932d8ecd5a2f10500e4aa8583a169aa09bf01bb Reviewed-on: https://chromium-review.googlesource.com/1139055 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
Name
    ANGLE_window_fixed_size
Name Strings
    EGL_ANGLE_window_fixed_size
Contributors
    John Bauman
    Shannon Woods
    Geoff Lang
Contacts
    John Bauman, Google Inc. (jbauman 'at' google.com)
Status
    Complete
Version
    Version 5, July 23, 2018
Number
    EGL Extension #??
Dependencies
    This extension is written against the wording of the EGL 1.4
    Specification.
Overview
    This extension allows creating a window surface that does not resize
    automatically.
New Types
    None
New Procedures and Functions
    None
New Tokens
    Accepted by the <attribute> parameter of eglQuerySurface and by the
    <attrib_list> parameter of eglCreateWindowSurface:
    EGL_FIXED_SIZE_ANGLE        0x3201
Additions to Chapter 3 of the EGL 1.4 Specification:
    Modify the third paragraph of Section 3.5.1 (Creating On-Screen Rendering
    Surfaces)
    "<attrib_list> specifies a list of attributes for the window. The list has
    the same structure as described for eglChooseConfig.  Attributes that can
    be specified in <attrib_list> include EGL_RENDER_BUFFER,
    EGL_VG_COLORSPACE, EGL_VG_ALPHA_FORMAT, EGL_FIXED_SIZE_ANGLE, EGL_WIDTH,
    and EGL_HEIGHT."
    Add before the last paragraph of Section 3.5.1
    "EGL_FIXED_SIZE_ANGLE specifies whether the surface must be resized by the
    implementation when the native window is resized.  The default value is
    EGL_FALSE.  Its value can be EGL_TRUE, in which case the size must be
    specified when the window is created, or EGL_FALSE, in which case the size
    is taken from the native window. Its default value is EGL_FALSE.
    If the value of EGL_FIXED_SIZE_ANGLE is EGL_TRUE, the window surface's
    size in pixels is specified by the EGL_WIDTH and EGL_HEIGHT attributes.
    If its value is EGL_FALSE, then the values of EGL_WIDTH and EGL_HEIGHT
    are ignored and the window surface must be resized by the implementation
    subsequent to the native window being resized, and prior to copying its
    contents to the native window (e.g. in eglSwapBuffers, as described in
    section 3.9.1.1). The default values for EGL_WIDTH and EGL_HEIGHT are zero.
    If the value specified for either of EGL_WIDTH or EGL_HEIGHT is less than
    zero then an EGL_BAD_PARAMETER error is generated."
    Add the following entry to Table 3.5
    (Queryable surface attributes and types)
    Attribute            Type    Description
    -------------------- ------- ---------------------------------------------
    EGL_FIXED_SIZE_ANGLE boolean Surface will not be resized with a native
                                 window
    Replace the last paragraph on page 37 in Section 3.5.6 (Surface Attributes)
    "Querying EGL_WIDTH and EGL_HEIGHT returns respectively the width and
    height, in pixels, of the surface. For a pixmap surface or window surface
    with EGL_FIXED_SIZE_ANGLE set to EGL_FALSE, these values are initially
    equal to the width and height of the native window or pixmap with respect
    to which the surface was created. If the native window is resized and the
    corresponding window surface is not fixed size, the corresponding window
    surface will eventually be resized by the implementation to match (as
    discussed in section 3.9.1). If there is a discrepancy because EGL has not
    yet resized the window surface, the size returned by eglQuerySurface will
    always be that of the EGL surface, not the corresponding native window."
    Alter the beginning of the first paragraph of Section 3.5.6 (Surface
    Attributes)
    "The specified attribute of surface is set to value. Attributes that can
    be specified are EGL_MIPMAP_LEVEL, EGL_MULTISAMPLE_RESOLVE,
    EGL_SWAP_BEHAVIOR, EGL_WIDTH, and EGL_HEIGHT."
    Add the following paragraph to Section 3.5.6 (Surface Attributes)
    "If attribute is EGL_WIDTH or EGL_HEIGHT then the value specifies the new
    surface width or height respectively. The new width and height are not
    guarenteed to be applied until the next call to eglSwapBuffers or
    eglWaitNative. If the surface does not have EGL_FIXED_SIZE_ANGLE set then
    an EGL_BAD_MATCH error is generated."
    Add the following paragraph to Section 3.5.6 (Surface Attributes)
    "Querying EGL_FIXED_SIZE_ANGLE returns EGL_FALSE if the surface will be
    resized to match a native window, and EGL_TRUE if the surface cannot be
    resized."
    Alter the beginning of the first paragraph of Section 3.9.1.1 (Native
    Window Resizing)
    "If the surface has EGL_FIXED_SIZE_ANGLE set and EGL_WIDTH or EGL_HEIGHT
    have changed or the surface does not have EGL_FIXED_SIZE_ANGLE set and its
    corresponding native window has been resized prior to the swap, surface
    must be resized to match".
Issues
    1. Should there be a way to resize a window surface that had its size
    specified initially.
    RESOLVED: No. Surfaces that have their sizes specified initially must have
    EGL_FIXED_SIZE_ANGLE set and can never be resized.
    RESOLVED(rev 5): Fixed size surfaces can now be resized by setting
    EGL_WIDTH and EGL_HEIGHT surface attributes. This is the best way to give
    users explicit control of the size of window surfaces without re-creating
    them on each resize.
Revision History
    Version 5, 2018/07/23 - Allow reizing fixed size surfaces.
    Version 4, 2014/02/24 - formatting changes.
    Version 3, 2014/02/12 - ignore EGL_WIDTH and EGL_HEIGHT if
    EGL_FIXED_SIZE_ANGLE is EGL_FALSE
    Version 2, 2014/02/07 - rename to EGL_ANGLE_window_fixed_size, and add an
    EGL_FIXED_SIZE_ANGLE token.
    Version 1, 2014/02/05 - first draft.