ui/gfx: enable unsafe-buffers

This file adds exemptions to all the files with current unsafe buffer
usage, and enables the unsafe-buffer protection for all other files
under //ui/gfx.

Bug: 354829279
Change-Id: Iea090753cecce3fbca838395221cf44d4bf0594c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5734516
Reviewed-by: Tom Sepez <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Auto-Submit: Elly FJ <[email protected]>
Commit-Queue: Tom Sepez <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1332484}
diff --git a/ui/gfx/half_float.cc b/ui/gfx/half_float.cc
index a1d78d0..f0873631 100644
--- a/ui/gfx/half_float.cc
+++ b/ui/gfx/half_float.cc
@@ -2,6 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#ifdef UNSAFE_BUFFERS_BUILD
+// TODO(crbug.com/354829279): Remove this and convert code to safer constructs.
+#pragma allow_unsafe_buffers
+#endif
+
 #include <cstring>
 
 #include "ui/gfx/half_float.h"