Merge lp://qastaging/~unity-team/nux/nux.fix_1091589.1 into lp://qastaging/nux
Status: | Merged |
---|---|
Approved by: | Stephen M. Webb |
Approved revision: | 819 |
Merged at revision: | 828 |
Proposed branch: | lp://qastaging/~unity-team/nux/nux.fix_1091589.1 |
Merge into: | lp://qastaging/nux |
Diff against target: |
2558 lines (+1220/-264) 24 files modified
Nux/Area.cpp (+5/-6) Nux/BaseWindow.cpp (+41/-0) Nux/BaseWindow.h (+15/-0) Nux/GridHLayout.cpp (+1/-4) Nux/GridVLayout.cpp (+3/-10) Nux/View.cpp (+7/-4) Nux/WindowCompositor.cpp (+243/-97) Nux/WindowCompositor.h (+25/-12) Nux/WindowThread.cpp (+101/-31) Nux/WindowThread.h (+54/-4) NuxCore/Rect.cpp (+20/-12) NuxCore/Rect.h (+4/-0) NuxGraphics/GLDeviceFrameBufferObject.cpp (+20/-5) NuxGraphics/GpuDevice.cpp (+7/-1) NuxGraphics/GpuDeviceTexture.cpp (+7/-1) NuxGraphics/GraphicsEngine.cpp (+14/-14) NuxGraphics/GraphicsEngine.h (+5/-5) NuxGraphics/IOpenGLFrameBufferObject.cpp (+14/-8) NuxGraphics/IOpenGLFrameBufferObject.h (+1/-1) configure.ac (+2/-3) debian/changelog (+7/-0) tests/gtest-nux-windowcompositor.cpp (+109/-44) tests/gtest-nux-windowthread.cpp (+498/-1) tests/gtest-nuxgraphics-texture.cpp (+17/-1) |
To merge this branch: | bzr merge lp://qastaging/~unity-team/nux/nux.fix_1091589.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Stephen M. Webb (community) | Approve | ||
Brandon Schaefer (community) | Approve | ||
Christopher Townsend (community) | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2013-05-26.
Commit message
Allow embedded clients to specify which windows should be redrawn.
Added some new API to nux to allow embedded clients (eg, compiz) to specify which BaseWindows should be redrawn on a frame. This is done by passing a list of rectangles to nux which represent the redraw region, and nux will mark all intersecting windows as needing re-presenting to the screen. This means that we aren't re-presenting every window to the screen on every frame (bad for performance, and also doesn't work correctly in the buffer-swap case).
Also added API to allow nux to tell the difference between draw and read framebuffers when it plays around with the framebuffer object binding. This is necessary in case the embedded client expects the read framebuffer binding to remain defined even after nux has changed the draw framebuffer binding.
(LP: #1091589)
Description of the change
Allow embedded clients to specify which windows should be redrawn.
Added some new API to nux to allow embedded clients (eg, compiz) to specify which BaseWindows should be redrawn on a frame. This is done by passing a list of rectangles to nux which represent the redraw region, and nux will mark all intersecting windows as needing re-presenting to the screen. This means that we aren't re-presenting every window to the screen on every frame (bad for performance, and also doesn't work correctly in the buffer-swap case).
Also added API to allow nux to tell the difference between draw and read framebuffers when it plays around with the framebuffer object binding. This is necessary in case the embedded client expects the read framebuffer binding to remain defined even after nux has changed the draw framebuffer binding.
(LP: #1091589)
Both APIs are fully tested.
Update: test results here: http://
I was careful to modify phoronix-test-suite to run tests in windowed mode only, and those were the only three tests I was able to get to run in windowed mode. Of particular interest was the fact that the unigine demos had a 5x performance improvement, probably because the driver was spending less time filling redundant pixels from the compositor. In other areas we had a roughly 5FPS boost.
Compiz framerate graph:
http://
You'll see that especially on the last test, it drops off quite a bit on the non buffer_age case, and is generally speaking lower across the board.
39 + void BaseWindow: :WasPresentedIn EmbeddedMode( ) in_embedded_ mode = false; _geometry_ in_embedded_ mode = GetAbsoluteGeom etry();
40 + {
41 + _present_
42 + _last_presented
43 + }
Can we try to find a better name for this function? WasPresented* suggests me that the function should return a bool value.
45 + nux::Geometry const& BaseWindow: :LastPresentedG eometryInEmbedd edMode( ) _geometry_ in_embedded_ mode; :AllowPresentat ionInEmbeddedMo de() in_embedded_ mode;
46 + {
47 + return _last_presented
48 + }
49 +
50 + bool BaseWindow:
51 + {
52 + return _present_
53 + }
Can these methods be const?
+ for (WindowList: :iterator it = _view_window_ list.begin( ); list.end( );
145 + it != _view_window_
146 + ++it)
147 + {
148 + if (it->IsValid())
149 + func (*it);
150 + }
Why not a range-based for loop? :)
206 + void WindowComposito r::SetReference Framebuffer( unsigned int draw_fbo_object,
207 + unsigned int read_fbo_object,
208 + Geometry fbo_geometry)
Geometry const& fbo... ?
374 + WindowComposito r::WeakBaseWind owPtr ptr; compositor_ ->OnAllBaseWind ows(std: :bind(AssignWea kBaseWindowMatc hingRaw, _1, bw, &ptr));
375 + window_
It took me a while to understand what this code was for, maybe we can make it more readable.
406 + for (std::vector< WindowComposito r::WeakBaseWind owPtr>: :iterator it = list_embedded. begin() ; list_embedded. end();
407 + m_presentation_
408 + it != m_presentation_
409 + ++it)
410 + {
For range-based loop... :)
Btw logic looks good to me.