Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[110] Fix NativePixmapEGLBinding setting GLImageNativePixmap color space
NOTE: There were conflicts in the cherrypick - see their resolution between PS1 and PS4. GLImageNativePixmap::SetColorSpace() sets its |color_space_| ivar. NativePixmapEGLBinding invokes this method after creating a GLImageNativePixmap via GLImageNativePixmap::CreateForPlane(). However, GLImageNativePixmap accesses |color_space_| only in its InitializeFromNativePixmap() method, which is itself called from CreateForPlane() following https://chromium-review.googlesource.com/c/chromium/src/+/4089503 (prior to that CL NativePixmapEGLBinding called CreateForPlane(), followed by SetColorSpace(), followed by Initialize()). Hence, the call to GLImageNativePixmap::SetColorSpace() no longer has the intended effect. This CL restores the previous behavior by passing |color_space| directly to CreateForPlane() and threading it through to its only usage point in GLImageNativePixmap::InitializeFromNativePixmap(). As part of this fix, we simplify the code by eliminating GLImageNativePixmap's |color_space_| ivar and SetColorSpace() method - neither of these are needed. In particular, note that while NativePixmapEGLBinding currently calls SetColorSpace() only if the color space is valid, the color space is defined to be valid iff it is not default-constructed. Hence, passing an invalid (i.e., default-constructed) ColorSpace object in the new approach has the same effect as the current behavior of not calling SetColorSpace() in this case and having GLImageNativePixmap operate on the default-constructed |color_space_| ivar. Bug: 1310018, 1404994 Change-Id: I78fe34f759924671a9672668224020d566c47bdb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4127314 Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1089652} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4152272 Cr-Commit-Position: refs/branch-heads/5481@{#200} Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
- Loading branch information