They are almost always called one after the other, it would be simpler to do it in one go. A mailbox that hasn't been produced is not meaningful, and producing to the same mailbox twice is an indication of a potential for misuse.
shubiseabdela@gmailcom
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/26c522780d080bf36dde940be871b65f3547683c commit 26c522780d080bf36dde940be871b65f3547683c Author: Antoine Labour <piman@chromium.org> Date: Fri Jun 01 20:36:45 2018 DrawingBuffer: produce texture exactly when we create mailbox A follow-up change will merge GenMailboxCHROMIUM and ProduceTextureDirectCHROMIUM, but specifically this also fix a couple of issues: 1- it's not needed to ProduceTextureDirectCHROMIUM the same texture multiple times with the same mailbox 2- producing the same texture with multiple mailboxes can cause overhead (creating the name) and leaks as mailboxes only get unassociated with textures when the texture is destroyed (or the mailbox is associated with another texture). Bug: 847674 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I555d4dfc62ccc898e0cac9abaed32e7eef05930c Reviewed-on: https://chromium-review.googlesource.com/1081680 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Antoine Labour <piman@chromium.org> Cr-Commit-Position: refs/heads/master@{#563778} [modify] https://crrev.com/26c522780d080bf36dde940be871b65f3547683c/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc [modify] https://crrev.com/26c522780d080bf36dde940be871b65f3547683c/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2d2c78a84b8becad69f693679d09f7bbb4210af7 commit 2d2c78a84b8becad69f693679d09f7bbb4210af7 Author: Antoine Labour <piman@chromium.org> Date: Fri Jun 01 21:52:08 2018 XRWebGLDrawingBuffer: produce texture exactly when we create mailbox This avoids producing the same texture multiple times with the same mailbox, which is redundant. A follow-up change will merge GenMailboxCHROMIUM and ProduceTextureDirectCHROMIUM. Bug: 847674 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I0d649c3e1e177bef7b8239ea4281dd66cc2789b9 Reviewed-on: https://chromium-review.googlesource.com/1081277 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Antoine Labour <piman@chromium.org> Cr-Commit-Position: refs/heads/master@{#563816} [modify] https://crrev.com/2d2c78a84b8becad69f693679d09f7bbb4210af7/third_party/blink/renderer/platform/graphics/gpu/xr_webgl_drawing_buffer.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/04cb3b28bc17c2d87611276afebd5b4d7236477f commit 04cb3b28bc17c2d87611276afebd5b4d7236477f Author: Antoine Labour <piman@chromium.org> Date: Fri Jun 01 23:25:10 2018 PPB_VideoDecoder: create mailbox names on the plugin side For obscure historical reasons, mailbox names were created on the renderer side whereas the textures are produced on the plugin side. Move the mailbox name creation to the plugin side so that it happens when the textures are produced. A follow-up will merge the 2 operations. Bug: 847674 Change-Id: Ia8cde57c2c0421e1361ddb14de63f02a34ea9b6f Reviewed-on: https://chromium-review.googlesource.com/1081669 Reviewed-by: Bill Budge <bbudge@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Antoine Labour <piman@chromium.org> Cr-Commit-Position: refs/heads/master@{#563858} [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/content/renderer/pepper/pepper_video_decoder_host.cc [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/content/renderer/pepper/pepper_video_decoder_host.h [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/content/renderer/pepper/video_decoder_shim.cc [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/content/renderer/pepper/video_decoder_shim.h [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/ppapi/proxy/ppapi_messages.h [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/ppapi/proxy/video_decoder_resource.cc [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/ppapi/proxy/video_decoder_resource.h [modify] https://crrev.com/04cb3b28bc17c2d87611276afebd5b4d7236477f/ppapi/proxy/video_decoder_resource_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/efc84542bc7907d69aba080cf7ec536cf9967b2a commit efc84542bc7907d69aba080cf7ec536cf9967b2a Author: Antoine Labour <piman@chromium.org> Date: Wed Jun 06 23:53:53 2018 GraphicsContext3DUtils: produce texture exactly when we create mailbox This avoids producing the same texture multiple times with the same mailbox, which is redundant. A follow-up change will merge GenMailboxCHROMIUM and ProduceTextureDirectCHROMIUM. Bug: 847674 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I20561edc0490a1f2e2ea86af9c778c48a14a57fe Reviewed-on: https://chromium-review.googlesource.com/1083142 Reviewed-by: Justin Novosad <junov@chromium.org> Commit-Queue: Antoine Labour <piman@chromium.org> Cr-Commit-Position: refs/heads/master@{#565107} [modify] https://crrev.com/efc84542bc7907d69aba080cf7ec536cf9967b2a/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc [modify] https://crrev.com/efc84542bc7907d69aba080cf7ec536cf9967b2a/third_party/blink/renderer/platform/graphics/gpu/graphics_context_3d_utils.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e228e9cb6492aa9e54a346021a4375606a06f2c4 commit e228e9cb6492aa9e54a346021a4375606a06f2c4 Author: Antoine Labour <piman@chromium.org> Date: Thu Jun 07 00:14:55 2018 MailboxToSurfaceBridge: produce texture exactly when we create mailbox This refactors MailboxToSurfaceBridge a bit based on existing callers. A follow-up change will merge GenMailboxCHROMIUM and ProduceTextureDirectCHROMIUM. DestroyMailboxTexture was dead code, so removed. We can resurrect in a later CL if needed. Bug: 847674 Change-Id: I8fa52a4b7288955d3571c41bdf7b23f0ca4290f0 Reviewed-on: https://chromium-review.googlesource.com/1083333 Reviewed-by: Klaus Weidner <klausw@chromium.org> Commit-Queue: Antoine Labour <piman@chromium.org> Cr-Commit-Position: refs/heads/master@{#565114} [modify] https://crrev.com/e228e9cb6492aa9e54a346021a4375606a06f2c4/chrome/browser/android/vr/arcore_device/ar_image_transport.cc [modify] https://crrev.com/e228e9cb6492aa9e54a346021a4375606a06f2c4/chrome/browser/android/vr/mailbox_to_surface_bridge.cc [modify] https://crrev.com/e228e9cb6492aa9e54a346021a4375606a06f2c4/chrome/browser/android/vr/mailbox_to_surface_bridge.h [modify] https://crrev.com/e228e9cb6492aa9e54a346021a4375606a06f2c4/chrome/browser/android/vr/vr_shell_gl.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3a776dc182a35bde8578ab641eaf3dfa964fa72c commit 3a776dc182a35bde8578ab641eaf3dfa964fa72c Author: Antoine Labour <piman@chromium.org> Date: Wed Jun 13 00:07:48 2018 Merge GenMailboxCHROMIUM into ProduceTextureDirectCHROMIUM ProduceTextureDirectCHROMIUM is always called after GenMailboxCHROMIUM (or equivalently gpu::Mailbox::Generate()), so merge both calls into a single one. This isn't intended to change any behavior. Note, TakeFrontBuffer still takes an explicitly generated gpu::Mailbox. Bug: 847674 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I7227ddffba6291c1efe3ed589bfbc6166f3319fe Reviewed-on: https://chromium-review.googlesource.com/1089695 Commit-Queue: Antoine Labour <piman@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Jonathan Backer <backer@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Reviewed-by: David Reveman <reveman@chromium.org> Reviewed-by: Frank Liberato <liberato@chromium.org> Reviewed-by: Klaus Weidner <klausw@chromium.org> Cr-Commit-Position: refs/heads/master@{#566633} [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/ash/components/fast_ink/fast_ink_view.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/layers/heads_up_display_layer_impl.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/layers/texture_layer_impl_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/paint/oop_pixeltest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/raster/gpu_raster_buffer_provider.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/raster/one_copy_raster_buffer_provider.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/raster/zero_copy_raster_buffer_provider.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/trees/layer_tree_host_impl.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/cc/trees/layer_tree_host_unittest_context.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/chrome/browser/android/vr/mailbox_to_surface_bridge.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/exo/buffer.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/client/client_resource_provider_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/common/gl_helper.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/common/yuv_readback_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/service/display/display_resource_provider_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/service/display/gl_renderer_copier.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/service/display/renderer_pixeltest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/test/test_gles2_interface.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/components/viz/test/test_gles2_interface.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/content/renderer/media/android/stream_texture_factory.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/content/renderer/pepper/pepper_graphics_2d_host.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/content/shell/test_runner/test_plugin.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/GLES2/gl2chromium_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/GLES2/gl2extchromium.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/build_gles2_cmd_buffer.py [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/build_raster_cmd_buffer.py [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_c_lib_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_cmd_helper_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_implementation.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_implementation_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_implementation_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_interface_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_interface_stub_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_trace_implementation_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_cmd_helper_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_implementation.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_implementation_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_implementation_gles.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_implementation_gles.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_implementation_gles_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/client/raster_interface_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/common/gles2_cmd_format_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/common/raster_cmd_format_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/gles2_cmd_buffer_functions.txt [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/raster_cmd_buffer_functions.txt [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/service/gles2_cmd_decoder.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/service/raster_decoder_autogen.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/gpu/command_buffer/tests/gl_texture_mailbox_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/media/blink/webmediaplayer_cast_android.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/media/renderers/paint_canvas_video_renderer.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/media/renderers/video_overlay_factory.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/media/renderers/video_resource_updater.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/media/video/gpu_memory_buffer_video_frame_pool.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/ppapi/proxy/compositor_layer_resource.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/ppapi/proxy/video_decoder_resource.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge_test.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/canvas_resource.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test_helpers.h [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/gpu/graphics_context_3d_utils.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context_test.cc [modify] https://crrev.com/3a776dc182a35bde8578ab641eaf3dfa964fa72c/third_party/blink/renderer/platform/graphics/gpu/xr_webgl_drawing_buffer.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61 commit dd54fede22bfcdb8b10040d6c60ae40a68b5aa61 Author: Antoine Labour <piman@chromium.org> Date: Wed Jun 13 01:11:32 2018 Simplify MailboxManager implementations After https://crrev.com/c/1089695, while using ProduceTextureDirect, it is not possible any more for a client to: 1- reassign an existing mailbox to another texture 2- unlink a mailbox from a texture TakeFrontBuffer can technically still do (1), but ReturnFrontBuffer is a good place to unlink the mailbox service-side. This allows some simplification of the MailboxManager implementations, as well as the decoders. Bug: 847674 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: I422b7ba8bcb762d1a5aea63f59dc833002f3d6b3 Reviewed-on: https://chromium-review.googlesource.com/1097696 Commit-Queue: Antoine Labour <piman@chromium.org> Reviewed-by: Jonathan Backer <backer@chromium.org> Cr-Commit-Position: refs/heads/master@{#566671} [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/gles2_cmd_decoder.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/mailbox_manager_impl.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/mailbox_manager_impl.h [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/mailbox_manager_sync.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/mailbox_manager_unittest.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/raster_decoder.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/texture_manager.cc [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/texture_manager.h [modify] https://crrev.com/dd54fede22bfcdb8b10040d6c60ae40a68b5aa61/gpu/command_buffer/service/texture_manager_unittest.cc
Comment 1 by piman@chromium.org
, May 30 2018