diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-25 17:50:00 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-25 17:50:00 +0000 |
commit | 7ff86b93008f19aaddac784323ce4117d6725aa0 (patch) | |
tree | ad24f5498395eb8a98232134ee23d092b7ee1240 /gpu/command_buffer/service/gles2_cmd_decoder_mock.h | |
parent | 49952775c67f130e37d3d892f17657f56efbbe7a (diff) | |
download | chromium_src-7ff86b93008f19aaddac784323ce4117d6725aa0.zip chromium_src-7ff86b93008f19aaddac784323ce4117d6725aa0.tar.gz chromium_src-7ff86b93008f19aaddac784323ce4117d6725aa0.tar.bz2 |
Resize synchronization for Linux.
This patch makes synchronous calls from the GPU to the Browser process to resize windows. It must be synchronous because we must be sure when the resize happens, it must be initiated by the GPU because we have to time the resize with GL drawing, and the resize must be done by the Browser because of how GDK/GTK is structured. Specifically, when a window that a GL context is associated with is resized, the back buffer gets blanked. So it is important that we synchronize the resize with the drawing to the back buffer. On Linux, the X window that we are drawing to is wrapped in a GdkWindow inside the Browser process. GDK/GTK assumes that all changes to the window happen via GDK calls. In particular, the size of the window is cached inside the GdkWindow object so that it does not have to make a call to the X server in order to get window geometry. Unfortunately, this necessitates resizing the window inside of the Browser process.
For more discussion of this approach and (some unsuccessfully attempted) alternatives see https://docs.google.com/a/google.com/document/d/1ZNouL-X_Ml1x8sqy-sofz63pDAeo36VWi_yQihaE2YI/edit?hl=en
This patch set uncovered another bug:
- open in two separate windows http://webkit.org/blog/386/3d-transforms/ and http://webkit.org/blog-files/3d-transforms/poster-circle.html
- resize the former until it is smallish
- watch the root layer of the former show up as the root layer of the later.
To my knowledge, this is first trigger of this bug. If and when this patch is accepted, I will file the bug.
BUG=http://code.google.com/p/chromium/issues/detail?id=54430
TEST=Go to http://peter.sh/2010/06/chromium-now-features-gpu-acceleration-and-css-3d-transforms/ . Rotate Z with the slider to trigger the compositor. Resize the window. The resize may be janky (we're uploading large textures), but it should display properly.
Contributed by backer@chromium.org
Review URL: http://codereview.chromium.org/5105006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/gles2_cmd_decoder_mock.h')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_mock.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index bee0202..a0e5c7e 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -44,6 +44,7 @@ class MockGLES2Decoder : public GLES2Decoder { MOCK_METHOD0(GetGLES2Util, GLES2Util*()); MOCK_METHOD0(GetGLContext, gfx::GLContext*()); MOCK_METHOD0(GetContextGroup, ContextGroup*()); + MOCK_METHOD1(SetResizeCallback, void(Callback1<gfx::Size>::Type*)); MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*)); MOCK_METHOD3(DoCommand, error::Error(unsigned int command, unsigned int arg_count, |