Use getters to expose NativePixmapHandle from GpuMemoryBufferHandle
This moves GpuMemoryBufferHandle a bit closer to the world where the
various fields are encapsulated within GpuMemoryBufferHandle. Similar to
previous CLs:
- the only way to extract a mutable gfx::NativePixmapHandle from a
gfx::GpuMemoryBufferHandle is to consume the original GMBH.
- non-mutable access is still possible via a getter
- gfx::GpuMemoryBufferHandle has a new constructor overload to construct
a NATIVE_PIXMAP directly from a gfx::NativePixmapHandle.
This does reveal a few issues with code that assumes it always has a
gfx::NATIVE_PIXMAP; this is not actually the case in many tests, which
use TestSharedImageInterface, which only supports shmem GMB handles. To
reflect this reality, non-test code that is affected by this now has an
explicit check that the GMB handle is of the appropriate type, with an
else branch to indicate that this situation only occurs in tests.
This CL was tested using the CQ :) Due to the potential of unknown
unknowns, all newly-introduced type-safety checks are not fatal until
M139.
Bug: 40584691
Change-Id: I05ad7ff6c9904d64edfc570586be36df10eff52d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6374406
Reviewed-by: Vasiliy Telezhnikov <[email protected]>
Reviewed-by: Yury Khmel <[email protected]>
Reviewed-by: Shik Chen <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Reviewed-by: vikas soni <[email protected]>
Reviewed-by: Kramer Ge <[email protected]>
Commit-Queue: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1453431}
diff --git a/base/check_is_test.h b/base/check_is_test.h
index d4d4de9..9638b2f 100644
--- a/base/check_is_test.h
+++ b/base/check_is_test.h
@@ -52,6 +52,7 @@
CHECK(base::internal::get_is_test_impl() __VA_OPT__(, ) __VA_ARGS__)
// In special cases, code should not execute in a test.
-#define CHECK_IS_NOT_TEST() CHECK(!base::internal::get_is_test_impl())
+#define CHECK_IS_NOT_TEST(...) \
+ CHECK(!base::internal::get_is_test_impl(), __VA_ARGS__)
#endif // BASE_CHECK_IS_TEST_H_