util/OSWindow.cpp


Log

Author Commit Date CI Message
Tom Sepez 3d8dff0a 2025-08-26T20:23:21 Suppress unsafe buffers on a file-by-file basis in util/ Bug: b/436880895 Change-Id: I299247e38853bb16afd466e3f6521342c0a2b0f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6891980 Auto-Submit: Tom Sepez <tsepez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Sungyong Choi 7d6aa630 2025-08-13T15:50:24 Reland: Rename enums to fix GCC -Wchanges-meaning error This is a reland of commit dc24ecca9ed920c0269e9d62dfcac4b3f3e5a4d4 Original change's description: > Renamed enums Key and MouseButton to enum class KeyType and > MouseButtonType to avoid name conflicts with union members in > Event.h on GCC, and to follow the ANGLE style guide preference > for scoped enums. > > BUG: angleproject:438226513 > Change-Id: I8892b438b3b05a3ce4e14f8c0769b81722688da8 > Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6845484 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> BUG: angleproject:438226513 Change-Id: Ifc1a7bad661881a1a71bd5380fe431270bc68686 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6874206 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov ccbc9e9b 2025-08-20T05:28:12 Revert "Rename enums to fix GCC -Wchanges-meaning error" This reverts commit dc24ecca9ed920c0269e9d62dfcac4b3f3e5a4d4. Reason for revert: breaks ios-simulator build when rolled to Chromium https://chromium-review.googlesource.com/c/chromium/src/+/6863632 https://ci.chromium.org/ui/p/chromium/builders/try/ios-simulator/2446924/overview [10968/78005] OBJCXX obj/third_party/angle/util/angle_util_static/IOSWindow.o sdk/xcode_links/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:17:38: error: reference to 'KeyType' is ambiguous 17 | - (nullable ObjectType)objectForKey:(KeyType)aKey; BUG: angleproject:438226513 Original change's description: > Rename enums to fix GCC -Wchanges-meaning error > > Renamed enums Key and MouseButton to enum class KeyType and > MouseButtonType to avoid name conflicts with union members in > Event.h on GCC, and to follow the ANGLE style guide preference > for scoped enums. > > BUG: angleproject:438226513 > Change-Id: I8892b438b3b05a3ce4e14f8c0769b81722688da8 > Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6845484 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:438226513 No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iff0d925b9fa608215cff0e472074a0315f14e861 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6863019 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Sungyong Choi dc24ecca 2025-08-13T15:50:24 Rename enums to fix GCC -Wchanges-meaning error Renamed enums Key and MouseButton to enum class KeyType and MouseButtonType to avoid name conflicts with union members in Event.h on GCC, and to follow the ANGLE style guide preference for scoped enums. BUG: angleproject:438226513 Change-Id: I8892b438b3b05a3ce4e14f8c0769b81722688da8 Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6845484 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cody Northrop e19377af 2024-08-21T14:52:09 Tests: Support multiple users on Android On most Android platforms, the userId is '0' and many of our defaults just work. But on some, the default is non-zero, and that complicates things. To support this, we have to specify which user is correct, which can be determined with: adb shell am get-current-user Update everywhere we were using sdcard directly and use: Before: /sdcard After: /storage/emulated/<userId> Incorporate the userId to find the application's home directory: Before: /data/data/com.android.angle.test After: /data/user/<userId>/com.android.angle.test This CL: - Starts using a user flag in our Android scripts - Updates where tests look for test data and binaries - Updates where scripts use temp and external storage - Updates script to not use sdcard at all when root - Disables run-as when user is not default Bug: b/361388557 Change-Id: I0fb556ecb2d0f6bc6569a858c290b127217d4638 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5825122 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Kimmo Kinnunen f507fe05 2023-04-06T12:27:00 Rename PLATFORM_IOS to PLATFORM_IOS_FAMILY The current define ANGLE_PLATFORM_IOS actually means "iOS or tvOS or WatchOS or MacCatalyst". The current define ANGLE_PLATFORM_WATCHOS means nothing. The current define ANGLE_PLATFORM_APPLETV means nothing. Replace PLATFORM_IOS and its uses with PLATFORM_IOS_FAMILY, so that then PLATFORM_IOS can be reintroduced and others can be fixed. Replace PLATFORM_IOS_SIMULATOR and its uses with PLATFORM_IOS_FAMILY_SIMULATOR for consistency. Use consistent `#if X` notation instead of `#if defined(X)`. Bug: angleproject:8121 Change-Id: Ibe668c2ae9bb801d15e036fcf1dfd53f22c30787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404161 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Sungyong Choi dc741ad6 2022-09-27T13:42:39 Add cstring header for memcpy and strcmp This patch adds cstring header for memcpy and strcmp Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Change-Id: I8130010a07d43490417302d0aa5557c3224d56ed Bug: angleproject:7765 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963829 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov cd0f642e 2022-08-29T17:25:33 Fix loading end2end test expectations on iOS Need to be packed and found in the application bundle. Bug: angleproject:5417 Change-Id: Iaf84ced0de6674a807aa747e71dbbf2715bbd6fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3860831 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Antonio Caggiano 2a9c4b01 2022-02-10T11:33:32 dEQP: Enable CreateSurfacePlatformEXT tests Add the corresponding capability to NativeWindow and implement getPlatformExtension virtual method to return a native pointer that can be used with eglCreatePlatformWindowSurfaceEXT(). Bug: angleproject:6961 Change-Id: Ieb1a1fd8b3cae4e6f199c269f3922cbd0307aa35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3452102 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 00643e7d 2020-07-22T20:58:49 Use Android API to get storage path. This pipes through to a system call via JNI. This will allow Chromium changes to land that were prevented because ANGLE hard-coded some parts of this path. This in turn will allow us to more easily override these paths for changes needed for Android R support. Bug: chromium:1094062 Change-Id: I20d75b8ee40d418ba5c057f618640ef896248299 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2315483 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill ecbac31c 2020-10-16T10:36:06 Perf Tests: Add offscreen mode. This lets the trace perf tests run configurable number of frames within a single swap. The offscreen config is similar to how gfxbench works. It renders to a user FBO (by overriding calls to BindFramebuffer) and then composits multiple frames into the real backbuffer. This allows us to get a perf measurement with less overhead from composition and display. Adds emulation for some APIs that operate on Framebuffers like BindFramebuffer, Invalidate, DrawBuffers and ReadBuffer. Bug: angleproject:4845 Change-Id: I1044c1d52c82f1c215a68a6c46d74c52ed0f3d2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300207 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Shahbaz Youssefi fdb7874d 2020-08-26T22:04:19 Gracefully fail end2end tests if no window support EGL_WINDOW_BIT is now specifically requested for tests that open a window (those that aren't WithNoFixture). This makes sure pbuffer-only configs are not selected for the window. Additionally, a few WithNoFixture tests are made more robust in the presence of no-window configs. In the context of crbug.com/1034840, this means that a subset of end2end tests would be able to run in a remote desktop environment. Tested on Linux/X11 by turning a subset of configs PBUFFER-only. Bug: chromium:1034840 Change-Id: I09fd149d43d3b865856fe6b9491c5f333f4a2efc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378922 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: back sept 10 - Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ad398ee8 2019-01-03T13:01:08 Free OSWindow and EGLWindow through helpers. This cleans up any potential problems with allocating and freeing resources in different shared objects or DLLs. Previously we were using a dynamically linked allocation function and then calling the standard delete function. Also adds a base class helper for EGLWindow. Will base the WGL Window class on this. Needed for running ANGLE tests against native drivers. Bug: angleproject:2995 Change-Id: Ic92b447649ebb32c547605c20086c07a601842f0 Reviewed-on: https://chromium-review.googlesource.com/c/1393443 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill acf2f3ad 2017-11-21T19:22:44 Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez b29690a6 2015-07-15T12:59:28 OSWindow: small fix to the formatting of key event debugging BUG= Change-Id: I09ab785311ec0fa7f3eecb6484a965378a1fef0d Reviewed-on: https://chromium-review.googlesource.com/285835 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 3ebfcd62 2015-07-06T23:35:20 OSWindow: add KeyEvent debugging BUG=angleproject:892 Change-Id: I35288ff43fb7a50a327047eacb8f41ca91e2b441 Reviewed-on: https://chromium-review.googlesource.com/283471 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez fb28d3c5 2015-05-21T18:02:02 X11Window: handling of ConfigureNotify, work when reparented BUG=angleproject:892 Change-Id: Ib201a5fbf4fca39c90464ed76434dac5e5ded381 Reviewed-on: https://chromium-review.googlesource.com/272683 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 938f1ca3 2015-05-12T10:21:17 OSWindow: add optional debugging of events received BUG=angleproject:830 Change-Id: Icd854ee152f15ec1de4293b5ed2ed49cb1a5fc2b Reviewed-on: https://chromium-review.googlesource.com/270451 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 8eb2d14c 2015-05-04T12:52:05 Fix 'not all switch case are handled' warning in OSWindow.cpp Change-Id: Ib4d1e4b04c73e5eb5e0e4f6c56212e99723d2ce0 Reviewed-on: https://chromium-review.googlesource.com/269126 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 681ad9d1 2015-04-23T12:27:56 Add a sample that uses multiple windows. BUG=angleproject:521 Change-Id: I50858193518b4d07edcb2073caaa99ce37fcc4c3 Reviewed-on: https://chromium-review.googlesource.com/267000 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 77a72f6e 2015-04-14T11:18:32 Release Surface when calling makeCurrent with null. Refactorings to egl::Surface to enable ref-counting were causing a situation where we could have two Window surfaces alive at the same time. This would confuse the window procedure logic in SurfaceD3D. Releasing the surface fixes this issue and conforms closely to the wording on the spec on when Surfaces should be deleted. Also add a test for message loops and surfaces. BUG=475085 BUG=angleproject:963 Change-Id: Icdee3a7db97c9b54d779dabf1e1f82a89fefc546 Reviewed-on: https://chromium-review.googlesource.com/265064 Reviewed-by: Kenneth Russell <kbr@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4119ed3d 2014-10-01T10:41:40 Make OSWindow a non-static member of ANGLETest. BUG=angle:611 Change-Id: I455e1dd0ad5582191621e316c4808a2d753e9aaa Reviewed-on: https://chromium-review.googlesource.com/219867 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 18b931d5 2014-09-29T12:58:31 Configure Google Tests to run against multiple renderers/GLES versions BUG=angle:611 Change-Id: I7d43612171c439045038db9ae82fd8716c0b31c6 Reviewed-on: https://chromium-review.googlesource.com/220400 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Jamie Madill 44771099 2014-08-28T09:21:35 Make OSWindow destructor virtual. BUG=angle:734 Change-Id: I6deb639abc26a314dd890189613e0a3a2e1be1d2 Reviewed-on: https://chromium-review.googlesource.com/214714 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
Jamie Madill 1cfaaf8a 2014-08-21T10:04:04 Add a util project to share between samples and tests. This code shares the Window and EGL logic between the two projects. BUG=angle:730 Change-Id: I8940371226a8f7b02579c332f51679c4a5d0e2a5 Reviewed-on: https://chromium-review.googlesource.com/212799 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>