New issue
Advanced search Search tips

Issue 837660 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 682825
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug



Sign in to add a comment

[MacViewsBrowser] Blank areas seen during window resizing

Project Member Reported by sdy@chromium.org, Apr 27 2018

Issue description

Chrome Version: 68.0.3410.0
OS: macOS 10.13.4

What steps will reproduce the problem?
(1) Run Chrome with --enable-features=ViewsBrowserWindows.
(2) Resize a browser window rapidly – using the bottom right corner makes the issue the most obvious.

What is the expected result?
Smooth resizing, or, at least, Cocoa controls don't jump around.

What happens instead?
Empty patches are seen and the window content, including Cocoa controls, is sometimes misplaced for a frame. Example attached.
 
Screen Shot 2018-04-27 at 11.33.03 AM.png
127 KB View Download

Comment 1 by sdy@chromium.org, Apr 27 2018

chrome://gpu report:

Graphics Feature Status
Canvas: Hardware accelerated
CheckerImaging: Disabled
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Rasterization: Hardware accelerated
Surface Synchronization: Enabled
Video Decode: Hardware accelerated
Viz Service Display Compositor: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
add_and_true_to_loop_condition
adjust_src_dst_region_for_blitframebuffer
decode_encode_srgb_for_generatemipmap
disable_framebuffer_cmaa
disable_webgl_rgb_multisampling_usage
dont_use_loops_to_initialize_variables
emulate_abs_int_function
flush_on_framebuffer_change
get_frag_data_info_bug
init_two_cube_map_levels_before_copyteximage
msaa_is_slow
pack_parameters_workaround_with_pack_buffer
rebind_transform_feedback_before_resume
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
reset_teximage2d_base_level
rewrite_texelfetchoffset_to_texelfetch
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
unpack_image_height_workaround_with_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
Problems Detected
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Multisample renderbuffers with format GL_RGB8 have performance issues on Intel GPUs.: 607130
Applied Workarounds: disable_webgl_rgb_multisampling_usage
Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
glResumeTransformFeedback works incorrectly on Intel GPUs: 638514
Applied Workarounds: rebind_transform_feedback_before_resume
Result of abs(i) where i is an integer in vertex shader is wrong: 642227
Applied Workarounds: emulate_abs_int_function
Rewrite texelFetchOffset to texelFetch for Intel Mac: 642605
Applied Workarounds: rewrite_texelfetchoffset_to_texelfetch
Rewrite condition in for and while loops for Intel Mac: 644669
Applied Workarounds: add_and_true_to_loop_condition
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Init first two levels before CopyTexImage2D for cube map texture on Intel Mac 10.12: 648197
Applied Workarounds: init_two_cube_map_levels_before_copyteximage
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
Tex(Sub)Image3D performs incorrectly when uploading from unpack buffer with GL_UNPACK_IMAGE_HEIGHT greater than zero on Intel Macs: 654258
Applied Workarounds: unpack_image_height_workaround_with_unpack_buffer
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Reset TexImage2D base level to 0 on Intel Mac 10.12.4: 705865
Applied Workarounds: reset_teximage2d_base_level
Switching framebuffers without a flush can lead to crashes on Intel 9th Generation GPU Macs.: 783979
Applied Workarounds: flush_on_framebuffer_change
Don't expose disjoint_timer_query extensions to WebGL: 808744
Shader variable initialization in a loop caused perf regression on Mac Intel.: 809422
Applied Workarounds: dont_use_loops_to_initialize_variables
Viz service display compositor is not enabled by default.
Disabled Features: viz_display_compositor
Checker-imaging has been disabled via finch trial or the command line.
Disabled Features: checker_imaging
Version Information
Data exported	2018-04-27T15:55:11.551Z
Chrome version	Chrome/68.0.3410.0
Operating system	Mac OS X 10.13.4
Software rendering list URL	https://chromium.googlesource.com/chromium/src/+/244bd88b9f49eeb69a105d923fc3e23190e14399/gpu/config/software_rendering_list.json
Driver bug list URL	https://chromium.googlesource.com/chromium/src/+/244bd88b9f49eeb69a105d923fc3e23190e14399/gpu/config/gpu_driver_bug_list.json
ANGLE commit id	b221486a8dfd
2D graphics backend	Skia/68 a070ed7fccd8bc9c5f314e1a4ac090c497862836-
Command Line	/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary --isolate-origins=https://chromium.org/,https://corp.googleapis.com/,https://storage.googleapis.com,https://ajax.googleapis.com,https://fonts.googleapis.com,https://googleplex.com/,https://googlesource.com/,https://youtube.com/,https://google.com/,https://googleacquisitionmigration.com/,https://googleusercontent.com/,https://googleprod.com/,https://nest.com/,https://myworkday.com/,https://chromiumapp.org/,https://lucidchart.com/,https://service-now.com/,https://concursolutions.com/,https://salesforce.com/,https://gcorppartners.com/,https://morganstanley.com/,https://schwab.com/,https://qualtrics.com/,https://ultipro.com/,https://google.secure2-enroll.com/,https://googlegroups.com/,https://google.secure.force.com/,https://ebenefitsnow.com/,https://firebase.com/,https://elo.plusrelocation.com/,https://anthem.com/,https://g.viapeople.net/,https://gdjap.com/,https://asana.com/,https://perquisite.net/,https://postini.com/,https://perkhub.com/,https://gstave.us/,https://geolearning.com/,https://lecorpio.com/,https://inverify.net/,https://preceda.com.au/,https://secureacceptance.cybersource.com/,https://solium.com/,https://fgvms.com/,https://ridecell.com/,https://tds.ie/,https://sprinklr.com/,https://smartsheet.com/,https://fieldglass.net/,https://dochub.com/ --flag-switches-begin --top-chrome-md=material-refresh --enable-features=ViewsBrowserWindows --flag-switches-end
Driver Information
Initialization time	56
In-process GPU	false
Passthrough Command Decoder	false
Direct Composition	false
Supports overlays	false
Sandboxed	true
GPU0	VENDOR = 0x1002, DEVICE= 0x67ef
GPU1	VENDOR = 0x8086, DEVICE= 0x591b *ACTIVE*
Optimus	false
AMD switchable	true
Driver vendor	
Driver version	10.32.48
Driver date	
Pixel shader version	4.10
Vertex shader version	4.10
Max. MSAA samples	16
Machine model name	MacBookPro
Machine model version	14.3
GL_VENDOR	Intel Inc.
GL_RENDERER	Intel(R) HD Graphics 630
GL_VERSION	4.1 INTEL-10.32.48
GL_EXTENSIONS	GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Disabled WebGL Extensions	EXT_disjoint_timer_query EXT_disjoint_timer_query_webgl2
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x0000
GPU process crash count	0
Compositor Information
Tile Update Mode	Zero-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
R_16	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
BGRX_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_1010102	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBX_1010102	Software only
BGRA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBA_F16	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420	Software only
YUV_420_BIPLANAR	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
Display(s) Information
Info	Display[2077750269] bounds=[0,0 1440x900], workarea=[0,23 1440x877], scale=2, external.
Color space information	{primaries_d50_referred: [[0.6818, 0.3196], [0.2846, 0.6747], [0.1549, 0.0554]], transfer:0.0774*x + 0.0000 if x < 0.0404 else (0.9479*x + 0.0521)**2.4000 + 0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Video Acceleration Information
Decode h264 baseline	up to 4096x2160 pixels
Decode h264 extended	up to 4096x2160 pixels
Decode h264 main	up to 4096x2160 pixels
Decode h264 high	up to 4096x2160 pixels
Encode h264 baseline	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 main	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 high	up to 4096x2160 pixels and/or 30.000 fps
Log Messages
[14493:775:0427/115157.854197:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115157.854260:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115157.854274:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115157.854283:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115157.854330:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115157.854346:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115157.854369:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115157.854384:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115159.635055:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115159.635120:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115159.635148:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115159.635193:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115159.635248:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115159.635271:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115159.635291:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115159.635310:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115245.195164:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115245.195212:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115245.195239:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115245.195258:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115245.195305:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115245.195329:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[14493:775:0427/115245.195353:ERROR:gles2_cmd_decoder.cc(18106)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[14493:775:0427/115245.195373:ERROR:gles2_cmd_decoder.cc(12529)] : [.DisplayCompositor-0x7fe8b01e4000]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format

Comment 2 by sdy@chromium.org, Apr 27 2018

Note that making GpuMemoryBufferImplIOSurface::CreateFromHandle return nullptr or running Chrome with `--ui-disable-zero-copy` both seem to make this issue go away :/.

Comment 3 by sdy@chromium.org, Apr 27 2018

Okay, I found a better demo: comment out this line:
https://chromium.googlesource.com/chromium/src.git/+/1cc6de04d86c67235243fb793f5ba74f439eb334/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm#744
crbug_837660_demo.mp4
1.1 MB View Download
crbug_837660_demo_patched.mp4
223 KB View Download

Comment 4 by sdy@chromium.org, Apr 28 2018

Cc: sdy@chromium.org
 Issue 837835  has been merged into this issue.

Comment 5 by sdy@chromium.org, Apr 28 2018

I spent a good chunk of last week… and some of today… looking into this.

The way window resizing works today, a CATransaction begins in the browser, then a CATransaction begins *and ends* in the GPU process, then the browser CATransaction ends. At some point, the browser calls NSDisableScreenUpdates() to attempt to make the window update atomically, and then calls NSEnableScreenUpdates() once the GPU process reports that its CATransaction has ended.

It turns out that this doesn't work so well with IOSurfaces. The GPU process shares the browser's connection to the window server, and when the GPU process commits a transaction that sets layer contents' to IOSurfaces, this can mess with (that's as specific as I feel qualified to get) the browser's in-progress transaction.

I banged my head against this for a while and put together a minimal-ish PoC, which is attached. You can run it like this:

    make && ./RemoteRendered.app/Contents/MacOS/RemoteRendered

Resize the window as wildly as you can. It "helps" if you do it from the bottom right corner. You'll see the same flickering that shows up in Chrome right now.

I found one possible solution, which I'll cover in part 2.
RemoteRendered_minimal_proof_of_concept.zip
4.4 KB Download
crbug_837660_poc.mp4
547 KB View Download

Comment 6 by sdy@chromium.org, Apr 28 2018

When I was working on window resizing in  issue 617824 , I was looking at a less-documented solution involving adding completion handlers to different phases of the browser's CATransaction. As a last-ditch effort, I brought that back out here, and it helps a ton. In my test app, it even bumps the frame rate from ~40FPS to a solid 60FPS. My hunch is that it's because the app and renderer's transactions are being collapsed into a single transaction.

The change is to call [CATransaction begin] in the renderer and then only call [CATransaction commit] when the app is in the post commit phase of its CATransaction. So, before:

    App: start
    App: NSDisableScreenUpdates()
    Renderer: start
    Renderer: commit
    Renderer: finish
    App: NSEnableScreenUpdates()
    App: commit
    App: finish

(I made up the word "finish", I'm not sure what Apple calls it.)

After:

    App: start
    Renderer: start
    App: commit
    Renderer: commit
    Renderer: finish
    App: finish

A demo of this is attached.
RemoteRendered_iosurface_fix_demo.zip
9.4 KB Download
crbug_837660_fix.mp4
965 KB View Download
Another wrench in all of this is that we have 2 separate compositors that are drawing at the same time -- the ui::Compositor for the UI, and the ui::Compositor for the RWHVMac, and they both are trying to do their updates independently.

Re #2: Oddly, the flickering goes away entirely if we
- run with --disable-mac-overlays (this makes us render the screen using GL) *and*
- add a NSDisable/EnableScreenUpdates around the loop in MaybeWaitForFrame *and*
- disable the wait in RHWVMac 
None of this is reasonable, though :/

Re #6: That's very interesting! 
> "My hunch is that it's because the app and renderer's transactions are being collapsed into a single transaction."
I suspect that something like this is indeed what's going on.

I also wonder why the RWHVMac version is working so robustly, but this is not.

It may be that we should work on merging the two ui::Compositors, and that will make this more tractable (in the proposed #6, it's much easier to do with just a single transaction to worry about on both sides).
Components: -Blink>Compositing Internals>Compositing

Comment 9 by sdy@chromium.org, Apr 30 2018

> I also wonder why the RWHVMac version is working so robustly, but this is not.

I think I remember not seeing as much IOSurface churn coming from that compositor, or at all in Cocoa browser mode. I'm not sure why.

> It may be that we should work on merging the two ui::Compositors, and that will make this more tractable (in the proposed #6, it's much easier to do with just a single transaction to worry about on both sides).

TBD when we chat offline.

Comment 10 by sdy@chromium.org, May 22 2018

Mergedinto: 682825
Status: Duplicate (was: Assigned)
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07a1071502f4699d445d0b7f46f3ca27d10efef0

commit 07a1071502f4699d445d0b7f46f3ca27d10efef0
Author: Sidney San Martín <sdy@chromium.org>
Date: Sun Jun 03 01:31:10 2018

De-jank window resizing in MacViews (part 1).

Two kinds of jank can currently be seen while resizing MacViews windows:

1. The Views content doesn't swap in sync with the window frame, so
   flickers of grey gutter can be seen around the edges. Because the UI
   is anchored in the bottom left corner, it jumps around if you resize
   from that corner.

2. The window content, including Cocoa elements like the stoplight
   buttons, sometimes becomes detached from the shadow.

Here are the causes:

1. RenderWidgetHostViewMac and BridgedNativeWidget each have their own
   resize loops (one tries to wait for a new frame, then the other).

2. When the GPU process assigns new IOSurfaces to CALayers' contents and
   commits a CATransaction, it can cause this kind of jank, even if the
   layers' CAContext isn't being displayed. As far as I can tell, it
   happens because the browser and GPU processes share a WindowServer
   connection.

This CL creates a CATransactionObserver class that coordinates multiple
objects which want to block when the current CATransaction commits. It
uses SPI to add hooks into the pre and postcommit phases of the current
CATransaction when activated by calling (from anywhere):

    ui::CATransactionObserver::SynchronizeTransaction();

BridgedNativeWidget and RenderWidgetHostViewMac block the precommit
phase to wait for frames of the right size, which fixes (1).

Bug:  837660 
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: Ia5b7db511b8d60a52d31765e71879dd026c1bdce
Reviewed-on: https://chromium-review.googlesource.com/1066304
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563958}
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/content/browser/frame_host/blocked_scheme_navigation_browsertest.cc
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/ui/accelerated_widget_mac/BUILD.gn
[add] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/ui/accelerated_widget_mac/ca_transaction_observer.h
[add] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/ui/accelerated_widget_mac/ca_transaction_observer.mm
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/07a1071502f4699d445d0b7f46f3ca27d10efef0/ui/views/widget/widget_interactive_uitest.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Jun 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aa3b48f71b662b494ef999513d4fc746aadaf6a8

commit aa3b48f71b662b494ef999513d4fc746aadaf6a8
Author: Sidney San Martín <sdy@chromium.org>
Date: Sun Jun 03 08:10:05 2018

Hopefully fix a broken test triggered by r563958.

Just below is a wait for profile2's HistoryService to load, but nothing
waited for profile1's. Now there's a matching wait.

TBR=avi

Bug:  837660 
Change-Id: Ie99a050bde6a9f8dd4dc80a51aa31b8d3d3bb8f4
Reviewed-on: https://chromium-review.googlesource.com/1083639
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563962}
[modify] https://crrev.com/aa3b48f71b662b494ef999513d4fc746aadaf6a8/chrome/browser/app_controller_mac_browsertest.mm

Project Member

Comment 13 by bugdroid1@chromium.org, Jun 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8e83f64996492c0e82ced861f32db348e7750047

commit 8e83f64996492c0e82ced861f32db348e7750047
Author: Sidney San Martín <sdy@chromium.org>
Date: Sun Jun 03 09:34:18 2018

Disable CATransaction sync on macOS <10.11.

It doesn't exist in 10.10 and earlier.

TBR=avi

Bug:  837660 
Change-Id: I9f3a7d49e2f9b0e59445bc2c471c050b355963f1
Reviewed-on: https://chromium-review.googlesource.com/1083721
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563964}
[modify] https://crrev.com/8e83f64996492c0e82ced861f32db348e7750047/ui/accelerated_widget_mac/ca_transaction_observer.h
[modify] https://crrev.com/8e83f64996492c0e82ced861f32db348e7750047/ui/accelerated_widget_mac/ca_transaction_observer.mm

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7cfea53cdb0298aaedbd84d4d2a4559c6d2bfd23

commit 7cfea53cdb0298aaedbd84d4d2a4559c6d2bfd23
Author: Sidney San Martín <sdy@chromium.org>
Date: Sun Jun 03 20:43:14 2018

Add a comment describing CATransactionCoordinator's function.

Bug:  837660 
Change-Id: Ic2a0384c82aaa403834087e8cd0bb1a410200c21
Reviewed-on: https://chromium-review.googlesource.com/1083893
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563975}
[modify] https://crrev.com/7cfea53cdb0298aaedbd84d4d2a4559c6d2bfd23/ui/accelerated_widget_mac/ca_transaction_observer.h

Project Member

Comment 15 by bugdroid1@chromium.org, Jun 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0ea7f3c0f8f94b08516c9c765c9d475f57d5c53f

commit 0ea7f3c0f8f94b08516c9c765c9d475f57d5c53f
Author: Sidney San Martín <sdy@chromium.org>
Date: Sun Jun 03 22:09:00 2018

De-race PDFExtensionTest.NavigationOnCorrectTab.

TBR=avi

Bug:  837660 
Change-Id: I89edb8171622a88adbb41e40187e463b11b4a97f
Reviewed-on: https://chromium-review.googlesource.com/1084035
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563977}
[modify] https://crrev.com/0ea7f3c0f8f94b08516c9c765c9d475f57d5c53f/chrome/browser/pdf/pdf_extension_test.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Jun 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/33c142b74c7311a6a59f4fb2729f02ea05d806c0

commit 33c142b74c7311a6a59f4fb2729f02ea05d806c0
Author: Trent Apted <tapted@chromium.org>
Date: Mon Jun 04 02:14:25 2018

Disable a few failing tests on Mac after resize tweaks in r563958.

Possibly some assumptions these tests are relying on have changed.
Details in  https://crbug.com/849129 

TBR=sdy@chromium.org

Bug:  849129 ,  837660 
Change-Id: I6d01ae3ae0f054df982e4fdc4fede3abc9977557
Reviewed-on: https://chromium-review.googlesource.com/1084143
Reviewed-by: Trent Apted <tapted@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563988}
[modify] https://crrev.com/33c142b74c7311a6a59f4fb2729f02ea05d806c0/chrome/browser/devtools/devtools_sanity_browsertest.cc
[modify] https://crrev.com/33c142b74c7311a6a59f4fb2729f02ea05d806c0/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Jun 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c

commit 9387b40dd397f3644ea9c0146eaec02ecd5dcd7c
Author: Sidney San Martín <sdy@chromium.org>
Date: Fri Jun 08 18:13:26 2018

De-jank window resizing in MacViews (part 2).

Part 1: https://chromium-review.googlesource.com/c/chromium/src/+/1066304

This change picks up from the above CL and adds hooks into the GPU process to
coordinate its CATransaction with the browser's on request (e.g. for resize).

New GPU IPCs let the browser process, via CATransactionObserver, begin a
transaction and then end it while in the post commit phase of its
CATransaction. This makes compositor changes display atomically with changes in
the browser process. It also fixes the window frame jank described in the above
CL when the GPU process assigns new IOSurfaces as CALayer contents.

I think this is because the two CATransactions happen as one from the window
server's point of view: in a test app, committing the two transactions like
this significantly reduced the time to commit.

Bug:  837660 
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: Ib5b2a3a3cae76640cc9872b7f265cb3bd13143a4
Reviewed-on: https://chromium-review.googlesource.com/1077047
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565687}
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/components/viz/host/server_gpu_memory_buffer_manager_unittest.cc
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/components/viz/service/gl/gpu_service_impl.cc
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/components/viz/service/gl/gpu_service_impl.h
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/content/browser/BUILD.gn
[add] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/content/browser/gpu/ca_transaction_gpu_coordinator.cc
[add] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/content/browser/gpu/ca_transaction_gpu_coordinator.h
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/content/browser/gpu/gpu_process_host.cc
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/content/browser/gpu/gpu_process_host.h
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/services/viz/privileged/interfaces/gl/gpu_service.mojom
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/ui/accelerated_widget_mac/ca_transaction_observer.h
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/ui/accelerated_widget_mac/ca_transaction_observer.mm
[modify] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/ui/base/BUILD.gn
[add] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/ui/base/cocoa/quartz_util.h
[add] https://crrev.com/9387b40dd397f3644ea9c0146eaec02ecd5dcd7c/ui/base/cocoa/quartz_util.mm

Sign in to add a comment