Merge lp://staging/~smspillaz/compiz-core/fix_896586_rotate_plugin into lp://staging/compiz-core/0.9.5

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp://staging/~smspillaz/compiz-core/fix_896586_rotate_plugin
Merge into: lp://staging/compiz-core/0.9.5
Prerequisite: lp://staging/~smspillaz/compiz-core/fix_891591
Diff against target: 2634 lines (+1267/-681)
28 files modified
include/core/CMakeLists.txt (+0/-2)
include/core/rect.h (+0/-236)
include/core/screen.h (+6/-3)
include/core/window.h (+15/-2)
plugins/CMakeLists.txt (+1/-0)
plugins/decor/src/decor.cpp (+4/-13)
plugins/move/src/move.cpp (+79/-20)
plugins/move/src/move.h (+16/-3)
plugins/opengl/include/opengl/opengl.h (+9/-2)
plugins/opengl/src/paint.cpp (+27/-22)
plugins/opengl/src/window.cpp (+4/-4)
plugins/rotate/src/rotate.cpp (+20/-5)
plugins/wobbly/src/wobbly.cpp (+42/-3)
plugins/wobbly/src/wobbly.h (+2/-0)
src/CMakeLists.txt (+5/-0)
src/rect.cpp (+0/-286)
src/rect/CMakeLists.txt (+66/-0)
src/rect/include/core/rect.h (+246/-0)
src/rect/src/rect.cpp (+306/-0)
src/rect/tests/CMakeLists.txt (+31/-0)
src/rect/tests/rect/src/test-rect.cpp (+106/-0)
src/rect/tests/test-rect.cpp (+34/-0)
src/rect/tests/test-rect.h (+44/-0)
src/rect/tests/wraparound_point/src/test-rect-wraparound-point.cpp (+78/-0)
src/screen.cpp (+32/-35)
src/window.cpp (+91/-44)
src/window/geometry-saver/CMakeLists.txt (+1/-0)
src/window/geometry/CMakeLists.txt (+2/-1)
To merge this branch: bzr merge lp://staging/~smspillaz/compiz-core/fix_896586_rotate_plugin
Reviewer Review Type Date Requested Status
Alan Griffiths Needs Fixing
Tim Penhey (community) Needs Fixing
Thomi Richards (community) Approve
Review via email: mp+84061@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2012-01-13.

Description of the change

Made the cube and rotate plugins work with paint offsets.

In order to implement this properly, we had to move from immediately updating the 2D display matrix of the window on position offset change to applying a 4x4 transformation matrix to the window before it is painted, like how global paint offsets work, which means that a lot of code was consolidated.

In terms of other plugins, the wobbly plugin needed to be updated to move its model entirely by the paint offset, since that is going to be the global display model for the window.

Added a test for points outside of rectangles to wrap-around a rectangle within it.

Moved some of the utility functions related to viewports into their own namespace.

Made CompScreen::moveViewport wrapable so that plugins can know when a viewport was just changed (eg, causing window movement to happen) rather than guessing.

Next pipe: lp:~smspillaz/compiz-core/fix_896762

To post a comment you must log in.
2907. By Sam Spilsbury

Merged compiz-core.fix_891591

2908. By Sam Spilsbury

Fix typo

2909. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2910. By Sam Spilsbury

Merged compiz-core.fix_891591

2911. By Sam Spilsbury

Include point.cpp in the build files

2912. By Sam Spilsbury

Added missing files

2913. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2914. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2915. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2916. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2917. By Sam Spilsbury

Merged fix_891591

2918. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2919. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2920. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2921. By Sam Spilsbury

Cleanup, fix hardcoded debugging value

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

ln 1204: Why the static cast? It looks to me like you're being given a CompRectTest* already...

Otherwise, looks good to me.

review: Approve
2922. By Sam Spilsbury

Merge

2923. By Sam Spilsbury

Merge

2924. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2925. By Sam Spilsbury

Merge

Revision history for this message
Tim Penhey (thumper) wrote :

> CompPoint remainingVp = CompPoint (screen->vpSize ().width () - wvp.x (),
> screen->vpSize ().height () - wvp.y ());

This is an inefficient way to write:

CompPoint remainingVp (screen->vpSize ().width () - wvp.x (),
                       screen->vpSize ().height () - wvp.y ());

The first way calls the constructor, then the copy constructor, then the destructor just to initialize remainingVp.

Please just use a constructor call. Please fix declarations in compiz::viewports::wraparoundOffsetForPoint.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> > CompPoint remainingVp = CompPoint (screen->vpSize ().width () - wvp.x (),
> > screen->vpSize ().height () - wvp.y ());
>
> This is an inefficient way to write:
>
>
> CompPoint remainingVp (screen->vpSize ().width () - wvp.x (),
> screen->vpSize ().height () - wvp.y ());
>
> The first way calls the constructor, then the copy constructor, then the
> destructor just to initialize remainingVp.

I'm suprised the compiler doesn't optimize that out.

>
> Please just use a constructor call. Please fix declarations in
> compiz::viewports::wraparoundOffsetForPoint.

ack

2926. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2927. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2928. By Sam Spilsbury

Don't read compiz pkg config file and cleanup

2929. By Sam Spilsbury

Merge

2930. By Sam Spilsbury

Merge

2931. By Sam Spilsbury

Merge

2932. By Sam Spilsbury

Added CompRect to testing and moved the wraparound point test to Google Test

2933. By Sam Spilsbury

Fix tests to make sure that width and height are relative and that the
intersection test reflects intersection and not union

2934. By Sam Spilsbury

Added a few FIXME notes

2935. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2936. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2937. By Sam Spilsbury

Expose rect in the plugins lists

2938. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2939. By Sam Spilsbury

Merge

2940. By Sam Spilsbury

Fix typo

2941. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2942. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2943. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2944. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2945. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> > This is an inefficient way to write:
> >
> > CompPoint remainingVp (screen->vpSize ().width () - wvp.x (),
> > screen->vpSize ().height () - wvp.y ());
> >
> > The first way calls the constructor, then the copy constructor, then the
> > destructor just to initialize remainingVp.
>
> I'm suprised the compiler doesn't optimize that out.

It is allowed to, but not required to - so the intent is explicit with the suggested syntax. (What actually happens varies with compiler/version and context.)

The same construct exists elsewhere. Vis:

357 + CompPoint gp = CompPoint (g.pos ().x () % (screen->vpSize ().width () * screen->width ()),
358 + g.pos ().y () % (screen->vpSize ().height () * screen->height ()));
359 + CompPoint dp = gp - window->serverGeometry ().pos ();
360 CompSize dsize = CompSize (g.width () - window->serverGeometry ().width (),
361 g.height () - window->serverGeometry ().height ());
...
2242 + compiz::window::Geometry ng = w->serverGeometry ();
...
2398 + CompPoint remainingVp = CompPoint (screen->vpSize ().width () - wvp.x (),
2399 + screen->vpSize ().height () - wvp.y ());
2400 + CompPoint maxOffset = CompPoint ((remainingVp.x () * screen->width ()) -
2401 + wp.x (),
2402 + (remainingVp.y () * screen->height ()) -
2403 + wp.y ());
2404 + CompPoint minOffset = CompPoint (-((screen->vpSize ().width () * screen->width ()) - maxOffset.x ()),
2405 + -((screen->vpSize ().height () * screen->height ()) - maxOffset.y ()));
2406 + CompRect constrain = CompRect (minOffset.x (), minOffset.y (),
2407 + maxOffset.x () - minOffset.x (),
2408 + maxOffset.y () - minOffset.y ());

> > Please just use a constructor call.

+1

review: Needs Fixing
2946. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2947. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2948. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2949. By Sam Spilsbury

Don't translate the 2D texture matrix or regions

2950. By Sam Spilsbury

Merge

2951. By Sam Spilsbury

Remove files no longer installed in this point

2952. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

Unmerged revisions

2952. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2951. By Sam Spilsbury

Remove files no longer installed in this point

2950. By Sam Spilsbury

Merge

2949. By Sam Spilsbury

Don't translate the 2D texture matrix or regions

2948. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2947. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2946. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2945. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2944. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

2943. By Sam Spilsbury

Merged compiz-core.fix_891591 into compiz-core.fix_896586_rotate_plugin.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches